nugawiki

./categories/os

MySQL Too many open files

업데이트 2026-07-21 조회수

확인

ulimit -a
# open files (-n) 확인

OS 일시 변경

ulimit -n 4096

OS 영구 (/etc/security/limits.conf)

* hard nofile 4096
* soft nofile 4096
root hard nofile 4096
root soft nofile 4096

MySQL/MariaDB (my.cnf)

[mysqld]
open-files-limit = 4096
systemctl restart mariadb
SHOW VARIABLES LIKE 'open_files_limit';

CentOS 7 systemd (값이 안 오를 때)

유닛 오버라이드 또는 /etc/systemd/system/mariadb.service.d/override.conf:

[Service]
LimitNOFILE=10000
systemctl daemon-reload
systemctl restart mariadb

./comments