Professional Web Applications Themes

Synchronous web request performance - ASP.NET General

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 ...

  1. #1

    Default Synchronous web request performance

    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?

    TomR Guest

  2. #2

    Default Re: Synchronous web request performance

    Matt Powell wrote a great article on the topic on MSDN. Here's the URL:

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnservice/html/service07222003.asp

    --
    James J. Foster, DotNetCoders
    http://www.dotnetcoders.com

    "TomR" <com> wrote in message
    news:0ded01c361a1$f27971a0$gbl... 


    James Guest

  3. #3

    Default Re: Synchronous web request performance

    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


    "James J. Foster" <com> wrote in message
    news:phx.gbl... 
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnservice/html/service07222003.asp 
    >
    >[/ref]


    James Guest

  4. #4

    Default Re: Synchronous web request performance

    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
     [/ref]
    written 
    >enlightening for PHP and 
    >message [/ref][/ref]
    MSDN. 
    >>http://msdn.microsoft.com/library/default.asp?[/ref]
    >url=/library/en-us/dnservice/html/service07222003.asp [/ref]
    >calls [/ref]
    >setup: We [/ref][/ref]
    15 [/ref][/ref]
    you [/ref]
    >page, [/ref][/ref]
    and [/ref]
    >complete [/ref]
    >accessing [/ref]
    >first [/ref][/ref]
    seconds. [/ref]
    >the [/ref][/ref]
    clients, [/ref][/ref]
    might [/ref][/ref]
    simultaneously. [/ref]
    >behavior? 
    >>
    >>
    >>.
    >>[/ref]
    >.
    >[/ref]
    TomR Guest

  5. #5

    Default Re: Synchronous web request performance

    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

    "TomR" <com> wrote in message
    news:0ded01c361a1$f27971a0$gbl... 


    James Guest

  6. #6

    Default Re: Synchronous web request performance

    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.

    --
    James J. Foster, DotNetCoders
    http://www.dotnetcoders.com


    "TomR" <com> wrote in message
    news:0ded01c361a1$f27971a0$gbl... 


    James Guest

  7. #7

    Default Synchronous web request performance

    We are having problems with synchronus web request calls
    blocking our ASP.NET performance. Here is the setup:
    We have an aspx script on Site B with a synchronous
    HttpWebRequest call to access Site A (simulating accessing
    a bank credit card payment gateway). The page on Site A
    currently does nothing more than wait 15 seconds before
    serving a page, again simulating the potential lengthy
    response from such a site.

    When we open four browsers on the aspx page on Site B
    "simultaneously" (which in turn causes the lengthy wait
    accessing Site A), 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
    eequests 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 tried several different things including asynchronous
    web requests and it seemed to make no difference. Only two
    requests ever got processed at one time.

    We are anticipating having to process perhaps 50 of these
    transactions simultaneously, and if only two are being
    processed at any given moment response time would be
    horrible. I'm sure we aren't the only ones trying to do
    such a thing. What might we doing wrong to cause this
    behavior?

    Thanks,
    TomR.

    11648409

    TomR Guest

  8. #8

    Default Re: Synchronous web request performance

    Right, and that is why we brought up four browsers on
    four different machines the second time. Yet, we still
    saw only two requests being serviced at any one time.

    TomR
     
    connections to a [/ref]
    accessing [/ref]
    as [/ref]
    transactions [/ref]
    two [/ref]
    these 
    >
    >
    >.
    >[/ref]
    TomR Guest

  9. #9

    Default Re: Synchronous web request performance

    Hello

    Try to check in machine.config
    <httpRuntime> check the value for the minFreeThreads and
    minFreeLocalRequestFreeThreads attributes
    <processModel> maxWorkerThreads attribute

    Best Regards

    "TomR" <com> wrote in message
    news:0e3701c36d84$9db4ac40$gbl... 


    Sherif Guest

Similar Threads

  1. Synchronous Flex Calls
    By garag in forum Macromedia Flex General Discussion
    Replies: 0
    Last Post: April 22nd, 04:15 PM
  2. Request for Comments - Finance::Calc::Performance
    By Matthew Persico in forum PERL Modules
    Replies: 0
    Last Post: April 12th, 02:28 AM
  3. Replies: 0
    Last Post: October 18th, 05:40 AM
  4. Replies: 1
    Last Post: October 17th, 09:00 PM
  5. Replies: 0
    Last Post: October 1st, 09:31 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139