views:

101

answers:

3

Hello,

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.

Any ideas?

TIA

+1  A: 

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.

Will Hartung
A: 

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.

Guffa
What server are we talking about here?
Crescent Fresh
@crescentfresh: ASP.NET on IIS for example.
Guffa
Really? IIS can only process one request at a time? What does "from each user" mean?
Crescent Fresh
@crescentfresh: I believe that most web application platforms do that. Only one request for each user session is handled at a time, so that you don't have to synchronise all access to session data and don't have to handle the case of the same user doing several diffent things (or the same thing) at the same time in different threads.
Guffa
+1  A: 

Change your open method to:

xmlHttp.open("GET", url, true);

That will make yours send call to be async; more info here

Rubens Farias