I'm trying to improve the performance of a web method in one of our applications.
I have got as far as I can get running the web method in a single server, so I thought I would try to split the process so that it runs in multiple servers.
At the moment, an xmlhttp request is made to pass an array (quepasatio) with all the objects to be processed by the web method, see code below:
xmlHttp.send("object=" + quepasatio + "&Type=" + Type + "&ToId=" + Guid + "&ToName=" + Name);
What I have done is split the quepasatio array into two and wrapped the xmlhttp in a for loop, but this does not seem to speed the process up.
What I'm trying to do is to send the xmlhttp requests off without waiting for the response, so that the second, third, ... nths request gets sent immediately after the first one.
You're likely sending it all in one shot and having the server break it up. Many browsers have connection limits that restrict how many requests they can have pending with the server, you may be bumping in to that.
Sending it all to a proxy that then divvy's it up means a single connection that can be shut down immediately once it's sent. But then you'll also need some polling mechanism to get the partial results back (if that's what you're after), so that complicates the problem as well.
The reason that this does not speed up the process is that the requests are queued on the server. The server will only process one request at a time from each user.
If you want the calls to be started in paralell, you have to make the web service session-less so that it doesn't queue the requests.