ulimit Vlaue(EC2)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | [root@localhost ~]
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 245648
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real- time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 245648
virtual memory (kbytes, - v ) unlimited
file locks (-x) unlimited
|
기본적인 EC에서는 open files가 1024개 입니다. 그렇기 때문에 1000개이상 커넥션을 늘리면 아래와 같이 에러가 떨어지고 proxySQL이 restart되는 것을 볼 수 있었습니다.
1 2 3 4 5 6 7 8 9 10 11 12 13 | [warn] epoll_create: Too many open files
[err] evsig_init: socketpair: Too many open files
2016-06-29 08:32:25 [ERROR] ProxySQL exited with code 1 . Restarting!
2016-06-29 08:32:25 [INFO] Angel process is waiting 1 seconds before starting a new ProxySQL process
2016-06-29 08:32:26 [INFO] Angel process started ProxySQL process 25396
2016-06-29 08:32:26 [ERROR] Impossible to set not existing variable session_debug with value "(null)" . Deleting
2016-06-29 08:32:26 [ERROR] Impossible to set not existing variable ping_interval_server with value "10000" . Deleting
Admin initialized in 0.022234 secs.
Standard ProxySQL Admin rev. 0.2.0902 -- ProxySQL_Admin.cpp -- Mon May 23 10:21:24 2016
Standard MySQL Threads Handler rev. 0.2.0902 -- MySQL_Thread.cpp -- Mon May 23 10:21:24 2016
Standard MySQL Authentication rev. 0.2.0902 -- MySQL_Authentication.cpp -- Mon May 23 10:21:24 2016
Main init phase2 completed in 0.02367 secs.
Main phase3 : GloMyLogger initialized in 6e-06 secs.
|
그렇기 떄문에 ulimit의 값을 증가시켜야 합니다.
[root@localhost ~]
* soft nofile 65535
* hard nofile 65535
|
추가 후 재부팅을 해서 진행하는 것이 좋습니다.
이후에 connection을 1000개 넘게 붙여도 정상적으로 잘 붙는 것을 확인하였습니다.