Get the App
SLTechnology News&Howtos  ›  Database  › 

Linux dynamically modifies max user processes limits

Shulou Source: shulou.com Published: 2022-06-01 05:36:56 09月27日 Update

The limits parameter of the mysql process can be used as follows:

echo -n 'Max processes=SOFT_LIMITS:HARD_LIMITS' > /proc/`pidof mysqld`/limits

The above command allows you to dynamically adjust the existing mysqld processes limit.

For example, in this lab environment, the operating system information is as follows:

~]# uname -r

2.6.32-131.0.15.el6.x86_64

~]# echo -n "Max processes=10240:10240" > /proc/12946/limits

It is found that the limit parameter corresponding to the mysql process has been dynamically changed to 10240. At this time, multiple connections to mysql are simulated again:

At this point, the exception thrown is too many connections and no longer:? Can't create a new thread (errno 11)

To sum up, the max process limit of the database server needs to be adjusted, at least to ensure that the max connections of the database are smaller than it. If the already running mysql encounters this problem and it is really necessary to increase the max connections, you can dynamically adjust the limits parameter of the running mysql by echo -n 'Max processes=SOFT_LIMITS:HARD_LIMITS' > /proc/`pidof mysqld`/limits, so as to avoid restarting the database operation.

See www.percona.com/blog/2013/02/04/cant_create_thread_errno_11/

Tags: Dynamic parameters data database adjustment mode process run operating system information again can be passed commands multiple such as above actual server ongoing environment system Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Huawei Shulou Technology Redmi Docker