views:

216

answers:

4

We are currently calling web services on our application server through our web server using asp/vbscript. This works very well during low load. However during high load it can sometimes take up to 25 seconds to execute a query like below:

Public Function GetValidLogon(storeKey, username)
 Dim req
 Set req = CreateObject("Microsoft.XMLHTTP")

 Dim soapReq
 soapReq = "<?xml version=""1.0"" encoding=""utf-8""?> " + _
    "<soap:Envelope " + _
     "xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"" " + _
     "xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" " + _
     "xmlns:xsd=""http://www.w3.org/2001/XMLSchema""&gt; " + _
     "<soap:Body> " + _
      "<GetValidLogon xmlns=""" + namespace + """> " + _ 
          "<storeKey>" + _
           CStr(storeKey) + _
          "</storeKey>" + _
          "<username>" + _
           CStr(username) + _
          "</username>" + _
      "</GetValidLogon> " + _
     "</soap:Body> " + _
    "</soap:Envelope>"

 req.open "POST", Me.serviceAddress, False
 req.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
 req.setRequestHeader "SOAPAction", Me.serviceNamespace + "GetValidLogon"
 req.send soapReq

 Set GetValidLogon = SOAPResponseTo_GetValidLogonOutput(req.responseText)
End Function

What do you think might be the issue? Is it the code we are using to call the web services(see above) or is it just the fact that we are using vbscript/asp to call web the web services? Can it be some settings in IIS...?

And every time, even during high load it's always fast when we are executing the web service directly on the application server.

A: 

I'd be curious to see if the server/code/IIS is limiting itself to only making N concurrent connections to the web services. This would cause other requests to queue up and block until the others were complete.

matt b
And how can I investigate if that is the case? Because I have also thought about that before -- That all requests gets queeueed after a while, making the service slow. But I don't really know how to monitor or investigate if that is the case.
aktersnurr
Have yoru service log every time it's coming up or shutting down. Or use WCF E2E tracing and look at it with svctraceviewer.exe in the SDK.
JohnW
@aktersnurr, I'm not quite sure how to trace that kind of think with ASP/VBS or IIS. You could just try to monitor traffic using something like WireShark, and see what how many outbound connections you are making at any given time.
matt b
I looked at wireshark, but I couldn't really find out how to monitor outbound connections.
aktersnurr
A: 

Where are the user credentials stored on the backend - within your application, in the database, or in Active Directory? Perhaps the issue isn't with your app, but rather your connection to AD.

JohnW
A: 

Does the performance problem also show up in your Development environment during load testing?

If so, then I suggest you create a test script by putting the above code into a test ASP page. Have the page accept two query string parameters, "n" and "m". Loop "n" times in a row, with "m" milliseconds of delay between each call, then see what happens. Maybe even see what happens when you call the same page from multiple requests.

From there, you can go on to examine the performance counters for IIS on the application server, noting whether you are dropping connections, and how long connections are waiting.

If necessary, you might then proceed to profile the web service. See Profiler Tools for .NET. The problem could be anywhere, even in the database, and these tools will help you narrow that down.

John Saunders
Which performance counters should I look for? The problem is not anywhere. Because as I wrote in my question the service is always executiong fast when I execute the service directly from the application server.
aktersnurr
+1  A: 

Never use

CreateObject("Microsoft.XMLHTTP")

in server side applications.. use

CreateObject("MSXML2.ServerXMLHTTP")

instead.

aktersnurr