<?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>Paul Goscicki &#187; fedora</title>
	<atom:link href="http://paulgoscicki.com/categories/linux/fedora/feed/" rel="self" type="application/rss+xml" />
	<link>http://paulgoscicki.com</link>
	<description>Random pieces of code, thoughts and movie reviews</description>
	<lastBuildDate>Tue, 15 Nov 2011 18:45:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>Squid: WARNING! Your cache is running out of filedescriptors</title>
		<link>http://paulgoscicki.com/archives/2007/01/squid-warning-your-cache-is-running-out-of-filedescriptors/</link>
		<comments>http://paulgoscicki.com/archives/2007/01/squid-warning-your-cache-is-running-out-of-filedescriptors/#comments</comments>
		<pubDate>Mon, 01 Jan 2007 17:49:07 +0000</pubDate>
		<dc:creator>Paul Goscicki</dc:creator>
				<category><![CDATA[administration]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://paulgoscicki.com/archives/2007/01/squid-warning-your-cache-is-running-out-of-filedescriptors/</guid>
		<description><![CDATA[So you have a LAN with 50+ users and you set up a nice Squid w3cache as a transparent proxy with 100GB of space reserved for the cache (hdds are so cheap nowadays&#8230;). Weeks pass and suddenly you notice that something is messing up your web experience as Firefox suddenly decides to run painfully slow. [...]]]></description>
			<content:encoded><![CDATA[<p>So you have a LAN with 50+ users and you set up a nice Squid w3cache as a transparent proxy with 100GB of space reserved for the cache (hdds are so cheap nowadays&#8230;). Weeks pass and suddenly you notice that something is messing up your <em>web experience</em> as Firefox suddenly decides to run painfully slow. About 30 minutes wasted on finding the culprit (like changing your DNS servers, clearing browser cache, etc.) until you decide to check the router and then the <a href="http://www.squid-cache.org/">Squid</a> with its logs. And then you find something <em>fishy</em>:</p>
<pre class="code">
2007/01/01 17:51:19| WARNING! Your cache is running out of filedescriptors
2007/01/01 17:51:35| WARNING! Your cache is running out of filedescriptors
2007/01/01 17:51:51| WARNING! Your cache is running out of filedescriptors
(...)
</pre>
<p>I won&#8217;t be explaining why this happens. Others <a href="http://www.onlamp.com/pub/a/onlamp/2004/02/12/squid.html">have</a> <a href="http://www.onlamp.com/pub/a/onlamp/2004/02/12/squid.html">done it</a> <a href="http://wiki.squid-cache.org/SquidFaq/TroubleShooting#head-eb3240fe8e61368056af86138a2b5dcbc9781a54">before</a>. What I&#8217;m going to do is present you with a solution that <strong>does not</strong> require a complete Squid recompilation/reinstallation procedure.</p>
<h3>RedHat/Fedora</h3>
<pre class="code">
/etc/init.d/squid stop

nano /etc/squid/squid.conf
  max_filedesc 4096

nano /etc/init.d/squid
  # add this just after the comments (before any script code)
  ulimit -HSn 4096

/etc/init.d/squid start
</pre>
<h3>Debian</h3>
<pre class="code">
nano /etc/defaults/squid
  SQUID_MAXFD=4096

/etc/init.d/squid restart
</pre>
<h3>Ubuntu</h3>
<pre class="code">
nano /etc/default/squid
  SQUID_MAXFD=4096

/etc/init.d/squid restart
</pre>
<p>And now watch the <code>/var/log/squid/cache.log</code> for a similar line:</p>
<pre class="code">
2007/01/01 18:32:27 With 4096 file descriptors available
</pre>
<p>If it still says <code>1024 file descriptors available</code> (or similarly low value) you are out of luck (or you&#8217;ve just messed something up).</p>
]]></content:encoded>
			<wfw:commentRss>http://paulgoscicki.com/archives/2007/01/squid-warning-your-cache-is-running-out-of-filedescriptors/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>

