0

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 3

1

You can try to reduce the number of processes/threads, by changing following values:

max_user_connections

max_connections

max_delayed_threads

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.

1
  • Unfotunately, there is no simple solution to limit the processes.
    – b13n1u
    Jan 21, 2014 at 12:08
0

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.

http://dev.mysql.com/doc/internals/en/threads.html

0

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.

You must log in to answer this question.