Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL warnings about max_open_files and table_open_cache

I have a MySQL 5.7 server on Ubuntu 18. When the server starts it writes the following warnings in the error.log:

[Warning] Changed limits: max_open_files: 5000 (requested 7500)
[Warning] Changed limits: table_open_cache: 1745 (requested 2000)

Can somebody explain what is causing these warnings (and what I can do to make them go away)?

like image 702
Gert-Jan Avatar asked Oct 26 '25 06:10

Gert-Jan


1 Answers

Answering my own question. The limit for max open files is defined in the systemd script /lib/systemd/system/mysql.service:

# MySQL systemd service file

[Unit]
Description=MySQL Community Server
After=network.target
....

LimitNOFILE=5000

Increasing the value of LimitNOFILE to 7500 solved both warnings.

like image 186
Gert-Jan Avatar answered Oct 28 '25 21:10

Gert-Jan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!