<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule">

<channel>
	<title>wolfg&#039;s Weblog &#187; ulimit</title>
	<atom:link href="http://guoyong.org/tag/ulimit/feed" rel="self" type="application/rss+xml" />
	<link>http://guoyong.org</link>
	<description>wolfg&#039;s journey with open source, linux, programming, sysadm ...</description>
	<lastBuildDate>Thu, 04 Aug 2011 15:02:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/cn/</creativeCommons:license>		<item>
		<title>遭遇&#8221;java.io.IOException: Too many open files&#8221;</title>
		<link>http://guoyong.org/2010/01/20/520</link>
		<comments>http://guoyong.org/2010/01/20/520#comments</comments>
		<pubDate>Wed, 20 Jan 2010 08:47:21 +0000</pubDate>
		<dc:creator>wolfg</dc:creator>
				<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[jetty]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[lsof]]></category>
		<category><![CDATA[ulimit]]></category>

		<guid isPermaLink="false">http://guoyong.org/?p=520</guid>
		<description><![CDATA[今天下午，线上的Jetty服务宕机了，日志里大量的&#8221;java.io.IOException: Too many open files&#8221;错误。搜索到Freddy Chu的博客里正好有关于此的解决办法。 $ sysctl fs.file-max$ lsof -u jetty -nn &#124; wc -l$ ulimit -a$ sudo vi /etc/security/limits.conf* soft nofile 65535* hard nofile 65535 同时发现了系统里也有Freddy Chu提到的&#8221;Too many CLOSE_WAIT&#8221;问题，谢谢Freddy Chu。 $ sudo vi /etc/sysctl.confnet.ipv4.tcp_fin_timeout = 30net.ipv4.tcp_keepalive_intvl = 2net.ipv4.tcp_keepalive_probes = 2net.ipv4.tcp_keepalive_time = 1800$ sudo sysctl -p Update(2010-01-21): root用户要特殊设置 $ sudo vi /etc/security/limits.confroot soft nofile [...]]]></description>
			<content:encoded><![CDATA[<p>今天下午，线上的Jetty服务宕机了，日志里大量的&#8221;java.io.IOException: Too many open files&#8221;错误。搜索到<a href="http://tux.hk/">Freddy Chu</a>的博客里正好有关于此的解决办法。</p>
<div class="hl-surround"><div class="hl-main">$ sysctl fs.file-max<br />$ lsof -u jetty -nn | wc -l<br />$ ulimit -a<br />$ sudo vi /etc/security/limits.conf<br />* soft nofile 65535<br />* hard nofile 65535</div></div>
<p>同时发现了系统里也有Freddy Chu提到的&#8221;Too many CLOSE_WAIT&#8221;问题，谢谢Freddy Chu。</p>
<div class="hl-surround"><div class="hl-main">$ sudo vi /etc/sysctl.conf<br />net.ipv4.tcp_fin_timeout = 30<br />net.ipv4.tcp_keepalive_intvl = 2<br />net.ipv4.tcp_keepalive_probes = 2<br />net.ipv4.tcp_keepalive_time = 1800<br /><br />$ sudo sysctl -p</div></div>
<blockquote><p>Update(2010-01-21): root用户要特殊设置</p>
<div class="hl-surround"><div class="hl-main">$ sudo vi /etc/security/limits.conf<br />root soft nofile 65535<br />root hard nofile 65535</div></div>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://guoyong.org/2010/01/20/520/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

