kernel: nf_conntrack: table full, dropping packet.
top 나 ps -ef 를 암만 쳐다봐도 서버에 문제가 없는 것 같은데, FTP 접속하여 파일 업로드할때 1k 짜리 파일도 10초 이상 걸릴때 확인하면 딱, 이놈이 대부분 문제다.
시스템(iptable)에서 처리할 수 있는 패킷이 설정된 값을 초과하면서 이후 패킷에 대해서 drop 되어 찍히는 메시지이다.
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
[root@test ~] dmesg __ratelimit: 329 callbacks suppressed nf_conntrack: table full, dropping packet. nf_conntrack: table full, dropping packet. nf_conntrack: table full, dropping packet. nf_conntrack: table full, dropping packet. nf_conntrack: table full, dropping packet. nf_conntrack: table full, dropping packet. nf_conntrack: table full, dropping packet. nf_conntrack: table full, dropping packet. nf_conntrack: table full, dropping packet. nf_conntrack: table full, dropping packet. ....... (계속 나와..-ㅅ-) |
nf_conntrack 는 IPTABLES를 통해 접속된 IP의 현재 접속상태에 대한 정보를 담고있는 시스템 모듈이며,
대부분 FTP의 세션 연결 정보 (SRC IP(송신자 IP), DST IP(수신자 IP) 의 정보) 를 CONTRACK 테이블에 담고 있다.
FTP는 TCP 21, 20 의 포트를 이용 ( TCP 21 : 사용자 인증 및 명령어 전달 / TCP 20 : 사용자의 명령을 처리하여 결과를 전달 )
해결 방법을 알아봅시다!!
0 1 2 3 |
[root@test ~]# uname -r 2.6.32-642.13.1.el6.x86_64 |
0 1 2 3 4 5 6 7 8 9 10 11 12 13 |
# 커널버전에 따라 확인 방법이 다르다 # 2.4.23 이전 : cat /proc/sys/net/ipv4/ip_conntrack_max # 2.4.23 이후 : cat /proc/sys/net/ipv4/netfilter/ip_conntrack_max # 2.6.20 이후 : cat /proc/sys/net/netfilter/nf_conntrack_max # 현재 접속된 IP 개수 [root@test ~] cat /proc/sys/net/netfilter/nf_conntrack_count 1233 # 접속할 수 있는 최대 값 / 디폴트는 65536 [root@test ~] cat /proc/sys/net/nf_conntrack_max 65536 |
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# nf_conntrack_max 과 nf_conntrack_count 의 값이 비슷하면 서버 장애가 발생한다. [root@test ~] cat /proc/sys/net/nf_conntrack_max 65536 [root@test ~] cat /proc/sys/net/netfilter/nf_conntrack_count 65536 [root@test ~] dmesg __ratelimit: 243 callbacks suppressed nf_conntrack: table full, dropping packet. nf_conntrack: table full, dropping packet. nf_conntrack: table full, dropping packet. nf_conntrack: table full, dropping packet. nf_conntrack: table full, dropping packet. nf_conntrack: table full, dropping packet. nf_conntrack: table full, dropping packet. nf_conntrack: table full, dropping packet. nf_conntrack: table full, dropping packet. nf_conntrack: table full, dropping packet. |
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# iptables 를 통한 IP 정보이기때문에 얘만 멈춰도 됨 [root@test ~]# service iptables stop iptables: 체인을 ACCEPT 규칙으로 설정 중: mangle nat filte [ OK ] iptables: 방화벽 규칙을 지웁니다: [ OK ] iptables: 모듈을 언로드하는 중: [ OK ] or # 최대값 변경 // 리부팅하면 기본값(65536)으로 돌아옴 [root@test ~] echo 100000 > /proc/sys/net/nf_conntrack_max or # 무한대 설정 // 무한대로 늘릴 경우 시스템이 불안정해질 수 있기때문에 권하지 않음 [root@test ~] echo 0 > /proc/sys/net/nf_conntrack_max |
임시로 설정값을 늘려서 해결하는 것이 능사가 아니라 접속자가 폭등한 이유를 찾아 해결해야 한다. 가 결론..