[Catalyst] so many 'sleep' process in mysql.

Tomas Doran bobtfish at bobtfish.net
Sun Apr 26 11:32:48 GMT 2009


On 25 Apr 2009, at 05:20, Malloy wrote:

> I use 'Catalyst::Model::DBIC::Schema'.
>
> But i find so many 'sleep' process in mysql.
>
> Is it normal? If not, why and how to avoid it?

At a guess, you're running mod_perl, and you have loads of idle  
apache processes.

You'll gain one persistent db connection per back end web server  
process which talks to the database.

Don't sweat about it, connections are really really cheap in mysql,  
just make sure your connection limit is in mysql is consistent with  
your process limit in apache.

You also may want to think about a (small) pool of dynamic worker  
process behind a proxy/other web server serving static content, or an  
alternate deployment strategy such as FastCGI. It's fairly easy to  
kill your web server if you allow several hundred mod_perl requests  
in-flight at once - using memory-heavy mod_perl processes to stream  
bytes to the user (slowly), is pretty inefficient use of resources.

Cheers
t0m




More information about the Catalyst mailing list