concurrent connections

Discussion in 'ASP .Net' started by =?Utf-8?B?c3RlcGhlbg==?=, Apr 24, 2004.

  1. Hello, I am using ASP.NET as a streaming engine for mp3 and ogg files over HTTP. Basically, the asp.net page sets it's mime content type to audio/mp3 and i write out the file to the stream. We will be having anywhere from 50 to 300 users streaming at once (as well as standard asp.net web pages served). We will be using IIS6, and was wondering if we needed to increase the number of worker threads in machine.config to handle this, or if it is ready to go as is? Or will creating a web garden help? Or any thoughts in general how IIS6 will react to this
    Thanks
    -Stephen
    =?Utf-8?B?c3RlcGhlbg==?=, Apr 24, 2004
    #1
    1. Advertising

  2. =?Utf-8?B?c3RlcGhlbg==?=

    Scott Allen Guest

    Chances are you'll be using all the threads in the thread pool but
    have very little CPU activity. You could increase the number of
    threads in the thread pool by modifying machine.config, but this would
    be one of those situations where you might benefit from managing your
    own threads and implementing an asynchronous HTTP handler
    (IHttpAsyncHandler). Fritz Onion has written a very good article
    explaining how to do this in detail:
    http://msdn.microsoft.com/msdnmag/issues/03/06/Threading/default.aspx

    HTH,

    --
    Scott
    http://www.OdeToCode.com

    On Sat, 24 Apr 2004 13:16:03 -0700, "stephen"
    <> wrote:

    >Hello, I am using ASP.NET as a streaming engine for mp3 and ogg files over HTTP. Basically, the asp.net page sets it's mime content type to audio/mp3 and i write out the file to the stream. We will be having anywhere from 50 to 300 users streaming at once (as well as standard asp.net web pages served). We will be using IIS6, and was wondering if we needed to increase the number of worker threads in machine.config to handle this, or if it is ready to go as is? Or will creating a web garden help? Or any thoughts in general how IIS6 will react to this?
    >Thanks.
    >-Stephen
    Scott Allen, Apr 25, 2004
    #2
    1. Advertising

  3. Hi Stephen,

    As for maxWorkderThreads setting in the <processModel>, it is per CPU
    based, that means if the "maxWorkerThreads" setting is 25, then if the
    machine is single cpu based, then 25 is the limitation for the ASP.NET
    runtime to accept the comming requests concurrently. If 2 cpus, that'll be
    50. Here is the <processModel> setting's description in MSDN:

    #<processModel> Element
    http://msdn.microsoft.com/library/en-us/cpgenref/html/gngrfProcessmodelSecti
    on.asp?frame=true

    Also, the <processModel> setting is somewhat specified to IIS5 and on a
    IIS6 based machine(Win2k3), there is another asp.net process isolation
    setting called Application Pool setting. So we have multi-choice if using
    IIS6, here are the referenceon IIS6's application isolation mode:

    #IIS 6.0 Application Isolation Modes
    http://msdn.microsoft.com/library/en-us/cpguide/html/cpconiis60applicationis
    olationmodes.asp?frame=true

    Hope also helps. Thanks.

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    Get Preview at ASP.NET whidbey
    http://msdn.microsoft.com/asp.net/whidbey/default.aspx
    Steven Cheng[MSFT], Apr 27, 2004
    #3
  4. Thank you for the response. I think I have a grasp on the number of worker threads set by default. What do you think of my original inquiry though, regarding using ASP.NET as a streaming engine for large amounts of users. Could I keep 300 conccurent connections open for minutes at a time while also handling regular short page requests with serious performance problems? If so, what changes would I need to make to my ASP.NET or IIS 6 configuration?

    Thanks again
    --Stephe


    ----- Steven Cheng[MSFT] wrote: ----

    Hi Stephen

    As for maxWorkderThreads setting in the <processModel>, it is per CPU
    based, that means if the "maxWorkerThreads" setting is 25, then if the
    machine is single cpu based, then 25 is the limitation for the ASP.NET
    runtime to accept the comming requests concurrently. If 2 cpus, that'll be
    50. Here is the <processModel> setting's description in MSDN

    #<processModel> Elemen
    http://msdn.microsoft.com/library/en-us/cpgenref/html/gngrfProcessmodelSect
    on.asp?frame=tru

    Also, the <processModel> setting is somewhat specified to IIS5 and on a
    IIS6 based machine(Win2k3), there is another asp.net process isolation
    setting called Application Pool setting. So we have multi-choice if using
    IIS6, here are the referenceon IIS6's application isolation mode

    #IIS 6.0 Application Isolation Mode
    http://msdn.microsoft.com/library/en-us/cpguide/html/cpconiis60applicationi
    olationmodes.asp?frame=tru

    Hope also helps. Thanks

    Regards

    Steven Chen
    Microsoft Online Suppor

    Get Secure! www.microsoft.com/securit
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.

    Get Preview at ASP.NET whidbe
    http://msdn.microsoft.com/asp.net/whidbey/default.asp
    =?Utf-8?B?c3RlcGhlbg==?=, Apr 27, 2004
    #4
  5. =?Utf-8?B?c3RlcGhlbg==?=

    Scott Allen Guest

    It depends on the hardware also, because the maxWorkerThreads setting
    in machine.config specifies threads per cpu. I believe you'd be better
    off increasing the thread pool instead of going the web garden route,
    but this is one of those situations where you really need to do some
    load testing to tweak your application for your environment.

    Also, once the threads are maxed, ASP.NET will not deny requests, it
    will start to queue them. The requestQueueLimit is also in
    machine.config. Once the queue is full, then ASP.NET will deny
    requests with a 503 status.

    HTH,

    On Mon, 26 Apr 2004 12:56:04 -0700, "stephen"
    <> wrote:

    >Thanks Scott.
    >So, if by default asp.net is set to 20 maxWorkerThreads does that mean that if I am streaming 20 mp3 files over HTTP, then if I had user number 21 request a stream while the others are streaming, ASP.NET would deny the request?
    >If so, should I just go ahead and increase the number of maxThreads to the max number of possible concurrent users I want, or should I put the application in a webgarden and increase the number of worker processes?
    >
    >Thanks.
    >
    >
    >
    >
    > ----- Scott Allen wrote: -----
    >
    > Chances are you'll be using all the threads in the thread pool but
    > have very little CPU activity. You could increase the number of
    > threads in the thread pool by modifying machine.config, but this would
    > be one of those situations where you might benefit from managing your
    > own threads and implementing an asynchronous HTTP handler
    > (IHttpAsyncHandler). Fritz Onion has written a very good article
    > explaining how to do this in detail:
    > http://msdn.microsoft.com/msdnmag/issues/03/06/Threading/default.aspx
    >
    > HTH,
    >
    > --
    > Scott
    > http://www.OdeToCode.com
    >
    > On Sat, 24 Apr 2004 13:16:03 -0700, "stephen"
    > <> wrote:
    >
    > >Hello, I am using ASP.NET as a streaming engine for mp3 and ogg files over HTTP. Basically, the asp.net page sets it's mime content type to audio/mp3 and i write out the file to the stream. We will be having anywhere from 50 to 300 users streaming at once (as well as standard asp.net web pages served). We will be using IIS6, and was wondering if we needed to increase the number of worker threads in machine.config to handle this, or if it is ready to go as is? Or will creating a web garden help? Or any thoughts in general how IIS6 will react to this?
    > >Thanks.
    > >-Stephen

    >
    >


    --
    Scott
    http://www.OdeToCode.com
    Scott Allen, Apr 27, 2004
    #5
  6. Really, I would think this scenario is quite common, as it is very similar to a large download site that pumps out the download files through script. No matter what middleware they are using, the must allow for a very large amount of concurrent connections. In my instance, I am pumping out the 3-10MB files through ASP.NET, and the client is doing all the buffering itself to stream the file. Lets say I'm running on a dual-zeon with 3GB of RAM. To handle 300 conccurrent connections would it simply work to increase my maxWorkThreads and maxIOThreads in machine.config to 300 (150 per proc)?
    =?Utf-8?B?c3RlcGhlbg==?=, Apr 27, 2004
    #6
  7. I've read everything that has been recommended and I spent a majority of the date using the stress test tool that comes with VS.net 2003. In one page i tested, i had a thread.sleep in there for anywhere from 2-60 seconds to simulate an open connection where it would be streaming a file to the client. Then i actually tried running it against my code that writes the media file to the response stream. The later got very good performance results (running locally). I have concerns about this asp.net counter "\\ALIEN-1\ASP.NET Applications\Pipeline Instance Count\__Total__" because it shows up after the test is run as 10. Which would mean only 10 concurrent connections from what I read, which is bad bad bad, since I need to keep hundreds of connections open as they stream files to users. (I also tried changing my maxWorkerThreads from 20 to 100,300,500 to test performance. The results where flaky, so I haven't detailed it much here

    Should I be concerned about that counter I mentioned, and will that indicate I will not be able to keep hundreds of connections open? I'm feeling a little frustrated that I can't figure this out, but I'm just not able to know for sure with my tests. I really just need to know how I can make sure my configuration is correct to handle all these connections being open for minutes at a time as they stream. Thanks for the help
    -Stephen
    =?Utf-8?B?c3RlcGhlbg==?=, Apr 28, 2004
    #7
  8. Hi Stephen,

    As for the best practice on this issue, I'm currently consulting some
    further experts and I'll update you as soon as I've got any new infos.
    Thanks.

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    Get Preview at ASP.NET whidbey
    http://msdn.microsoft.com/asp.net/whidbey/default.aspx
    Steven Cheng[MSFT], Apr 29, 2004
    #8
  9. Thank you very much Steven. I appreciate your help as this will go into production this summer and my testing as not proved to me the best way.

    -Stephen
    =?Utf-8?B?c3RlcGhlbg==?=, Apr 29, 2004
    #9
  10. Hi Stephen,

    Sorry for keeping you wait for so long time. I've just got some suggestions
    from some other solutoin integrated engineers. Here are their original
    messsage:

    =======================================================================

    I would have him run ACT on two remote machines to stress his web
    application. Running it locally could impact the number of actual requests
    per second. Also increasing the maxWorkerThreads count will introduce more
    context switching which could have a negative impact on performance. Have
    him run the same test with 20, 25, 50, 75 threads and see which number
    gives him the best performance. For an idea of how many IIS connections he
    is seeing have him check the Web Service object¡¯s Current Connections
    counter. Also monitor the aspnet requests queued, request execution time,
    and requests rejected. Other good counters would be the w3wp.exe processor
    time, private bytes and virtual bytes.

    ========================================================================

    Hope helps. Good Luck!

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    Get Preview at ASP.NET whidbey
    http://msdn.microsoft.com/asp.net/whidbey/default.aspx
    Steven Cheng[MSFT], May 3, 2004
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joe
    Replies:
    0
    Views:
    2,318
  2. Pep
    Replies:
    6
    Views:
    819
  3. Jp Calderone
    Replies:
    0
    Views:
    928
    Jp Calderone
    Jun 28, 2005
  4. Jay Douglas
    Replies:
    1
    Views:
    443
    Alvin Bruney [MVP]
    Apr 27, 2007
  5. Frank H.

    Concurrent webservice connections to remote machine

    Frank H., Apr 26, 2009, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    730
    Frank H.
    Apr 26, 2009
Loading...

Share This Page