[Mono-list] Mod-mono-server using too much CPU, running too many times

Gonzalo Paniagua Javier gonzalo.reply.to.the.list.iam.subscribed@ximian.com
Fri, 01 Oct 2004 05:41:53 +0200


On Thu, 2004-09-30 at 22:44, Joshua Tauberer wrote:
> Putting aside the shameless plugs for later, I have two questions about 
> mod_mono:
> 
> 1)  Mod-mono-server is consistently using about 10% CPU at times that I 
> know there are no pages being served.  Does anyone have any thoughts 
> about the source of this (so I don't have to dive blindly into figuring 
> it out)?
> 
> Is this something that I could expect from having a lot of files in the 
> System.Web.Caching cache -- with the managed file system watcher or FAM?

That's likely to happen if you use the managed file system watcher, not
with FAM, for large directories (many files), but not for directories
that have, say, 1 hundred files (unless the computer is too slow). The
refresh interval is set to 750ms in the managed watcher. Can you check
whether you're using FAM or Default file watchers? (adding a Console in
FileSystemWatcher where the choice is taken).


> 
> (It's Fedora Core 1, FAM 2.6.8, and Mono's 1.0.1 release.)
> 
> 2)  How does mod_mono work in relation to Apache's prefork module?  My 
> small understanding of prefork is httpd spawns a few child httpds to do 
> the dirty work.  I'm seeing a few mono proceeses starting up, and I 
> don't know whether this is because each httpd child is starting its own 
> mod_mono_server, or for some other reason.  (e.g. if mod-mono-server is 
> too busy to pick up a connection, will mod_mono spawn a new 
> mod_mono_server?)

That used to happen if you get a few requests when mod_mono has not
started mod-mono-server for the first time. After the burst only one of
those mono instances is really used. I'll file a bug report about this
and fix it.

> 
> Is each child httpd supposed to start its own mod_mono_server?  Is 
> mod-mono-server able to process multiple requests concurrently?  Is the 
> unix socket to mod-mono-server able to support connections from multiple 
> httpd children?

No, if it wasn't because of the mentioned bug, one mod-mono-server
handles all the incoming connections from the children.

-Gonzalo