<?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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Nginx, IMO</title>
	<atom:link href="http://cwells.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://cwells.net</link>
	<description>Of course it&#039;s just my opinion. I&#039;m here to make it yours.</description>
	<lastBuildDate>Fri, 08 Mar 2013 20:07:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='cwells.net' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/36f52c35156f5a162edde4797ec29d9b?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Nginx, IMO</title>
		<link>http://cwells.net</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://cwells.net/osd.xml" title="Nginx, IMO" />
	<atom:link rel='hub' href='http://cwells.net/?pushpress=hub'/>
		<item>
		<title>Nginx, uWSGI and WsgiDAV</title>
		<link>http://cwells.net/2012/05/02/nginx-uwsgi-and-wsgidav/</link>
		<comments>http://cwells.net/2012/05/02/nginx-uwsgi-and-wsgidav/#comments</comments>
		<pubDate>Thu, 03 May 2012 05:27:41 +0000</pubDate>
		<dc:creator>wellsc</dc:creator>
				<category><![CDATA[Nginx]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[uwsgi]]></category>
		<category><![CDATA[webdav]]></category>
		<category><![CDATA[wsgidav]]></category>

		<guid isPermaLink="false">http://cwells.net/?p=140</guid>
		<description><![CDATA[Ran through this tonight. WSGI isn&#8217;t the prettiest thing on earth and the uWSGI docs don&#8217;t help clarify it much.  I&#8217;m sure some stuff here could be simplified a bit, &#8230; <a href="http://cwells.net/2012/05/02/nginx-uwsgi-and-wsgidav/" class="read-more">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cwells.net&#038;blog=34292657&#038;post=140&#038;subd=cwellsdotnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Ran through this tonight. WSGI isn&#8217;t the prettiest thing on earth and the uWSGI docs don&#8217;t help clarify it much.  I&#8217;m sure some stuff here could be simplified a bit, but given my final test results, I doubt I&#8217;d actually use this setup anyway.  Nevertheless, in the interest of providing search results for anyone looking for &#8220;nginx uwsgi wsgidav&#8221; (i.e. me, earlier tonight), here it is.</p>
<p>First, install system dependencies (you need to be root):</p>
<pre># sudo su -
# apt-get install build-essential python-dev libxml2-dev python-pip lxml</pre>
<p>Next, install Python dependencies (don&#8217;t install via apt-get as the versions are too old):</p>
<pre># pip install wsgidav
# pip install uwsgi</pre>
<p>Next, let&#8217;s setup our directory hierarchy and a test file:</p>
<pre># mkdir -p /var/www/dav/server &amp;&amp; mkdir -p /var/www/dav/data
# echo "hi there" &gt; /var/www/dav/data/test.txt</pre>
<p>Now we need to create our WebDAV app.  Create a file named /var/www/dav/server/dav.py:</p>
<pre>#!/usr/bin/python
from wsgidav.version import __version__
from wsgidav.wsgidav_app import DEFAULT_CONFIG, WsgiDAVApp

config = DEFAULT_CONFIG.copy ()
config.update ({
 "provider_mapping": { "/": r"/var/www/dav/data" },
 "user_mapping": { '/': { 'cliff': { 'password': 'secret', 'description': '', 'roles': [] } } },
 "verbose": 1,
 "enable_loggers": [],
 "propsmanager": True, # True: use property_manager.PropertyManager 
 "locksmanager": True, # True: use lock_manager.LockManager 
 "domaincontroller": None, # None: domain_controller.WsgiDAVDomainController(user_mapping)
})

app = WsgiDAVApp (config)</pre>
<p>Now, we need our uWSGI configuration file.  Create a file /var/www/dav/server/dav.ini:</p>
<pre>[uwsgi]
socket = 127.0.0.1:3031
master = true
processes = 4</pre>
<p>Next, we need an Nginx configuration.  Create the file /etc/nginx/sites-enabled/dav.conf:</p>
<pre>server {
    listen 80;
    server_name _;
    access_log /var/log/nginx/dav.access.log;
    error_log /var/log/nginx/dav.error.log;
    keepalive_timeout 70;
    client_max_body_size 2G;
    client_body_buffer_size 1M;

    location / {
        include uwsgi_params;
        uwsgi_param UWSGI_SCRIPT dav:app;
        uwsgi_param SCRIPT_NAME /;
        uwsgi_pass 127.0.0.1:3031;
    }
}</pre>
<p>Finally, restart Nginx and start uWSGI server:</p>
<pre># service nginx restart
# cd /var/www/dav/server ; uwsgi --ini dav.ini</pre>
<p>Point your WebDAV client to dav://localhost/ and see your files.</p>
<p>In my unscientific, ad-hoc tests, I was able to copy a 400MB video (using Nautilus/GVFS) to the DAV share at a rate of about 45MB/s on my laptop.  A 1.6GB file was just as fast up until about 1.1GB of the way in, at which point I&#8217;m guessing Linux ran out of buffers and my disk started thrashing. Given that this was on localhost, my disk was almost certainly the bottleneck.  Some optimization is certainly called for as Nginx would be buffering the body to temp files, so the file gets read and written twice, all to the same disk.  Streaming that same video showed uwsgi and nginx using almost no CPU or RAM.  Overall, WsgiDAV performed admirably and I received no errors during my testing (copy, delete, rename, etc).</p>
<p>I have to admit that at the end of all of this, I feel that using, e.g. gunicorn to serve the WSGI app (you can use the same one as above) and Nginx in HTTP proxy mode would provide equivalent performance in this case (little HTTP parsing), and is certainly much simpler to configure and understand.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cwellsdotnet.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cwellsdotnet.wordpress.com/140/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cwells.net&#038;blog=34292657&#038;post=140&#038;subd=cwellsdotnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cwells.net/2012/05/02/nginx-uwsgi-and-wsgidav/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://cwellsdotnet.files.wordpress.com/2012/03/uwsgi.png?w=150" />
		<media:content url="http://cwellsdotnet.files.wordpress.com/2012/03/uwsgi.png?w=150" medium="image">
			<media:title type="html">uWSGI</media:title>
		</media:content>

		<media:content url="http://2.gravatar.com/avatar/2e321cc0efe9422d37165e922298494e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wellsc</media:title>
		</media:content>
	</item>
		<item>
		<title>What features are missing in Nginx?</title>
		<link>http://cwells.net/2012/03/27/what-features-are-missing-in-nginx/</link>
		<comments>http://cwells.net/2012/03/27/what-features-are-missing-in-nginx/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 23:35:10 +0000</pubDate>
		<dc:creator>wellsc</dc:creator>
				<category><![CDATA[Nginx]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[poll]]></category>

		<guid isPermaLink="false">http://cwells.net/?p=112</guid>
		<description><![CDATA[Take a minute and vote!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cwells.net&#038;blog=34292657&#038;post=112&#038;subd=cwellsdotnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Take a minute and vote!</p>
<a name="pd_a_6084611"></a>
<div class="PDS_Poll" id="PDI_container6084611" data-settings="{&quot;url&quot;:&quot;http:\/\/static.polldaddy.com\/p\/6084611.js&quot;}" style="display:inline-block;"></div>
<div id="PD_superContainer"></div>
<noscript><a href="http://polldaddy.com/poll/6084611">Take Our Poll</a></noscript>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cwellsdotnet.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cwellsdotnet.wordpress.com/112/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cwells.net&#038;blog=34292657&#038;post=112&#038;subd=cwellsdotnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cwells.net/2012/03/27/what-features-are-missing-in-nginx/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:thumbnail url="http://cwellsdotnet.files.wordpress.com/2012/03/nginx-wp-logo.png?w=150" />
		<media:content url="http://cwellsdotnet.files.wordpress.com/2012/03/nginx-wp-logo.png?w=150" medium="image">
			<media:title type="html">nginx-wp-logo</media:title>
		</media:content>

		<media:content url="http://2.gravatar.com/avatar/2e321cc0efe9422d37165e922298494e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wellsc</media:title>
		</media:content>
	</item>
		<item>
		<title>How I &#8220;discovered&#8221; Nginx</title>
		<link>http://cwells.net/2012/03/27/how-i-discovered-nginx-3/</link>
		<comments>http://cwells.net/2012/03/27/how-i-discovered-nginx-3/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 22:51:38 +0000</pubDate>
		<dc:creator>wellsc</dc:creator>
				<category><![CDATA[Nginx]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://cwells.net/?p=101</guid>
		<description><![CDATA[I&#8217;ve been using Nginx since the early days. Prior to that, I&#8217;d used Apache, Lighttpd, and Pound as solutions for my webserver stack. This is an old story, but it &#8230; <a href="http://cwells.net/2012/03/27/how-i-discovered-nginx-3/" class="read-more">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cwells.net&#038;blog=34292657&#038;post=101&#038;subd=cwellsdotnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been using Nginx since the early days. Prior to that, I&#8217;d used Apache, Lighttpd, and Pound as solutions for my webserver stack. This is an old story, but it remains remarkably relevant six years later.</p>
<p>In August of 2006, Bob Ippolito replied to a discussion between myself and another person about whether to use Pound or Lighttpd as a reverse-proxy in front of TurboGears applications. I held that Pound is the correct solution as it is a proxy, whereas Lighttpd is a web server that can act as one. Further, I expressed my frustration regarding the state of Lighttpd development and the unmaintainability of its config files.</p>
<p>Bob offered up the following information:</p>
<blockquote><p>One problem with Lighty is that it leaks memory like a sieve [1]. I audited it for a little bit and I gave up, it&#8217;s a mess. I&#8217;d steer clear of it, it will quickly ruin your day if you throw a lot of traffic at it.</p>
<p>The only solution I know of that&#8217;s extremely high performance that offers all of the features that you want is nginx [2], but its documentation is largely in Russian. I can&#8217;t read Russian, but I was able to figure it out (the configuration language isn&#8217;t Russian, neither is C source). I currently have nginx doing reverse proxy of over tens of millions of HTTP requests per day (thats a few hundred per second) on a *single server*. At peak load it uses about 15MB RAM and 10% CPU on my particular configuration (FreeBSD 6).</p>
<p>Under the same kind of load, apache falls over (after using 1000 or so processes and god knows how much RAM), pound falls over (too many threads, and using 400MB+ of RAM for all the thread stacks), and lighty *leaks* more than 20MB per hour (and uses more CPU, but not significantly more).</p>
<p>[1] <a href="http://trac.lighttpd.net/trac/ticket/758" rel="nofollow">http://trac.lighttpd.net/trac/ticket/758</a><br />
[2] <a href="http://sysoev.ru/en/" rel="nofollow">http://sysoev.ru/en/</a></p></blockquote>
<p>The main thing that&#8217;s changed between then and now is that Nginx now has extensive English documentation.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cwellsdotnet.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cwellsdotnet.wordpress.com/101/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cwells.net&#038;blog=34292657&#038;post=101&#038;subd=cwellsdotnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cwells.net/2012/03/27/how-i-discovered-nginx-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://cwellsdotnet.files.wordpress.com/2012/03/nginx-wp-logo.png?w=150" />
		<media:content url="http://cwellsdotnet.files.wordpress.com/2012/03/nginx-wp-logo.png?w=150" medium="image">
			<media:title type="html">nginx-wp-logo</media:title>
		</media:content>

		<media:content url="http://2.gravatar.com/avatar/2e321cc0efe9422d37165e922298494e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wellsc</media:title>
		</media:content>
	</item>
		<item>
		<title>uWSGI 1.1</title>
		<link>http://cwells.net/2012/03/27/uwsgi-1-1/</link>
		<comments>http://cwells.net/2012/03/27/uwsgi-1-1/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 22:28:06 +0000</pubDate>
		<dc:creator>wellsc</dc:creator>
				<category><![CDATA[Nginx]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[uwsgi]]></category>

		<guid isPermaLink="false">http://cwells.net/?p=93</guid>
		<description><![CDATA[This release focuses on a new option parser subsystem, improved perl/psgi and ruby/rack support and a new (stable) php plugin. A lot of optimizations have been introduced for the fastrouter and the &#8230; <a href="http://cwells.net/2012/03/27/uwsgi-1-1/" class="read-more">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cwells.net&#038;blog=34292657&#038;post=93&#038;subd=cwellsdotnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>This release focuses on a new option parser subsystem, improved perl/psgi and ruby/rack support and a new (stable) php plugin. A lot of optimizations have been introduced for the fastrouter and the various threading modes.</p>
<p>You can visit the <a href="http://projects.unbit.it/uwsgi/" target="_blank">uWSGI homepage</a> to learn more.</p>
<p>The uWSGI protocol is directly supported in Nginx since 0.8.4.  You can find instructions for running your application under uWSGI <a href="http://projects.unbit.it/uwsgi/wiki/RunOnNginx" target="_blank">here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cwellsdotnet.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cwellsdotnet.wordpress.com/93/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cwells.net&#038;blog=34292657&#038;post=93&#038;subd=cwellsdotnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cwells.net/2012/03/27/uwsgi-1-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://cwellsdotnet.files.wordpress.com/2012/03/uwsgi.png?w=150" />
		<media:content url="http://cwellsdotnet.files.wordpress.com/2012/03/uwsgi.png?w=150" medium="image">
			<media:title type="html">uWSGI</media:title>
		</media:content>

		<media:content url="http://2.gravatar.com/avatar/2e321cc0efe9422d37165e922298494e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wellsc</media:title>
		</media:content>
	</item>
		<item>
		<title>ngx_supervisord 1.4</title>
		<link>http://cwells.net/2012/03/27/frickle-labs-megiteam-present-ngx_supervisord/</link>
		<comments>http://cwells.net/2012/03/27/frickle-labs-megiteam-present-ngx_supervisord/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 21:32:12 +0000</pubDate>
		<dc:creator>wellsc</dc:creator>
				<category><![CDATA[Nginx]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[supervisord]]></category>

		<guid isPermaLink="false">http://cwells.net/?p=76</guid>
		<description><![CDATA[FRiCKLE Labs and MegiTeam have released version 1.4 of ngx_supervisord, which provides Nginx with an API for communicating with supervisord.  This provides some nice features like auto-starting backend services on &#8230; <a href="http://cwells.net/2012/03/27/frickle-labs-megiteam-present-ngx_supervisord/" class="read-more">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cwells.net&#038;blog=34292657&#038;post=76&#038;subd=cwellsdotnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://labs.frickle.com/" target="_blank">FRiCKLE Labs</a> and <a href="http://www.megiteam.pl/" target="_blank">MegiTeam</a> have released version 1.4 of ngx_supervisord, which provides Nginx with an API for communicating with<br />
<a href="http://supervisord.org/" target="_blank"> supervisord</a>.  This provides some nice features like auto-starting backend services on demand.</p>
<p>You can download and read more about it on the <a href="http://labs.frickle.com/nginx_ngx_supervisord/" target="_blank">ngx_supervisord  home page</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cwellsdotnet.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cwellsdotnet.wordpress.com/76/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cwells.net&#038;blog=34292657&#038;post=76&#038;subd=cwellsdotnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cwells.net/2012/03/27/frickle-labs-megiteam-present-ngx_supervisord/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://cwellsdotnet.files.wordpress.com/2012/03/supervisord2.jpg?w=150" />
		<media:content url="http://cwellsdotnet.files.wordpress.com/2012/03/supervisord2.jpg?w=150" medium="image">
			<media:title type="html">supervisord</media:title>
		</media:content>

		<media:content url="http://2.gravatar.com/avatar/2e321cc0efe9422d37165e922298494e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wellsc</media:title>
		</media:content>
	</item>
		<item>
		<title>Why doesn&#8217;t Nginx support .htaccess files?</title>
		<link>http://cwells.net/2012/03/27/why-doesnt-nginx-support-htaccess-files/</link>
		<comments>http://cwells.net/2012/03/27/why-doesnt-nginx-support-htaccess-files/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 21:12:08 +0000</pubDate>
		<dc:creator>wellsc</dc:creator>
				<category><![CDATA[Nginx]]></category>

		<guid isPermaLink="false">http://cwells.net/?p=71</guid>
		<description><![CDATA[This is a common question for people coming from Apache, especially if they are attempting to run software that relies heavily on them. The short answer is that .htaccess files &#8230; <a href="http://cwells.net/2012/03/27/why-doesnt-nginx-support-htaccess-files/" class="read-more">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cwells.net&#038;blog=34292657&#038;post=71&#038;subd=cwellsdotnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>This is a common question for people coming from Apache, especially if they are attempting to run software that relies heavily on them.</p>
<p>The short answer is that .htaccess files are a performance-killer and a primary goal of Nginx is speed.</p>
<p>The long answer requires an explanation of how Apache processes a site that uses .htaccess files.</p>
<p>Whenever Apache handles a request,   it first checks and processes any .htaccess file in the same directory as the file it is serving.  No surprises there.  Next Apache traverses all the parent directories of the current one.  For instance, if a visitor requests the URL <em>/pages/about.html </em>and your document root is <em>/var/www/htdocs/mysite</em>, this forces Apache to attempt to locate and process .htaccess files in all these directories:</p>
<pre>/
/var
/var/www
/var/www/htdocs
/var/www/htdocs/mysite/
/var/www/htdocs/mysite/pages</pre>
<p>It&#8217;s important to note that even if you don&#8217;t have any .htaccess files, Apache must still check all of these directories on every request to see if an .htaccess file has appeared since the last time it looked.  Some of this can be mitigated by careful use of the <em>AllowOverride</em> directive to only allow .htaccess processing in particular directories, but I doubt this is widely utilized and is only a partial solution in any case.</p>
<p>A second issue with .htaccess is that, while they are convenient to use, they are a rather hackish solution.  They spread configuration of a single site into a large hierarchy of files.  If you want to know what rewrite rules might affect a particular URL, you may end up looking at multiple files (including http.conf).</p>
<p>The final issue with .htaccess files is that they provide another attack vector that must be defended against.  Unlike httpd.conf or nginx.conf, .htaccess files live within the site&#8217;s home directory.  This means the barrier to overwriting one is much lower.  If someone can manage to overwrite a .htaccess file, the compromise can be <a href="http://www.justanotherhacker.com/2011/05/htaccess-based-attacks.html" target="_blank">quite extensive</a>.</p>
<p>At the end of the day, .htaccess provides a convenient shortcut for the lazy admin or developer, but also kills performance, makes configuration issues more difficult to track down, and opens yet another attack vector on your site.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cwellsdotnet.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cwellsdotnet.wordpress.com/71/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cwells.net&#038;blog=34292657&#038;post=71&#038;subd=cwellsdotnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cwells.net/2012/03/27/why-doesnt-nginx-support-htaccess-files/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:thumbnail url="http://cwellsdotnet.files.wordpress.com/2012/03/nginx-wp-logo.png?w=150" />
		<media:content url="http://cwellsdotnet.files.wordpress.com/2012/03/nginx-wp-logo.png?w=150" medium="image">
			<media:title type="html">nginx-wp-logo</media:title>
		</media:content>

		<media:content url="http://2.gravatar.com/avatar/2e321cc0efe9422d37165e922298494e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wellsc</media:title>
		</media:content>
	</item>
		<item>
		<title>The general purpose web server</title>
		<link>http://cwells.net/2012/03/27/the-general-purpose-http-server-9/</link>
		<comments>http://cwells.net/2012/03/27/the-general-purpose-http-server-9/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 18:00:51 +0000</pubDate>
		<dc:creator>wellsc</dc:creator>
				<category><![CDATA[Nginx]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://cwells.net/2012/03/27/the-general-purpose-http-server-9/</guid>
		<description><![CDATA[I&#8217;ve heard it said before that Apache is a &#8220;general purpose web server&#8221; and Nginx is for &#8220;specialized applications&#8221;.  This meme was repeated recently by Jim Jagielski, president of the Apache Software &#8230; <a href="http://cwells.net/2012/03/27/the-general-purpose-http-server-9/" class="read-more">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cwells.net&#038;blog=34292657&#038;post=47&#038;subd=cwellsdotnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve heard it said before that Apache is a &#8220;general purpose web server&#8221; and Nginx is for &#8220;specialized applications&#8221;.  This meme was <a title="repeated recently" href="http://www.readwriteweb.com/cloud/2012/02/apache-24-sets-sights-on-cloud.php" target="_blank">repeated</a> recently by Jim Jagielski, president of the Apache Software Foundation.</p>
<p>I believe the idea that Apache is &#8220;general purpose&#8221; and Nginx is &#8220;specialized&#8221; boils down to the following idea: Apache has hundreds of modules that enable additional functionality, whereas Nginx focuses on the core functionality of the web.  The definition of <em>general purpose</em> is <em>&#8220;designed for or suitable to more than one use; broadly useful&#8221;</em>.  It seems that Apache fits this bill quite well. But what about labeling Nginx as &#8221;specialized&#8221;?  The definition of <em></em><em> </em><em>specialized</em> is <em>&#8220;concentrating on a small area of a subject&#8221;</em>.  I think this is where I have to disagree.  Nginx is an HTTP server.  It does not cover &#8220;a small area&#8221; of the HTTP protocol, nor does it somehow fail to provide all the features an HTTP server is expected to.  In fact, it provides quite a few features that lie outside that scope (AJP, uWSGI, etc).</p>
<p>To me, &#8220;general purpose&#8221; means the opposite of &#8220;specialized&#8221;.  Is Apache&#8217;s mod_svn general purpose, or is it specialized?  Obviously, it&#8217;s specialized.  Even mod_php is specialized, since it is a feature to enable a single programming language.  In the domain of an HTTP server, general purpose features would be things like serving static files, HTTP proxying, FastCGI support, etc.  So Apache&#8217;s multitude of modules don&#8217;t necessarily make it <em>general purpose</em>, they make it easy to <em>specialize</em> Apache in various ways.</p>
<p>Apache certainly <em>contains</em> a general purpose <em>web</em> server, but that server is functionally equivalent to Nginx. If this were the end of the story, then Apache would seem to be the clear winner, since it also provides the ability to specialize in a hundred different ways via modules.  Unfortunately, the general purpose web server that Apache contains is far less efficient than the one Nginx provides.  So this brings us to the question: if you need a general purpose web server, and <em>don&#8217;t need to specialize</em>, which is preferable?  A server that makes highly efficient use of resources, or one that doesn&#8217;t?  Is a HTTP server that focuses on specialization at the expense of core HTTP performance truly &#8220;general purpose&#8221;? Is a knife that features a spatula and a corkscrew, but has an inferior blade more &#8220;general purpose&#8221; than a traditional knife with a fully functional blade, or is it &#8220;specialized&#8221;?</p>
<p>If I need to host a Subversion repository, Apache would seem to be the best answer.  If I need to host a <em>website</em>, I cannot think of a single reason why I would choose Apache over Nginx.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cwellsdotnet.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cwellsdotnet.wordpress.com/47/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cwells.net&#038;blog=34292657&#038;post=47&#038;subd=cwellsdotnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cwells.net/2012/03/27/the-general-purpose-http-server-9/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://cwellsdotnet.files.wordpress.com/2012/03/giant-swiss1.jpg?w=150" />
		<media:content url="http://cwellsdotnet.files.wordpress.com/2012/03/giant-swiss1.jpg?w=150" medium="image">
			<media:title type="html">giant-swiss</media:title>
		</media:content>

		<media:content url="http://2.gravatar.com/avatar/2e321cc0efe9422d37165e922298494e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wellsc</media:title>
		</media:content>
	</item>
		<item>
		<title>Apache 2.4 &#8211; fast or fastest?</title>
		<link>http://cwells.net/2012/03/26/apache-2-4/</link>
		<comments>http://cwells.net/2012/03/26/apache-2-4/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 01:42:41 +0000</pubDate>
		<dc:creator>wellsc</dc:creator>
				<category><![CDATA[Nginx]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[benchmarks]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://cwells.net/?p=9</guid>
		<description><![CDATA[The world is sort of abuzz with talk of Apache 2.4, the first major release of the venerable open source HTTP server in years.  Okay, not really so much buzz. &#8230; <a href="http://cwells.net/2012/03/26/apache-2-4/" class="read-more">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cwells.net&#038;blog=34292657&#038;post=9&#038;subd=cwellsdotnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>The world is sort of abuzz with talk of Apache 2.4, the first major release of the venerable open source HTTP server in years.  Okay, not really so much buzz.  I really thought there would be more excitement.  But still, the Apache Foundation has been making <a title="press" href="http://www.readwriteweb.com/cloud/2012/02/apache-24-sets-sights-on-cloud.php" target="_blank">press</a> <a title="releases" href="http://arstechnica.com/business/news/2012/02/apache-devs-release-version-24-first-major-update-in-six-years.ars" target="_blank">releases</a> <a title="everywhere" href="http://www.serverwatch.com/server-news/apache-2.4-delivers-more-performance.html" target="_blank">everywhere</a> and they&#8217;ve got some claims that stretch my credulity just a bit.</p>
<p>First and foremost, they are making plenty of noise about how 2.4 puts Apache on par with Nginx in terms of speed.  First off, I&#8217;ve never thought Apache was particularly slow.  What I <em>have</em> thought about Apache is that it consumes a metric ton of RAM as it spawns threads like spiders on LSD and <em>running out of RAM makes Apache slow</em>. Now, this isn&#8217;t really Apache&#8217;s fault: you should have bought more RAM.   Anyway, it&#8217;s always possible that 2.4 is teh awesome, so I went in search of the benchmarks the Apache Foundation and its members would undoubtedly be flooding the internet with (they did do benchmarks during testing, right?). I could only find <a title="one" href="https://people.apache.org/~jim/presos/ACNA11/Apache_httpd_cloud.pdf" target="_blank">one</a>, and it&#8217;s not terribly impressive. In fact, it rates amongst the poorest examples of benchmarking HTTP servers that I can imagine.  Here&#8217;s the issues I see right off the bat:</p>
<p><strong><em>1) No signiﬁcant “tuning” efforts (out of the box conﬁgs)</em></strong></p>
<p>While this sounds reasonable (hey, who configures server software?), with Nginx, the default configuration ships with <em>worker_processes 1;</em> What this means is that no matter how many CPU cores your system has, Nginx will use one of them.  Now, I&#8217;ll grant you, changing this number to something like &#8220;2&#8243; sounds an awful lot like tuning, but for Nginx this is part of the standard configuration, not quasi-black-art tuning options like Apache&#8217;s <em>MaxClients, MinSpareThreads, MaxSpareThreads, ThreadsPerChild </em>and friends.</p>
<p>Anyway, the slides don&#8217;t specify how many cores were available, or if they changed this value for Nginx, but assuming a modern CPU and taking the slides at face value, I&#8217;d have to come away with the conclusion that Apache was using <em>at least four cores</em> and Nginx <em>only one</em>.  Not off to a good start here, since both servers were essentially performing on par with each other.</p>
<p><em><strong>2) Where&#8217;s the utilization graphs?</strong></em></p>
<p>The entire benchmark consists of how fast requests are being served.  A decent job is done, as we are shown various metrics on how Apache and Nginx perform under various loads.  The problem is we aren&#8217;t shown how much CPU, memory, etc, are used by each server. This is important as it would reveal whether or not either server was pushing the system to its limits.  Given past experience and other people&#8217;s testing, I&#8217;d venture that Apache was utilizing most of the 1GB of RAM and 90% of the four cores while Nginx used only 20MB of RAM and 20% of one core.  Of course, that&#8217;s only speculation, but hey, benchmarks are supposed to clear up speculation, not create more.</p>
<p><strong><em>3) Caveat emptor</em></strong></p>
<p>In the section &#8220;Main Caveats&#8221;, it is noted without any sense of irony that <em>&#8220;Apache is never resource starved&#8221;</em>.  This is the bit that irks me the most. Like most people, I didn&#8217;t start using Nginx because of some inability to discover that 75% of the web runs on Apache.  I started using Nginx because Apache was difficult to tune in such a way that it wouldn&#8217;t fall over when resources became thin. So testing these servers <em>to the brink of destruction</em> is the main thing I would have liked to have seen tested.  Really.  I don&#8217;t give a damn how Apache or Nginx perform when they have unlimited resources and traffic is exactly the amount I predicted when I installed the DIMMs, I care how they perform when those resources get scarce.</p>
<p>When memory and CPU become scarce, any server will become slower.  Nginx will get slower, Apache will get slower.  No mysteries here.  The problem with Apache is that consumes a large amount of RAM to handle each request.  If memory is tight, it will eventually send the VM into swap.  This will further slow the system.  If this weren&#8217;t bad enough, a slower system means that each request will &#8220;live&#8221; longer, since it takes longer to process.  This means using more RAM for longer.  Unless traffic suddenly lets off, this is usually the beginning of the end for an Apache server.</p>
<p>Now, 2.4 might address this problem, but the apparent lack of willingness on the part of the Apache folks to even discuss it (except in vague, hand-wavy marketing talk) leaves me doubtful.</p>
<p>Anyway, I&#8217;m hoping to create a test setup around here <em>real soon now</em> to do some real benchmarks.  Stay tuned.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cwellsdotnet.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cwellsdotnet.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cwells.net&#038;blog=34292657&#038;post=9&#038;subd=cwellsdotnet&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cwells.net/2012/03/26/apache-2-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:thumbnail url="http://cwellsdotnet.files.wordpress.com/2012/03/blowing-feather.jpg?w=150" />
		<media:content url="http://cwellsdotnet.files.wordpress.com/2012/03/blowing-feather.jpg?w=150" medium="image">
			<media:title type="html">blowing-feather</media:title>
		</media:content>

		<media:content url="http://2.gravatar.com/avatar/2e321cc0efe9422d37165e922298494e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">wellsc</media:title>
		</media:content>
	</item>
	</channel>
</rss>
