<?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>mm &#187; lighttpd</title>
	<atom:link href="http://markmaunder.com/category/lighttpd/feed/" rel="self" type="application/rss+xml" />
	<link>http://markmaunder.com</link>
	<description></description>
	<lastBuildDate>Fri, 30 Jul 2010 05:56:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Slow lighttpd on Ubuntu 7.10 Gutsy Server with 200+ hits/sec?</title>
		<link>http://markmaunder.com/2008/slow-lighttpd-on-ubuntu-710-gutsy-server-with-200-hitssec/</link>
		<comments>http://markmaunder.com/2008/slow-lighttpd-on-ubuntu-710-gutsy-server-with-200-hitssec/#comments</comments>
		<pubDate>Mon, 10 Mar 2008 03:18:08 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[lighttpd]]></category>

		<guid isPermaLink="false">http://markmaunder.com/2008/slow-lighttpd-on-ubuntu-710-gutsy-server-with-200-hitssec/</guid>
		<description><![CDATA[aaaah you say. Finally, after many a Google search finally I found someone who understands my pain. I know you&#8217;re in a rush and I can&#8217;t stand people who love the sound of their typing either, so here&#8217;s how you fix this little problem.
If you have a brand new super fast server and a high traffic website (200+ requests per second) and you install lighttpd and it performs like a dog, try the following:
Add this to your /etc/sysctl.conf file:
 net.ipv4.tcp_fin_timeout ...]]></description>
			<content:encoded><![CDATA[<p>aaaah you say. Finally, after many a Google search finally I found someone who understands my pain. I know you&#8217;re in a rush and I can&#8217;t stand people who love the sound of their typing either, so here&#8217;s how you fix this little problem.</p>
<p>If you have a brand new super fast server and a high traffic website (200+ requests per second) and you install lighttpd and it performs like a dog, try the following:</p>
<p>Add this to your /etc/sysctl.conf file:</p>
<blockquote><p> net.ipv4.tcp_fin_timeout = 1<br />
net.ipv4.tcp_tw_recycle = 1</p>
<p>net.core.wmem_max = 16777216<br />
net.ipv4.tcp_rmem = 4096 87380 16777216<br />
net.ipv4.tcp_wmem = 4096 65536 16777216<br />
net.ipv4.tcp_no_metrics_save = 1<br />
net.ipv4.tcp_moderate_rcvbuf = 1<br />
net.core.wmem_default = 16777216</p>
<p>net.core.rmem_max = 16777216<br />
net.core.rmem_default = 16777216<br />
net.core.netdev_max_backlog = 262144<br />
net.core.somaxconn = 262144</p>
<p>net.ipv4.tcp_syncookies = 1<br />
net.ipv4.tcp_max_orphans = 262144<br />
net.ipv4.tcp_max_syn_backlog = 262144<br />
net.ipv4.tcp_synack_retries = 2<br />
net.ipv4.tcp_syn_retries = 2</p>
<p>#Only enable these if you&#8217;re dumb enough to have netfilter connection tracking enabled<br />
#net.ipv4.netfilter.ip_conntrack_max = 1048576<br />
#net.nf_conntrack_max = 1048576</p></blockquote>
<p>Then run</p>
<p>sysctl -p</p>
<p>Also make darn sure you don&#8217;t have netfilter&#8217;s conntrack modules enabled in the kernel. If you&#8217;re using shorewall on your lighttpd box this will probably be enabled. You can check if conntrack is enabled by checking if the file /proc/net/nf_conntrack exists. Also run lsmod and you&#8217;ll see a ton of modules starting with nf_contrack_</p>
<p>To get rid of conntrack if it&#8217;s enabled I would avoid rmmodding them &#8211; rather remove the app that enabled it and reboot the box just to keep things sane.</p>
<p>If you must insist in using conntrack then uncomment the last two lines in the sysctl.conf sample above.</p>
<p>Google the individual params above and you&#8217;ll find a ton of explanation on each.</p>
]]></content:encoded>
			<wfw:commentRss>http://markmaunder.com/2008/slow-lighttpd-on-ubuntu-710-gutsy-server-with-200-hitssec/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
