ERPNext Foundation ERPNext Cloud Chat Blog Discuss Frappé* Donate

MariaDB status gives max_open_files warning, how to solve?

mariadb

#1

Hi,

I am new, really like ERPNext just the first time I test it. Now, little more curious with it… I get this error every start of mariadb.

I have 2 fresh new sites working with nginx (on different ports), in Ubuntu 16.04, installed with the playbook script from github main repo.

Is it normal? shout it be fixed? because ERPNext works anyway…

Here the warning:

Feb 12 22:10:57 erpnext-src systemd[1]: Starting MariaDB 10.2.12 database server...
Feb 12 22:11:03 erpnext-src mysqld[1747]: 2018-02-12 22:11:03 139827642783936 [Note] /usr/sbin/mysqld (mysqld 10.2.12-MariaDB-10.2.12+maria~xenial-log) starting as process 1747 ...
Feb 12 22:11:03 erpnext-src mysqld[1747]: 2018-02-12 22:11:03 139827642783936 [Warning] Could not increase number of max_open_files to more than 16364 (request: 20991)

Thanks,

S.


#2

Take a look at /etc/security/limits.conf and see what the values are for default hard and soft at the bottom. Also look to see what there is in /etc/security/limits.d/.


#3

Thanks James for the quick response! I have already tried to add there the parameters but seems not to take effect in anyway.

Here I follow some steps from this simple guide, that semmed correct https://www.fromdual.com/node/1278

With cat /proc/pidof mysqld/limits | egrep 'Limit|open files' I get the current values, and are always fixed to 16364, even if I try to set them to 50000.

The dir /etc/security/limits.d its empty (my Ubuntu 16.04 server is fresh newly installed)

And the file /etc/security/limits.conf its by default with everyline commented, so here I added this (just to test) but seems it has no effect. Tried several alternatives :sweat:

mysql soft nofile 50000
mariadb soft nofile 50000
frappe soft nofile 50000
frappe hard nofile 50000
mysqld soft nofile 50000
mysqld hard nofile 50000

I might need to look for help in a Ubuntuer forum, I know, but… is it normal the warning message? do you have it also?

I am sure I did not change any special config, just clean installed Ubuntu and playbook script.


#4

Turns out that mysql may not “listen” to the limits.conf

I added open_files_limit to my settings.cnf and the error went away on my box.


#5

Thanks for you reply James! I had tried that, followed the steps, added the line in settings.cnf (there is only one settings.cnf fortunatelly) but after sudo service mysql restart and sudo service mariadb restart (just in case) the WARN reports the same, so could not fix it.

Can you please, tell me how did you install ERPNext? with playbook script? or manually downloading the git repo and installing requeriments manually too? (i might try your way)


#6

OK, found it! maybe your Ubuntu version is 14 so its diferent kind of setup. I have Ubuntu 16.04 LTS and could be solved by modifing the parameter in: /etc/systemd/system/mysqld.service, its a symlink to: /lib/systemd/system/mariadb.service

# Number of files limit. previously [mysqld_safe] open-file-limit
#LimitNOFILE=16364
LimitNOFILE=40000

So here I replace to 40000 and no more warnings stating mariadb/mysql. Havent modified any other file, just this one and solved!

Hope it helps :grin:


Field to restart Failed to start MariaDB 10.2.17 database server