«   2018/07   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Archives
Today
526
Total
1,123,695
안정적인 DNS서비스 DNSEver
관리 메뉴

Blue Breeze

HAProxy FD Limt maxconn/maxsock 본문

Server Side/HAProxy

HAProxy FD Limt maxconn/maxsock

푸른바람 C/H 2017.06.20 08:30

restart error

[root@paranoid ~]# ssh haproxy1
Last login: Tue Jun 13 10:13:06 2017 from data-server.cs2aa3cloud.internal
[root@haproxy1 ~]# systemctl status haproxy
● haproxy.service - SYSV: HA-Proxy is a TCP/HTTP reverse proxy which is particularly suited for high availability environments.
   Loaded: loaded (/etc/rc.d/init.d/haproxy; bad; vendor preset: disabled)
   Active: failed (Result: signal) since Tue 2017-06-13 03:29:01 KST; 10h ago
     Docs: man:systemd-sysv-generator(8)
  Process: 22220 ExecStop=/etc/rc.d/init.d/haproxy stop (code=exited, status=0/SUCCESS)
  Process: 22207 ExecReload=/etc/rc.d/init.d/haproxy reload (code=exited, status=0/SUCCESS)
  Process: 1764 ExecStart=/etc/rc.d/init.d/haproxy start (code=exited, status=0/SUCCESS)
 Main PID: 22212 (code=killed, signal=KILL)

Jun 12 18:42:22 haproxy1.localdomain haproxy[1764]: [  OK  ]
Jun 12 18:42:22 haproxy1.localdomain systemd[1]: Started SYSV: HA-Proxy is a TCP/HTTP reverse proxy which is particularly suited for high availability environments..
Jun 13 03:29:01 haproxy1.localdomain haproxy[22207]: [WARNING] 163/032901 (22211) : stats socket will not work as expected in multi-process mode (nbproc > 1), you should force process binding globally using 'stats bin...cess' attribute.
Jun 13 03:29:01 haproxy1.localdomain haproxy[22207]: [WARNING] 163/032901 (22211) : [/usr/sbin/haproxy.main()] Cannot raise FD limit to 1600074, limit is 4096.
Jun 13 03:29:01 haproxy1.localdomain haproxy[22207]: [WARNING] 163/032901 (22211) : [/usr/sbin/haproxy.main()] FD limit (4096) too low for maxconn=800000/maxsock=1600074. Please raise 'ulimit-n' to 1600074 or more to avoid any trouble.
Jun 13 03:29:01 haproxy1.localdomain systemd[1]: Reloaded SYSV: HA-Proxy is a TCP/HTTP reverse proxy which is particularly suited for high availability environments..
Jun 13 03:29:01 haproxy1.localdomain systemd[1]: haproxy.service: main process exited, code=killed, status=9/KILL
Jun 13 03:29:01 haproxy1.localdomain haproxy[22220]: Shutting down haproxy: [FAILED]
Jun 13 03:29:01 haproxy1.localdomain systemd[1]: Unit haproxy.service entered failed state.
Jun 13 03:29:01 haproxy1.localdomain systemd[1]: haproxy.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

FD limit (4096) too low for maxconn=800000/maxsock=1600074. Please raise 'ulimit-n' to 1600074 or more to avoid any trouble.
maxconn = 800000 / maxsock = 1600074에 대해 FD 제한 (4096)이 너무 낮습니다. 문제가 발생하지 않도록 'ulimit-n'을 1600074 이상으로 올리십시오.

설정 변경

# 1. 현재 파일 오픈 제한값.
more /proc/sys/fs/file-max
1609863

sysctl -a | grep fs.file-max
fs.file-max = 1609863

# 2. 현재 사용중인 열린 파일 디스크립터 수.
more /proc/sys/fs/file-nr
1184	0	1609863

# 3. 열링 파일 수 확인. 1 개의 파일 디스크립터가 복수의 열린 파일을 첨부 할 수 있다.
lsof | wc -l
2359


# 4. fs.file-max 값 설정.
vi /etc/sysctl.conf
fs.file-max = 65535

# 5. 변경사항 적용
sysctl -p
fs.file-max = 65535
vi /etc/sysctl.conf
fs.file-max = 65535

sysctl -p

/sbin/sysctl -w net.core.somaxconn=65535
sysctl -p /etc/sysctl.conf
ulimit -n 65535
ulimit -u 65535

// 아래 파일 열어서 추가
vi /etc/security/limits.conf
root hard nofile 65535
root soft nofile 65535


'Server Side > HAProxy' 카테고리의 다른 글

HAProxy balance  (0) 2017.07.04
haproxy reload FAILED  (0) 2017.06.22
HAProxy FD Limt maxconn/maxsock  (0) 2017.06.20
'option forwardfor' ignored for proxy  (0) 2017.06.19
HAProxy Gateway timeout  (0) 2017.06.15
HATop  (0) 2017.06.13
0 Comments
댓글쓰기 폼