[Mono-dev] mod_mono and xsp patches

Joshua Tauberer jit at occams.info
Mon Jan 21 13:45:54 EST 2008

Marek Habersack wrote:
> They're OK to go in, thanks!

Great, in that case, I'm attaching another patch for mod_mono that 
implements rate limiting. I had found that under relatively heavy load, 
mod-mono-server would deadlock. Incoming requests would hang forever, 
with the result that all of the Apache child processes would get tied up 
as more requests came in, and so all websites on the server would stop.

There are only so many worker threads in the XSP thread pool, and at a 
certain point they're going to get used up. I forget how many threads 
there are by default, maybe 128, but at a few workers per request, that 
number gets used up quickly. Obviously the right thing to do would be to 
make sure mod-mono-server doesn't hang when it runs out of worker 
threads (if this was even the problem), but barring a fix there, this 
did the job.

In my case, I was having problems when the number of concurrent requests 
went above 20 or 25. (I forget the details. I've been using this patch 
for around 3-4 months... modulo changes I made today.)

The patch by default limits the number of concurrent requests passed to 
mod-mono-server to 20. After that, it holds onto (by default) up to 20 
more, checking periodically until the initial 20 decreases or a timeout 
(hard-coded at 10 seconds). The two 20's are configurable with 
MonoMaxActiveRequests and MonoMaxWaitingRequests.

This will only work on Apache2 since it relies on the shared memory 

- Josh Tauberer


"Yields falsehood when preceded by its quotation!  Yields
falsehood when preceded by its quotation!" Achilles to
Tortoise (in "Gödel, Escher, Bach" by Douglas Hofstadter)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mod_mono.diff
Type: text/x-patch
Size: 9105 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20080121/816baeec/attachment.bin 

More information about the Mono-devel-list mailing list