Search code examples
multithreadingapachemonorequestmod-mono

mod-mono: how to set MonoMaxActiveRequests on specific application to get past the 20 threads limit


I'm using mod-mono 2.6.7 (upgrading is not an option) with Apache 2.2.24 and the max amount of parallel request seems to be stucked at 20. I don't know yet whether the limit comes from Apache or mod-mono. It seems that there's a default (or manually set) max 20 request somewhere.

After reading from http://www.mono-project.com/docs/web/mod_mono/#limiting-the-number-of-concurrent-requests I tried to set:

MonoMaxActiveRequests 100 
MonoMaxWaitingRequests 100 
MonoSetEnv MONO_THREADS_PER_CPU=100
MaxSpareServers   [some other value larger than 20]

I'm editing some "previously-non-exising" default config instead of my site's config. Instead, I would like to edit my site's config which wrongly shows "unlimited" (it is in fact 20).

When I look at the mono control panel, I see this:

mod-mono console

The "100" displayed seems to reflect "MonoMaxActiveRequests 100" but I also see "unlimited" (which I could never change). Regardless of the "unlimited" or "100", the limit is always 20. All other requests will go to mono's queue.

When I look at apache's httpd\error_log, I see this:

[Mon Jan 12 14:57:37 2015] [error] Maximum number (20) of concurrent mod_mono requests to /tmp/mod_mono_dashboard_[NameOfMySite]_4.lock reached. Dropping request.

Of course, everytime I edit my config I restart apache.


Solution

  • I found the answer: I had to set

    MonoMaxActiveRequests [name_of_my_app] 100
    MonoMaxWaitingRequests [name_of_my_app] 100
    

    instead of

    MonoMaxActiveRequests 100
    MonoMaxWaitingRequests 100