⻠以ä¸ããã£ã¯ã·ã§ã³ã§ãã
ã¯ããã«ï¼ ãããªãµã¼ã(âdstat)
(è£ãããã«ããiowaitã¨LAãé«ãã®ã¯ä¸æçãªä»æ§ã¨ãã)
æ°ä»ãã°ãã°ã«ã»ã»ã»
Mar 29 18:08:02 hostname kernel: printk: 48843 messages suppressed. Mar 29 18:08:02 hostname kernel: TCP: time wait bucket table overflow Mar 29 18:08:07 hostname kernel: printk: 54962 messages suppressed. Mar 29 18:08:07 hostname kernel: TCP: time wait bucket table overflow Mar 29 18:08:12 hostname kernel: printk: 64843 messages suppressed. Mar 29 18:08:12 hostname kernel: TCP: time wait bucket table overflow
ï¾ï½¯ï½¼ï½®ï½²ã½(ï¾âï¾)ã¡(ï¾âï¾)ã¡(ï¾âï¾)ãï¾ï½¯ï½¼ï½®ï½²
æ¥ç¶ç¶æ³ã¯ã»ã»ã»å¤§éã®TIME_WAITãã£
# netstat -tan | grep ':80 ' | awk '{print $6}' | sort | uniq -c 5 ESTABLISHED 11 FIN_WAIT1 1 FIN_WAIT2 1 LISTEN 3 SYN_RECV 149324 TIME_WAIT
ï¾ï½¯ï½¼ï½®ï½²ã½(ï¾âï¾)ã¡(ï¾âï¾)ã¡(ï¾âï¾)ãï¾ï½¯ï½¼ï½®ï½²
ãå¾ ã¡ã«ãªããã¦ããã¾ãã»ã»ã»
# netstat -ton tcp 0 0 ::ffff:172.xx.xx.xx:80 ::ffff:xx.xx.xx.aa:54648 TIME_WAIT timewait (27.05/0/0) tcp 0 0 ::ffff:172.xx.xx.xx:80 ::ffff:xx.xx.xx.bb:54720 TIME_WAIT timewait (7.67/0/0) tcp 0 0 ::ffff:172.xx.xx.xx:80 ::ffff:xx.xx.xx.cc:55908 TIME_WAIT timewait (52.52/0/0) tcp 0 0 ::ffff:172.xx.xx.xx:80 ::ffff:xx.xx.xx.dd:55918 TIME_WAIT timewait (44.23/0/0) tcp 0 0 ::ffff:172.xx.xx.xx:80 ::ffff:xx.xx.xx.ee:55906 TIME_WAIT timewait (30.47/0/0) tcp 0 0 ::ffff:172.xx.xx.xx:80 ::ffff:xx.xx.xx.ff:55842 TIME_WAIT timewait (24.80/0/0) tcp 0 0 ::ffff:172.xx.xx.xx:80 ::ffff:xx.xx.xx.gg:55910 TIME_WAIT timewait (15.51/0/0) tcp 0 0 ::ffff:172.xx.xx.xx:80 ::ffff:xx.xx.xx.hh:56164 TIME_WAIT timewait (53.01/0/0) tcp 0 0 ::ffff:172.xx.xx.xx:80 ::ffff:xx.xx.xx.ii:56162 TIME_WAIT timewait (30.65/0/0) tcp 0 0 ::ffff:172.xx.xx.xx:80 ::ffff:xx.xx.xx.jj:56166 TIME_WAIT timewait (15.65/0/0) ã»ã»ã»ã»ã»ä»¥ä¸10ä¸è¡ä½ãçç¥ï½ã»ã»ã»ã»ã»
ï½±ï¾ï¾ ã½(´Ðï½;â¡;´Ðï½)丿 ï½±ï¾ï¾
net.ipv4.tcp_max_tw_buckets
tcp_max_tw_buckets (integer; default: ä¸è¨åç §; Linux 2.4 以é)
Man page of TCP
ã·ã¹ãã ã許容ãã TIME_WAIT ç¶æ ã«ããã½ã±ããã®æ大æ°ããã®å¶éãåå¨ããã®ã¯ãåç´ãªä½¿ç¨ä¸è½ (denial-of-service) æ»æãé²ãããã«éããªããããã©ã«ãå¤ã¯ NR_FILE*2 ã§ãã·ã¹ãã ã®ã¡ã¢ãªã«å¿ãã¦èª¿æ´ãããããã®æ°å¤ãè¶ããã¨ããã®ãããªã½ã±ããã¯ã¯ãã¼ãºãããè¦åã表示ãããã
"tcp_max_tw_buckets"ã®å¤ããã¡ãã£ã¨ãã¤å¢ããã¦ã¿ããã©ã»ã»ã»å¤ãããªãï¼
ã¾ï¾ã»âã»ï½)ï¾ï¾ï¾ï¾ ã¾ï¾'д'o)?? ï¾âââ(ä¹Ð´)âââï¾!!
net.ipv4.tcp_tw_reuse
tcp_tw_reuse (Boolean; default: disabled; Linux 2.4.19/2.6 以é)
Man page of TCP
ãããã³ã«ã®é¢ããè¦ã¦åé¡ãªãå ´åã«æ°è¦ã³ãã¯ã·ã§ã³ã« TIME_WAIT ç¶æ ã®ã½ã±ãããåå©ç¨ãããã¨ã許å¯ãããæè¡çã«è©³ãã人ã®å©è¨ãè¦è«ãªãã«ãã®ãªãã·ã§ã³ãå¤æ´ãã¹ãã§ã¯ãªãã
æå¹ã«ãã¦ã¿ãã
# netstat -tan | grep ':80 ' | awk '{print $6}' | sort | uniq -c 2 ESTABLISHED 12 FIN_WAIT1 2 FIN_WAIT2 1 LISTEN 3 SYN_RECV 153076 TIME_WAIT
ï½±ï¾ï¾ ã½(´Ðï½;â¡;´Ðï½)丿 ï½±ï¾ï¾
net.ipv4.tcp_tw_recycle
tcp_tw_recycle (Boolean; default: disabled; Linux 2.4 以é)
Man page of TCP
TIME_WAIT ã½ã±ããã®ç´ æ©ãåå©ç¨ãæå¹ã«ããããã®ãªãã·ã§ã³ãæå¹ã«ããã¨ã NAT (ãããã¯ã¼ã¯ã¢ãã¬ã¹å¤æ) ãç¨ãã¦ããã¨åé¡ãçããã®ã§ããã¾ãæ¨å¥¨ããªãã
ä»åã¯ããã¯ã¨ã³ã(internal)ã®è©±ã§ãã¯ã©ã¤ã¢ã³ãããµã¼ãéã§ãNATãæãã§ããã¨ããã¯ç¡ãã£ãã®ã§æå¹ã«ãã¦ã¿ãã
# netstat -tan | grep ':80 ' | awk '{print $6}' | sort | uniq -c 9 ESTABLISHED 14 FIN_WAIT1 1 FIN_WAIT2 1 LISTEN 5 SYN_RECV 22 TIME_WAIT
ï¼ï¿£ã¼+ï¿£ï¼. (ï¿£â+ï¿£)vï½·ï¾ï½°ï¾
ãããã«
æ¬å½ã¯ãTIME_WAITèªä½ã®ã¿ã¤ã ã¢ã¦ãã60sããçããããã£ãããkernelã®rebuildããè¾ãç¶æ³ã§...ãã¨ã
å®ã¯ãHTTPæ¥ç¶ãªã®ã§ããã¡ãã¨Keep-Aliveã使ããç¶æ
ã«ãã¹ãã(ã¾ã¨ã¾ã£ã¦ãªã)
=͟͟͞͞(๑•̀=͟͟͞͞(๑•̀д•́=͟͟͞͞(๑•̀д•́๑)=͟͟͞͞(๑•̀д•́
ãã¾ã
説æ
TCPã½ã±ããã®TIME_WAITç¶æ ã管çããããã«ä½¿ç¨ããã¹ã©ããã£ãã·ã¥ã®ãµã¤ãºãæ大å¤(tcp_max_tw_buckets)ã«éããã
tcp_max_buckets ã¯ã¦ã¼ã¶ã¼ãè¨å®ãããã¨ãã§ããããã©ã«ãå¤ã¯ 16384 ã§ããã
ç¾å¨ã®å¤ã確èªããã«ã¯ã以ä¸ã®2ã¤ã®æ¹æ³ã®ãããããå©ç¨ããã°ããã
1. # cat /proc/sys/net/ipv4/tcp_max_tw_buckets 2. # sysctl net.ipv4.tcp_max_tw_bucketshttp://ossmpedia.org/messages/linux/2.6.9-34.EL/29972.ja対å¦
tcp_max_tw_buckets ãã·ã¹ãã ã® TCP ã½ã±ããå©ç¨ç¶æ³ã«åããã¦æ¡å¼µããã
ãã®å¶éã¯ãDOSæ»æã«å¯¾å¦ããããã ãã«è¨ãããã¦ãããã®ã§ããã®å¤ã大ãããããã¨ã§ãã¡ã¢ãªãªã½ã¼ã¹ãªã©ãç¡éã«æ¶è²»ãããã¨ã¯ãªãã
tcp_max_tw_buckets ã®è¨å®æ¹æ³ã¯ä»¥ä¸ã®2ã¤ãããã
1. # echo <ã¹ã©ããã£ãã·ã¥ãµã¤ãº> > /proc/sys/net/ipv4/tcp_max_tw_buckets 2. # sysctl -w net.ipv4.tcp_max_tw_buckets=<ã¹ã©ããã£ãã·ã¥ãµã¤ãº>
åè
- Man page of TCP
- http://www.redbooks.ibm.com/redpapers/pdfs/redp3861.pdf
- Tuning Red Hat Enterprise Linux on IBM Eserver xSeries Servers
- どさにっき
- いっぱい接続したいの - (ひ)メモ
- TCP/IP通信の状態を調べる「netstat」コマンドを使いこなす (1/2):Tech TIPS - @IT
詳解TCP/IPãVol.1ããããã³ã«
- ä½è : W.ãªãã£ã¼ãã¹ãã£ã¼ã´ã³ã¹,W.Richard Stevens,æ©åº·é,äºä¸å°å¸
- åºç社/ã¡ã¼ã«ã¼: ãã¢ã½ã³ã¨ãã¥ã±ã¼ã·ã§ã³
- çºå£²æ¥: 2000/12
- ã¡ãã£ã¢: åè¡æ¬
- è³¼å ¥: 6人 ã¯ãªãã¯: 81å
- ãã®ååãå«ãããã° (41件) ãè¦ã