<?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>Benjamin Golub's blog &#187; apache</title>
	<atom:link href="http://old.benjamingolub.com/tag/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://old.benjamingolub.com</link>
	<description>Benjamin Golub's blog</description>
	<lastBuildDate>Tue, 02 Dec 2008 15:27:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>RSSmeme humming along; Curse you FriendFeed Stats!</title>
		<link>http://old.benjamingolub.com/2008/05/05/rssmeme-humming-along-curse-you-friendfeed-stats/</link>
		<comments>http://old.benjamingolub.com/2008/05/05/rssmeme-humming-along-curse-you-friendfeed-stats/#comments</comments>
		<pubDate>Mon, 05 May 2008 12:36:58 +0000</pubDate>
		<dc:creator>Benjamin Golub</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[friendfeed]]></category>
		<category><![CDATA[rssmeme]]></category>
		<category><![CDATA[s3]]></category>
		<category><![CDATA[stats]]></category>

		<guid isPermaLink="false">http://benjamingolub.com/?p=142</guid>
		<description><![CDATA[Here are some steps I&#8217;ve taken towards delivering a more reliable RSSmeme:

All static files are being served by S3.  My server is set to redirect any requests to static files (like the widget) to the file on S3.  This means that if RSSmeme slows down and you have the widget installed; your site will not [...]]]></description>
			<content:encoded><![CDATA[<p>Here are some steps I&#8217;ve taken towards delivering a more reliable RSSmeme:</p>
<ol>
<li>All static files are being served by <a href="http://www.amazon.com/gp/browse.html?node=16427261">S3</a>.  My server is set to redirect any requests to static files (like the widget) to the file on S3.  This means that if RSSmeme slows down and you have the <a href="http://www.rssmeme.com/widget/">widget</a> installed; <strong>your site will not be affected</strong>.  Occasionaly <a href="http://developer.amazonwebservices.com/connect/message.jspa?messageID=79978#79978">S3 has a breakdown</a>; if you are concerned with that affecting your site then please install the <a href="http://www.rssmeme.com/widget/#feedflare">FeedBurner FeedFlare</a> instead.  It is just as easy and the only way it will slow your site is if FeedBurner&#8217;s servers slow down (which I find highly unlikely).</li>
<li>The real culprit here wasn&#8217;t entirely static files.  It was <a href="http://www.friendfeedstats.com/">FriendFeed Stats</a>.  The global statistics page was tying up an apache process for a long time while it calculated the results.  My server doesn&#8217;t have much memory so stealing an apache process is a very big deal.  Imagine 10 of you hitting the same global FriendFeed Stats page with an unprimed cache?  All of my apache processes get stuck, other users get angry, and chaos ensues.  So I&#8217;ve disabled the global statistics pages.  All user specific pages will continue to work.</li>
<li>Over 250 different IPs (all requesting bogus URLs clearly trying to get access to my server) have been dropped using <a href="http://en.wikipedia.org/wiki/Iptables">iptables</a>.  I still need to figure out a better way to automate this process.  I think if an IP frequently requests a URL that results in a 404 then we can safely drop them instead of wasting time processing their requests.</li>
</ol>
<p>Again; I&#8217;m sorry!  But things are much better now.</p>
]]></content:encoded>
			<wfw:commentRss>http://old.benjamingolub.com/2008/05/05/rssmeme-humming-along-curse-you-friendfeed-stats/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VPS &#8211; Not All Fun and Games</title>
		<link>http://old.benjamingolub.com/2008/03/12/vps-not-all-fun-and-games/</link>
		<comments>http://old.benjamingolub.com/2008/03/12/vps-not-all-fun-and-games/#comments</comments>
		<pubDate>Wed, 12 Mar 2008 23:33:47 +0000</pubDate>
		<dc:creator>Benjamin Golub</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[slicehost]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://benjamingolub.com/2008/03/12/vps-not-all-fun-and-games/</guid>
		<description><![CDATA[I idle in #slicehost, an IRC channel for my VPS provider, and see people come in all day long complaining about how slow their app is running on Slicehost compared to shared hosting. Nearly every single time the user installed Ubuntu (not that there is anything wrong with that; it&#8217;s what I use) and are [...]]]></description>
			<content:encoded><![CDATA[<p>I idle in #slicehost, an IRC channel for <a href="http://www.slicehost.com/">my VPS provider</a>, and see people come in all day long complaining about how slow their app is running on Slicehost compared to shared hosting. Nearly every single time the user installed Ubuntu (not that there is anything wrong with that; it&#8217;s what I use) and are using apache + mysql.  Most of the time they are running a 256MB slice but on occasion you&#8217;ll see someone come in with a 256MB slice and upgrade to a 2048MB slice because they think it will help.  It won&#8217;t; they are wasting money.  They need to learn that there is more to setting up a VPS than:</p>
<blockquote><p><code>sudo aptitude install apache2</code></p></blockquote>
<p align="left">Most of the time it isn&#8217;t that they have terrible database indexing.  It isn&#8217;t even that they aren&#8217;t caching anything.  The problem is that they keep the Ubuntu apache default settings which spawns over 100 server processes.  Each one takes up at least 15MB and brings the server down to it&#8217;s knees.  As soon as your server starts swapping it&#8217;s performance is going to take a nose dive.  So let&#8217;s reduce the number of processes apache spawns:</p>
<blockquote>
<p align="left"><code>sudoedit /etc/apache2/apache2.conf</code></p>
</blockquote>
<p align="left">And search for this section and make these changes (assuming you are using the default prefork module):</p>
<blockquote>
<pre>&lt;IfModule mpm_prefork_module&gt;
    StartServers          2
    MinSpareServers       2
    MaxSpareServers       4
    MaxClients            4
    MaxRequestsPerChild   250
&lt;/IfModule&gt;</pre>
</blockquote>
<p align="left">That is a good place to start; everyone will have to tweak these as necessary but for a 256MB slice it should work well.  It tells apache to start with 2 processes, allow between 2 and 4 processes to idle, run a maximum of 4 processes, and to restart a process after it serves 250 requests (which is like a get out of jail free card if you are leaking memory).  Note that this does not mean that you can only handle 4 <strong>users</strong> at a time.  It means you can handle 4 <strong>requests</strong> at a time and any other requests are queued up.  Watch your memory usage (using <code>top</code> or <code>free</code>) and tweak these numbers as necessary.</p>
<p align="left">There are other easy fixes that I won&#8217;t get into:</p>
<ul>
<li>Use a separate media server (<a href="http://www.amazon.com/gp/browse.html?node=16427261">S3</a> maybe) and turn <code>KeepAlive</code> off for your dynamic server.</li>
<li>Use <a href="http://www.danga.com/memcached/">memcached</a> to cache anything and everything.</li>
<li>Reorganize your database.  In mysql try to avoid using blobs if possible.  If you need them then move them off to their own table because mysql <strong>cannot</strong> cache columns with variable length.  This was <a href="http://www.rssmeme.com/">RSSmeme</a>&#8217;s problem; a database reorganization that took 5 minutes resulted in complex queries taking .01 sec instead of 5 sec.</li>
<li>Fine tune your database.  Depending on your app you might consider modifying <code>query_cache_size</code>, <code>sort_buffer_size</code>, <code>key_buffer</code>, <code>tmp_table_size</code>, and <code>table_cache</code>.  Removing innodb support (if you don&#8217;t need it) will save you an easy 10MB.</li>
</ul>
<p>And please take everything you read on the internet about fine tuning your VPS with a grain of salt; including this.  I do not consider myself an expert at this; I&#8217;m far from it.  I could be very wrong and this could be terrible for your needs.  The point is that you need to put just a little bit of effort into setting up VPS.  Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://old.benjamingolub.com/2008/03/12/vps-not-all-fun-and-games/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How To Switch to FeedBurner Without Confusing Your Current Subscribers</title>
		<link>http://old.benjamingolub.com/2008/02/01/how-to-switch-to-feedburner-without-confusing-your-current-subscribers/</link>
		<comments>http://old.benjamingolub.com/2008/02/01/how-to-switch-to-feedburner-without-confusing-your-current-subscribers/#comments</comments>
		<pubDate>Fri, 01 Feb 2008 13:16:53 +0000</pubDate>
		<dc:creator>Benjamin Golub</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[feedburner]]></category>
		<category><![CDATA[rss]]></category>

		<guid isPermaLink="false">http://benjamingolub.com/2008/02/01/how-to-switch-to-feedburner-without-confusing-your-current-subscribers/</guid>
		<description><![CDATA[As part of my goal to get more readers to this site I&#8217;ve finally setup an account with FeedBurner.  Unfortunately; since I did not have FeedBurner setup before, I am left wondering what to do with all of my current subscribers.  I can&#8217;t ask them to delete the old feed from their feed readers because [...]]]></description>
			<content:encoded><![CDATA[<p>As part of my goal to get more readers to this site I&#8217;ve finally setup an account with FeedBurner.  Unfortunately; since I did not have FeedBurner setup before, I am left wondering what to do with all of my current subscribers.  I can&#8217;t ask them to delete the old feed from their feed readers because nobody would actually do it.  Instead, I&#8217;ll just redirect from my old feed to my new feed using Apache!</p>
<p>If you have control of your server it&#8217;s as simple as setting a redirect from your current feed to your Feedburner feed.  Here&#8217;s how:</p>
<ol>
<li>Point Feedburner to /wordpress/wp-rss2.php NOT to /feed.  If you point FeedBurner to /feed then you&#8217;ll enter a recursive loop of redirects.  Whoops!</li>
<li>Look for a file called .htaccess at the root directory for your site.  It is a hidden file so you have to pass the &#8216;-a&#8217; flag to ls to see it.  I have no clue how to see hidden files on windows.</li>
<li>Most likely you can place the following line at the very top of your .htaccess file.  You want this redirect to happen before anything else in the file.  In my case, I actually had a <a href="http://benjamingolub.com/2007/02/25/no-www-here/">redirect from anything www to no www</a>, so I wanted that to happen BEFORE redirecting to the feed, so I placed this redirect below the www redirect:<br />
<blockquote><p><code>Redirect /feed http://feeds.feedburner.com/benjamingolub</code></p></blockquote>
<p>That will do a 302 (temporary) redirect from my Wordpress feed to my FeedBurner feed.</li>
</ol>
<p>Any software that&#8217;s any good will follow that redirect and grab entries from FeedBurner without any user intervention.  Now I can collect some statistics!</p>
]]></content:encoded>
			<wfw:commentRss>http://old.benjamingolub.com/2008/02/01/how-to-switch-to-feedburner-without-confusing-your-current-subscribers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
