views:

43

answers:

1

My ASP.NET application is a download application (no pages) which reads huge binary files (1-2 GB -> over 1 hours download time with resume support) from local network and stream them to web clients (each request -> one large binary response, so there's no text/html response at all). I use a HTTP Handler (.ashx) instead of a (.aspx) page for processing requests. Using a shared buffer and producer-consumer pattern main thread (from ASP.NET thread pool) creates another thread and together they accomplish the job. At the end both threads exit (get back to pool).

So I have long-running request using threads from thread pool which is not recommended generally but I don't have any page in my application, is it still a bottleneck using threads from ASP.NET thread pool ?

Environment: server 2008 64bit, IIS 7.0 and .NET 4.0

What considerations should be taken for this scenario ? Any comment is appreciated.

A: 

If you are using threads from the ASP.NET pool to serve these files, you will quickly hit a hard limit of concurrent downloads, regardless of bandwidth available. It doesn't matter what the threads are doing; if they are all busy/blocked, other requests will not be able to be fulfilled.

With such a long period of time, it's also possible you could have other trouble without careful configuration; downloads could end up getting canceled, and the application could needlessly get reset.

What is the reason for serving these files via ASHX handlers?

Andrew Barber
I get time-out on stress testing after 200 concurrent clients but it is solved by increasing worker processes at default thread (since I don't use session state I can use this feature of IIS 7)
Xaqron