concurrent connections

G

Guest

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
 
S

Scott Allen

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,
 
S

Steven Cheng[MSFT]

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
 
G

Guest

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
 
S

Scott Allen

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,
 
G

Guest

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)?
 
G

Guest

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
 
G

Guest

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
 
S

Steven Cheng[MSFT]

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top