Linuxulimit and dynamic modification of MySQL maximum number of threads

Source: Internet
Author: User
Linuxulimit and dynamic modification of the maximum number of MySQL threads limit ulimit is to restrict the use of resources by processes. According to Moore's law, high-end hardware is almost the same as the cabbage price, but the software resource limit does not change much, especially processfile, corresponding to nproc and nofilenproc, available ulimit Linux ulimit and dynamic modification of MySQL maximum number of threads limit ulimit is to restrict the use of resources by processes, according to Moore's Law, high-end hardware is almost the same as the cabbage price, but the software resource limit does not change much, especially the process/file, which correspond to nproc and nofilenproc available ulimit-u queries respectively. nofile available ulimit-n queries here mention a little, introduce/etc/security/limits after kernel 2.6.32. d/90-nproc.conf, which means/etc/security/limits. the file configuration in d/overwrites/etc/security/limits. conf configuration Configuration files with the maximum number of hardware and software restrictions are located at:/etc/security/limits. conf provides an example, for example, modifying fd (file handle) limits * soft nofile NNNNN * hard nofile NNNNN to confirm the modification: ulimit-Hn; A friend of ulimit-Sn encountered the following problem in the production environment: [plain] Masters. for help, is there a way to restart the database, modify the maximum nproc parameter of a mysql User! Error message: Can't create a new thread (errno 11); of course, at the beginning of the project, the system's ulimit, program connections, and so on will certainly be modified; but this is in case of emergency: currently, the solution is as follows: 1. disable an ip connection in iptables. 2. disable tcpkill to kill useless tcp connections. after connecting to mysql, modify the max_connection <nproc parameter; is it possible to modify the maximum nproc of mysql users without restarting the database! In addition to setting the MySQL parameter max_connections, you also need to consider setting/etc/security/limits. the size of the conf file MySQL is executed in thread mode, and the number of threads is also counted in nproc. This may mask or cause a false positive judgment: from Linux 2.6.32, you can use echo-n "Max processes = 204800: 204800">/proc/'pidof mysqld '/limits to dynamically modify the limits information of system resources of a process, you do not need to restart the instance because of this modification to solve the problem of the maximum number of MySQL processes, which is very simple and convenient.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.