[memcached] Too many open files
memcached의 설정 파일인 /etc/sysconfig/memcached에서 MAXCONN의 기본값은 아래와 같다.
MAXCONN="1024"
이 값을 너무 낮추면 아래처럼 오류가 뜰 수 있다.
# systemctl status memcached
× memcached.service - memcached daemon
Loaded: loaded (/usr/lib/systemd/system/memcached.service; enabled; preset: disabled)
Active: failed (Result: exit-code) since Sat 2024-07-27 09:08:49 KST; 3s ago
Duration: 32ms
Process: 39005 ExecStart=/usr/bin/memcached -p ${PORT} -u ${USER} -m ${CACHESIZE} -c ${MAXCONN} $OPTIONS (code=exited, status=1/FAILURE)
Main PID: 39005 (code=exited, status=1/FAILURE)
CPU: 15ms
Jul 27 09:08:49 server_name systemd[1]: Started memcached daemon.
Jul 27 09:08:49 server_name memcached[39005]: [warn] evutil_make_internal_pipe_: pipe: Too many open files
Jul 27 09:08:49 server_name memcached[39005]: [err] evsig_init_: socketpair: Too many open files
Jul 27 09:08:49 server_name systemd[1]: memcached.service: Main process exited, code=exited, status=1/FAILURE
Jul 27 09:08:49 server_name systemd[1]: memcached.service: Failed with result 'exit-code'.
# systemctl status memcached
× memcached.service - memcached daemon
Loaded: loaded (/usr/lib/systemd/system/memcached.service; enabled; preset: disabled)
Active: failed (Result: exit-code) since Sat 2024-07-27 09:09:33 KST; 1s ago
Duration: 17ms
Process: 39032 ExecStart=/usr/bin/memcached -p ${PORT} -u ${USER} -m ${CACHESIZE} -c ${MAXCONN} $OPTIONS (code=exited, status=71)
Main PID: 39032 (code=exited, status=71)
CPU: 16ms
Jul 27 09:09:33 server_name systemd[1]: Started memcached daemon.
Jul 27 09:09:33 server_name memcached[39032]: socket(): Too many open files
Jul 27 09:09:33 server_name memcached[39032]: failed to listen on UNIX socket: /.../memcached.sock: Too many open files
Jul 27 09:09:33 server_name systemd[1]: memcached.service: Main process exited, code=exited, status=71/OSERR
Jul 27 09:09:33 server_name systemd[1]: memcached.service: Failed with result 'exit-code'.
MAXCONN 값이 기본적으로 열어야 하는 파일의 수만큼은 되어야 하는 것 같다. 때에 따라 다르겠지만, 시험해 보았을 때는 MAXCONN 값이 27보다 작게 하면 위와 같은 오류가 떴다.
덧글을 달아 주세요