[Madlug] How close am I to an OOM?

Jess Balint jbalint at gmail.com
Wed Oct 10 15:45:55 CDT 2007


On Wed, Oct 10, 2007 at 03:19:45PM -0500, John Heim wrote:
...
> PS: If I do 'ps -eLF' I see 40+ mysql processes running. How does mysql 
> determine how many sub-processes to spawn? Can I configure that? If so, how 
> will I know what to set it to?

Actually these are threads, not full processes. In general there is one
thread per connection. Assuming now that you have either 40 concurrent
requests / 40 connections in a pool / 40 apache children using pconnect,
you either reconfigure the connection pool (if you have one), lower the
number of Apache children, or get rid of the use of pconnect. If the
connections may be leaked, you can change wait_timeout in MySQL to have
them die quicker (default is something like 8 hrs).

In MySQL, you can use "show processlist" to see exactly what queries are
running. If you are running a larger site, 40 connections may be ok, and
usually each thread in the MySQL server is not consuming too much memory
by itself.

Hope this helps,
Jess


More information about the Madlug mailing list