MariaDB, MySQL max_connections 값 변경



 

MariaDB, MySQL max_connections 값 변경

 

max_connections 값이 작으면 그냥 변경해도 변경이 됩니다. 그러나 1000 이상의 값을 가지게 되면 에러가 떨어지면서 적용하려면 OS 커널 파라미터의 튜닝이 필요합니다.

# vi /etc/my.cnf.d/server.cnf

open_files_limit = 4096
max_connections = 2000

# vi /usr/lib/systemd/system/mariadb.service.d/limit_nofile.conf

[Service]
LimitNOFILE=4096

# systemctl daemon-reload
# systemctl restart mariadb

# vi /etc/sysctl.conf

fs.file-max = 65536

# sysctl -p

# vi /etc/security/limits.conf

*        soft        nproc        40960
*        hard        nproc        40960
*        soft        nofile       40960
*        hard        nofile       40960

# vi /etc/security/limits.d/90-nproc.conf

*        soft        nproc        40960
*        hard        nproc        40960
*        soft        nofile       40960
*        hard        nofile       40960

# systemctl restart mariadb



You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *