Ask Your Question

mariadb max_open_files

asked 2016-04-26 01:26:41 -0500

jeff gravatar image

any experts in mysql here with centos?

for the life of me i cannot increase the number of max open files for mariadb/mqsql past 1024. i am running centos 7.1 liberty release of openstack deployed via packstack/rdo.

during boot, mariadb complains: 160426 5:43:58 [Warning] Could not increase number of max_open_files to more than 1024 (request: 10811)

as the number of db connections increases past 1024 in my openstack cloud i get this in log files and openstack services start failing...

[ERROR] Error in accept: Too many open files

in /etc/my.conf:


open_files_limit = 10000

max_connections = 10000


open_files_limit = 10000

max_connections = 10000

in /etc/security/limits.conf (that's an asterisk not a bullet point)

  • hard nofile 65536

  • soft nofile 16384

  • soft nproc 10240

  • hard nproc 10240

in /etc/systemd/system/mariadb.service.d/limits.conf


LimitNOFILE=30000 LimitNPROC=65535 max_connections=10000 open_files_limit=10000 LimitMEMLOCK=infinity

in /usr/lib/systemd/system/mariadb.service







su mysql --shell /bin/bash --command "ulimit -n"


any ideas appreciated to increase num of open file.


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2016-05-02 10:05:52 -0500

this limit should be related to selinux policy, as a customer we've opened a bug to rh: (

but as work around you could use a custom selinux module -> have a look to comment 6 to create a new one.

edit flag offensive delete link more


thanks for the reply ...that was it :)

jeff gravatar imagejeff ( 2016-05-02 18:15:00 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2016-04-26 01:26:41 -0500

Seen: 1,748 times

Last updated: Apr 26 '16