Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report for Bug 16983 on
GitHub or Developer Community if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
(I'm using product Tools->Other because I don't find one for http://github.com/mono/xsp)
There's a threadpool exhaustion scenario which a user is very likely to hit if he hosts his webservice/webapp with XSP/mono-fastcgi/etc. This happens specially when for a certain type of webrequest, the implementation of its response requires contacting other webservices or using async features (i.e. launching parallel webrequests). In this case, the use of the threadpool by the user's app can affect the use of the threadpool that xsp/monofastcgi/etc use for serving requests, degrading the scalability factor of the overall service.
Furthermore, threadpool usage is only recommended for "short tasks" (just google for the three words 'short' 'tasks' 'threadpool' and you will find a lot of documentation about this, even from MSDN), so xsp/mono-fastcgi/etc usage of the threadpool is wrong to begin with, because from their point of view they cannot know if the task to be done is short.
This could be solved if the threadpool had API to distinguish between different priorities (then we could assign "high" priority for xsp/monofastcgi/etc's usage of the threadpool, and hopefully the other normal "low" default priority usage of the threadpool would never exhaust the set of "high priority" threads reserved by the threadpool), but it doesn't. So what I propose is that xsp/monofastcgi/etc should use its own threadpool instead.
The SmartThreadPool library could be used (http://smartthreadpool.codeplex.com/ , MS-PL licence) in order to not complicate things too much. Some example of its usage is here: http://www.codeproject.com/Articles/7933/Smart-Thread-Pool