How can you limit the amount of processes that MySQL forks? I noticed at startup there are at least 10 children. This is a development database that isn't in production; so no users are connecting to it.
3 Answers
You can try to reduce the number of processes/threads, by changing following values:
For example in my.cnf:
max_connections = 1
max_user_connections = 1
max_delayed_threads = 1
But this does not guarantee that there will be less processes/threads, as not all processes/threads are connection related.
use max_user_connections to limit the number of connections that a single mysql user can have at one time
http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_max_user_connections
you'd need to try a few different settings / combinations of max_connections and max_user_connections to get the best performance without running out of connections.
also, its not a 1:1 ratio between connections and threads.
What @b13n1u said. If this doesn't help, any program can be limited by standard ulimit
limits, cf. this question as a related example.
To limit mysqld
processes in Linux, set e.g. "ulimit -u 5
" before starting mysqld
, maybe add this to the mysql init script.