Hello,
I have a problem with the MySQL service. I’m looking at “Load Averages” and there is a process with mysql owner.
It is using CPU %100 over. I’m doing kill that. It coming again after 5 seconds. What is the problem?
I’m getting the error when I try to restart MySQL. You can see error message below.
Startup Log Apr 14 14:33:23 server.display-sales.de systemd[1]: Starting MariaDB 10.3.22 database server… Apr 14 14:33:23 server.display-sales.de mysqld[5598]: 2020-04-14 14:33:23 0 [Warning] option ‘table_open_cache’: unsigned value 1073741824 adjusted to 1048576 Apr 14 14:33:23 server.display-sales.de mysqld[5598]: 2020-04-14 14:33:23 0 [Warning] option ‘table_definition_cache’: unsigned value 1073741824 adjusted to 2097152 Apr 14 14:33:23 server.display-sales.de mysqld[5598]: 2020-04-14 14:33:23 0 [Note] /usr/sbin/mysqld (mysqld 10.3.22-MariaDB) starting as process 5598 … Apr 14 14:33:23 server.display-sales.de mysqld[5598]: 2020-04-14 14:33:23 0 [Warning] Could not increase number of max_open_files to more than 10000 (request: 2097337) Apr 14 14:33:23 server.display-sales.de mysqld[5598]: 2020-04-14 14:33:23 0 [Warning] Changed limits: max_open_files: 10000 max_connections: 150 (was 150) table_cache: 4910 (was 1048576) Apr 14 14:33:25 server.display-sales.de systemd[1]: Started MariaDB 10.3.22 database server.
Can you help?
Thanks Best regards, Koray ONELKE
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @wcshop,
The error
[Warning] Could not increase number of maxopenfiles to more than 10000 (request: 2097337)
means the limit is being hit somewhere. Let’s resolve that by editing any configured limits. The limits for the MySQL service are defined in the Systemd configuration file, which you should copy from its default location into /etc/systemd and then edit the copy.
sudo cp /lib/systemd/system/mysql.service /etc/systemd/system/ sudo vim /etc/systemd/system/mysql.service # or your editor of choice
Add the following lines to the bottom of the file:
LimitNOFILE=2500000 LimitMEMLOCK=2500000
Now reload the Systemd configuration with:
sudo systemctl daemon-reload
Restart MySQL and it should now obey the max_connections directive and your MySQL should start without a problem.
Regards, KDSys
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.