Synchronous web request performance

  • Thread starter Thread starter TomR
  • Start date Start date
T

TomR

We are having problems with synchronus web request calls
blocking our ASP.NET performance. Here is the setup: We
have a php script running on Apache at Site A on the
internet. This script does nothing more than wait 15
seconds before serving a page. (You can try it if you
want. www.337skymaster.com/mypost.php) Using this page,
we can open four IE browsers on the same machine and start
each browser at the same time, and have all four complete
in less than 20 seconds.

If we use an aspx script on Site B with a synchronus
HttpWebRequest call to access Site A (simulating accessing
a bank credit card payyment gateway) and open four
browsers, only two pages get served at a time. The first
two take 15 seconds, the second two take 30 seconds. We
thought maybe this was due to make the reqests from the
same IP address, but we tried the same thing on four
machines with four different IP addresses as clients, and
got the same results (first two transactions take 15
seconds, second two take 30 seconds).

We are trying to build an e-commerce site that might be
processing 50 of these transactions simultaneously. What
might we be doing wrong in our code to cause this behavior?
 
Sorry, I should have noted that this article was written for ASPX pages, but
some of the concepts and configurations may also be enlightening for PHP and
Apache.

James
 
In reply to your second message, our problem is with an
ASPX page, not with Apache or PHP. The test site we are
using to simulate the bank is PHP, but the site that is
hanging up is IIS with ASP.NET.

As I said, we tried our best to use the methods in Matt
Powells article, but did not use HttpHandler. Is
necessary to use an HttpHandler just to do a garden
variety HTTP POST transaction from within a script? That
seems strange to me.

HELP!

Tom
 
Maybe you fixed something by now, but here's some notes from my tests.

If I do 4 winform apps with the same code, they all come back within 20
seconds. Four ASPX pages on one machine though show blocking of some of the
requests. However, I did two ASPX requests on two machines (that's all I had
available) and all came back within 20 seconds. I did add timing code to
measure the length of the actual request to the server, and it's around 15
seconds.

I ran NetMon, and here's some notes from that capture (running 4 Winform
apps and 4 Webpages on the same machine)

1. As a WinForm app, all 4 requests go out at the same time. Responses come
back within 20 seconds for all requests.
2. As a Web app, only 2 requests go out at a time. The other 2 block until
one of the first requests completes, and then uses the connection to make
it's initial request. So, although it takes 30s from start to finish, it's
only doing work from the 15s to the 30s mark.

James
 
Ok, another observation. I changed the value for the maxconnection to 20 in
the web.config, per the article's recommendation:

<connectionManagement>
<add address="*" maxconnection="20" />
</connectionManagement>

I noticed though that if you have 4 separate Internet Explorer browser
*processes* (IExplore.exe in Task Manager), and not separate
windows/instances, then 4 connections will go out at once, and you can have
all 4 requests come back in 20 seconds. However, with one process and
separate windows (pulled up via Ctrl-N), the maxconnection seems irrelevant
for the application, and only 2 requests go out at a time. Perhaps IE is
acting according to the HTTP spec on a per process level.
 
Back
Top