<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>浮山狼de博客 &#187; SYN flood</title>
	<atom:link href="https://www.fushanlang.com/tag/syn-flood/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.fushanlang.com</link>
	<description>next station - 下一站，活在当下，且行且思</description>
	<lastBuildDate>Sat, 29 Nov 2014 15:14:11 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.2.5</generator>
	<item>
		<title>linux-SYN-netstat TIME_WAIT</title>
		<link>https://www.fushanlang.com/linux-syn-the-netstat-the-time_wait-2127/</link>
		<comments>https://www.fushanlang.com/linux-syn-the-netstat-the-time_wait-2127/#comments</comments>
		<pubDate>Wed, 06 Jun 2012 07:44:59 +0000</pubDate>
		<dc:creator><![CDATA[fushanlang]]></dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[webserver]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[liunx]]></category>
		<category><![CDATA[SYN flood]]></category>

		<guid isPermaLink="false">http://www.fushanlang.com/blog/?p=2127</guid>
		<description><![CDATA[Linux Web服务器连接数控制 <p>平时检测网站服务器连接数情况，常用的如  netstat -ant &#124;awk &#8216;{print $6}&#8217;&#124;sort&#124;uniq -c &#124;sort -n  给出如下统计</p> TIME_WAIT 3699 CLOSE_WAIT 52 FIN_WAIT1 32 SYN_SENT 1 FIN_WAIT2 2 ESTABLISHED 17 SYN_RECV 45 CLOSING 6 <p>有时会发现大量的TIME_WAIT，SYN_RECV,  CLOSE_WAIT  ,  FIN_WAIT状态，此时需要对系统参数做些调整：</p> vi /etc/sysctl net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_keepalive_time = 1000 net.ipv4.tcp_fin_timeout = 30 net.ipv4.tcp_window_scaling = 0 net.ipv4.tcp_sack = 0 net.ipv4.tcp_max_syn_backlog = <span style="color:#777"> . . . &#8594; Read More: <a href="https://www.fushanlang.com/linux-syn-the-netstat-the-time_wait-2127/">linux-SYN-netstat TIME_WAIT</a></span>]]></description>
				<content:encoded><![CDATA[<h2>Linux Web服务器连接数控制</h2>
<p>平时检测网站服务器连接数情况，常用的如  <strong>netstat -ant |awk &#8216;{print $6}&#8217;|sort|uniq -c |sort -n</strong>  给出如下统计</p>
<pre>
TIME_WAIT 3699
CLOSE_WAIT 52
FIN_WAIT1 32
SYN_SENT 1
FIN_WAIT2 2
ESTABLISHED 17
SYN_RECV 45
CLOSING 6</pre>
<p>有时会发现大量的TIME_WAIT，SYN_RECV,  CLOSE_WAIT  ,  FIN_WAIT状态，此时需要对系统参数做些调整：</p>
<pre>vi /etc/sysctl</pre>
<pre>net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_keepalive_time = 1000
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_window_scaling = 0
net.ipv4.tcp_sack = 0
net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.tcp_max_tw_buckets = 5000
net.ipv4.ip_local_port_range = 1024 65000
net.core.netdev_max_backlog =8096</pre>
<p>先执行<strong>sysctl -p</strong> 让新设置生效，然后再次执行<strong> netstat -ant |awk &#8216;{print $6}&#8217;|sort|uniq -c |sort -n</strong>  给出如下统计：</p>
<pre>
TIME_WAIT 36
CLOSE_WAIT 52
FIN_WAIT1 32
SYN_SENT 1
FIN_WAIT2 2
ESTABLISHED 2700
SYN_RECV 4
CLOSING 6</pre>
]]></content:encoded>
			<wfw:commentRss>https://www.fushanlang.com/linux-syn-the-netstat-the-time_wait-2127/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
