<?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>Be the signal &#187; Apache</title>
	<atom:link href="http://bethesignal.org/blog/tag/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://bethesignal.org</link>
	<description>where we&#039;re going, we don&#039;t need roads...</description>
	<lastBuildDate>Thu, 26 Jan 2012 05:52:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<atom:link rel='hub' href='http://bethesignal.org/?pushpress=hub'/>
		<item>
		<title>Replacing Apache with nginx for static file serving</title>
		<link>http://bethesignal.org/blog/2009/04/06/replacing-apache-with-nginx-for-static-file-serving/</link>
		<comments>http://bethesignal.org/blog/2009/04/06/replacing-apache-with-nginx-for-static-file-serving/#comments</comments>
		<pubDate>Sun, 05 Apr 2009 14:31:47 +0000</pubDate>
		<dc:creator>Jeff Waugh</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[ncache]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[web servers]]></category>

		<guid isPermaLink="false">http://bethesignal.org/?p=1431</guid>
		<description><![CDATA[This chart represents the regular activity of an Apache server from Monday to Thursday &#8212; a massive spike of non-idle processes starting around lunch time &#8212; and then an eerily quiet Friday. No, it wasn&#8217;t a public holiday, it&#8217;s just &#8230; <a href="http://bethesignal.org/blog/2009/04/06/replacing-apache-with-nginx-for-static-file-serving/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This chart represents the regular activity of an Apache server from Monday to Thursday &#8212; a massive spike of non-idle processes starting around lunch time &#8212; and then an eerily quiet Friday. No, it wasn&#8217;t a public holiday, it&#8217;s just evidence of <em>win</em>. Notice the gaps late on the 2nd and early on the 3rd? Happy infrastructure hacking in the witching hours!</p>
<p><img style=' display: block; margin-right: auto; margin-left: auto;'  class="aligncenter size-full wp-image-1434" title="nginx vs. apache: open/sending" src="/wp-content/uploads/2009/04/nginx-vs-apache-open.png" alt="nginx vs. apache: open/sending" width="481" height="179" /></p>
<p>The problem with Apache processes is that they&#8217;re big: they chug a <em>lot</em> of memory, and take a long time to get started. Sure, Apache includes a number of slightly more modern process models than the traditional prefork MPM, unfortunately (and predictably enough), PHP keeps us mired in the land of suckage. So when it comes to memory abuse, I was delighted with the results of putting nginx in front of Apache, and giving it complete responsibility for static files:</p>
<p><img style=' display: block; margin-right: auto; margin-left: auto;'  class="aligncenter size-full wp-image-1433" title="nginx vs. apache: memory" src="/wp-content/uploads/2009/04/nginx-vs-apache-memory.png" alt="nginx vs. apache: memory" width="497" height="221" /></p>
<p>Reduced memory usage, increased capacity for OS level disk caching, and of course, consistency. Consistency wins every time. Any sysadmin who has had to react to a sudden change in usage patterns will grok the importance of consistency &#8212; after all, it&#8217;s not being slashdotted or dugg that will kill you, it&#8217;s the hardware and software configuration designed for your everyday load.</p>
<p>That&#8217;s all very good for Mr. Server Administrator, but nothing is truly measured until we understand the impact on users. Friday lunch time? Business as usual&#8230;</p>
<p><img style=' display: block; margin-right: auto; margin-left: auto;'  class="aligncenter size-full wp-image-1435" title="nginx vs. apache: traffic" src="/wp-content/uploads/2009/04/nginx-vs-apache-traffic.png" alt="nginx vs. apache: traffic" width="497" height="193" /></p>
<p>&#8230; maaaaybe just a little quicker if they were paying attention. Not that you can tell from this chart. <img width='16' height='16' src='http://bethesignal.org/wp-content/plugins/tango-smilies/tango/face-wink.png' alt=';-)' class='wp-smiley' /> </p>
<p>So, I&#8217;m pretty happy with nginx sitting in front of Apache. It totally changes the performance characteristics of the server (and website!) for the better, while allowing me to fall back on somewhat more mature and extensive Apache features when I need to. For instance, nginx&#8217;s rewrite module is pretty good, but Apache&#8217;s mod_rewrite is truly the original and the best (read: most insane). Surprisingly, nginx doesn&#8217;t support old school CGI, but I suppose most of the cool kids using it are opting for better process models such as FastCGI and proxied application servers anyway.</p>
<p>The biggest win in this instance was the conversion of a caching mod_proxy frontend &#8212; lot of static files, inefficiently served by Apache &#8212; to the new, inbuilt caching module in nginx 0.7. Initially I had tried the apparently popular ncache &#8212; must be a lot of people talking about it hypothetically, methinks &#8212; but it is probably best described as an &#8220;out-of-tree design, configuration and implementation fail&#8221;. Once I sucked up the fear-of-trunk and tried the caching support in nginx 0.7, there was no looking back.</p>
<p>(Finally, a quick shout-out for <a href="http://collectd.org/">collectd</a> 4.6.2 and the relatively new collection3 web frontend for it&#8230; sadly, I switched to it after these charts were saved, so you don&#8217;t get to see the new hotness. Maybe you should try it on <em>your</em> server?)</p>
]]></content:encoded>
			<wfw:commentRss>http://bethesignal.org/blog/2009/04/06/replacing-apache-with-nginx-for-static-file-serving/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Case-insensitive mapping with mod_rewrite&#8217;s RewriteMap</title>
		<link>http://bethesignal.org/blog/2009/03/29/case-insensitive-mapping-with-mod_rewrites-rewritemap/</link>
		<comments>http://bethesignal.org/blog/2009/03/29/case-insensitive-mapping-with-mod_rewrites-rewritemap/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 16:40:37 +0000</pubDate>
		<dc:creator>Jeff Waugh</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[case-insensitive]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[rewritecond]]></category>
		<category><![CDATA[rewritemap]]></category>
		<category><![CDATA[rewriterule]]></category>

		<guid isPermaLink="false">http://bethesignal.org/?p=1425</guid>
		<description><![CDATA[Sometimes when you need to manage a massive pile of URL redirections &#8212; for instance, when you&#8217;re playing snatch-the-tablecloth with your web platform &#8212; it&#8217;s handy to mash them all together with mod_rewrite&#8217;s RewriteMap feature. I hit a frustrating stumbling &#8230; <a href="http://bethesignal.org/blog/2009/03/29/case-insensitive-mapping-with-mod_rewrites-rewritemap/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Sometimes when you need to manage a massive pile of URL redirections &#8212; for instance, when you&#8217;re playing snatch-the-tablecloth with your web platform &#8212; it&#8217;s handy to mash them all together with mod_rewrite&#8217;s RewriteMap feature.</p>
<p>I hit a frustrating stumbling block with a recent project, however: What happens if you need your RewriteMap key to be case-insensitive? This is incredibly likely if you&#8217;re migrating away from an undisciplined Windows-based web platform.</p>
<p>It was immediately obvious that I&#8217;d have to match against consistent casing, but not at all obvious how this would work in the context of mod_rewrite. After some trial and error, here&#8217;s what I came up with:</p>
<pre>RewriteMap lowercase int:tolower
RewriteMap urls dbm:/srv/www.example.com/urls.db
RewriteCond %{REQUEST_URI} ^(/.*\.html)$
RewriteCond ${lowercase:%1} ^(/.*\.html)$
RewriteCond ${urls:%1|NOT_FOUND} !NOT_FOUND
RewriteRule ^(/.*\.html)$ http://%{HTTP_HOST}${urls:%1}? [R=permanent,L]</pre>
<p>Here&#8217;s how it works:</p>
<ol>
<li>First we set up the built in lowercase translation rewrite map&#8230; handy!</li>
<li>Then we define our great big URL map, which is just a list of lowercase URLs (yes, they&#8217;re lowercased in the file) and their destinations.</li>
<li>Make sure we&#8217;re only mucking around with html URLs, but also grab the REQUEST_URI for use further along (see the parentheses in the second parameter).</li>
<li>We use Apache&#8217;s handy internal lowercase map to convert the previous line&#8217;s match to lowercase, and we grab the whole thing again&#8230; but this time, what we&#8217;re grabbing is the output of the lowercase map.</li>
<li>Tricky little hack to make sure our URL is represented in the redirection map. If there&#8217;s no match, the default value returned is NOT_FOUND&#8230; but we only continue to the next line if the map does <em>not</em> return NOT_FOUND.</li>
<li>Finally, permanently redirect to the destination URL, as matched against the lowercase original.</li>
</ol>
<p>Rock and roll.</p>
]]></content:encoded>
			<wfw:commentRss>http://bethesignal.org/blog/2009/03/29/case-insensitive-mapping-with-mod_rewrites-rewritemap/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>GNOME in MarkMail</title>
		<link>http://bethesignal.org/blog/2008/04/08/gnome-in-markmail/</link>
		<comments>http://bethesignal.org/blog/2008/04/08/gnome-in-markmail/#comments</comments>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<dc:creator>Jeff Waugh</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[history]]></category>
		<category><![CDATA[jason hunter]]></category>
		<category><![CDATA[mailing lists]]></category>
		<category><![CDATA[markmail]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://bethesignal.org/?p=1052</guid>
		<description><![CDATA[So when Tim O&#8217;Reilly pimped MarkMail a few weeks ago, with a post about their huge Perl mail archive import, I liked what I saw. But it wasn&#8217;t just that. I also wondered how much we kicked Perl&#8217;s arse. Or, &#8230; <a href="http://bethesignal.org/blog/2008/04/08/gnome-in-markmail/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So when Tim O&#8217;Reilly <a href="http://radar.oreilly.com/archives/2008/03/perl-mailing-lists-added-to-ma.html">pimped MarkMail</a> a few weeks ago, with a post about their <a href="http://markmail.blogspot.com/2008/03/loaded-perl-530000-emails.html">huge Perl mail archive import</a>, I liked what I saw.</p>
<p>But it wasn&#8217;t just that. I also wondered how much <a href="http://www.gnome.org/">we</a> kicked Perl&#8217;s arse. Or, put more diplomatically&#8230; I wondered what the difference might be between two large, mature FLOSS projects.</p>
<p>Of course, GNOME and Perl have very different structures, requirements and constituents, and there&#8217;s simply no point making comparisons with Apache&#8217;s&#8230; consortium of projects. <img width='16' height='16' src='http://bethesignal.org/wp-content/plugins/tango-smilies/tango/face-wink.png' alt=';-)' class='wp-smiley' /> </p>
<p>More seriously, I really liked the visualisation, interface and rich querying capabilities. The attention to detail to these issues makes MarkMail the #1 mail archive site I&#8217;ve seen.</p>
<p>Thanks to Jason Hunter at Mark Logic, we now have a full import of the <a href="http://gnome.markmail.org/">GNOME mailing list archives to play with in MarkMail</a>. Enjoy!</p>
<p align="center" class="center"><a href="http://gnome.markmail.org/"><img src="http://bethesignal.org/wp-content/uploads/2008/04/gnome-in-markmail.png" alt="" title="GNOME in MarkMail" width="500" height="163" class="alignnone size-full wp-image-1053" /></a></p>
<p><strong>Update:</strong> Jason has <a href="http://markmail.blogspot.com/2008/04/loaded-gnome-750000-emails.html">announced</a> the loading of 750,000 GNOME mailing list archive emails. Rock on!</p>
]]></content:encoded>
			<wfw:commentRss>http://bethesignal.org/blog/2008/04/08/gnome-in-markmail/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

