<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
  <link>http://mikewatkins.ca/tags/debian/</link>
  <atom:link href="http://mikewatkins.ca/tags/debian/feeds/rss" type="application/rss+xml" rel="self"/>
  <lastBuildDate>Wed, 11 Mar 2009 03:03:38 GMT</lastBuildDate>
  <title>mike watkins dot ca</title>
  <description>XML Feed for mike watkins dot ca</description>
  <language>en</language>
  <generator>Parlez/0.1</generator>
<item>
  <title>Reducing RAM resource usage on a VPS</title>
  <link>http://mikewatkins.ca/2009/03/10/reducing-ram-resource-usage-on-a-vps/</link>
  <description><![CDATA[
<div class="document">
<p>Here are some miscellaneous notes as I tweak a new virtual private server (VPS). It's a time of fear and wonder as I'm leaving FreeBSD's ample and soft bosom for the as yet unknown pleasures to be found in the arms of my new Debian lover.</p>
<dl class="docutils">
<dt>HTTP Daemon:</dt>
<dd><p class="first">Problem? I think it's self evident.  Yes, I know you can tune Apache and yes, I've been down that road before myself, but nothing I've done to tune Apache beats a simple <tt class="docutils literal"><span class="pre">lighttpd</span></tt> implementation, at least not with my application stack.</p>
<p>Solution: Uninstall Apache. Install <tt class="docutils literal"><span class="pre">lighttpd</span></tt>.</p>
<p>As a bonus, <a class="reference external" href="http://www.lighttpd.net/">lighttpd</a> supports SCGI (and FCGI) natively (to my knowledge, another popular lightweight httpd - <a class="reference external" href="http://nginx.net/">nginx</a> - does not support SCGI natively although contribs are available) which gives you deployment options for a variety of <a class="reference external" href="http://www.djangoproject.com/">popular</a> and <a class="reference external" href="http://www.mems-exchange.org/software/qp/">not so popular</a> Python web application frameworks.</p>
<p>Incidentally, QP deployed with SCGI (whether via <tt class="docutils literal"><span class="pre">lighttpd</span></tt> or Apache <tt class="docutils literal"><span class="pre">httpd</span></tt>) provides a nice combo that would be compatible with a multi-user shared hosting environment.</p>
<p class="last">One of these days I'll get off my but and migrate my weblog over, and enable comments here in doing so, in order that I can satisfy a selfish desire to ask the <em>lazy web</em> if anyone has worked with a reasonable webmail application developed in Python. I'd really like to avoid supporting PHP in the future and at this point I only support PHP for a webmail application.</p>
</dd>
</dl>
<dl class="docutils">
<dt>rsyslogd</dt>
<dd><p class="first">This daemon appears to be the default system logging daemon on Debian; for some reason it uses many times more RAM than the default FreeBSD syslogd, even when it isn't actually doing any remote logging.</p>
<p class="last">Solution: Add a call to <tt class="docutils literal"><span class="pre">ulimit</span> <span class="pre">-s</span> <span class="pre">128</span></tt> in <tt class="docutils literal"><span class="pre">do_start()</span></tt> in <tt class="docutils literal"><span class="pre">/etc/init.d/rsyslog</span></tt> before the daemon is started to reduce the stack size.</p>
</dd>
<dt>DNS</dt>
<dd><p class="first"><tt class="docutils literal"><span class="pre">bind9</span></tt> is a huge monster, something not often needed for a VPS or dedicated server that might need to also be an authoritative name server for a few domains. I'm sure there is some tweaking that can be done to reduce its footprint (no threads?) but for a clean break lets try another.</p>
<p class="last">Solution: <a class="reference external" href="http://www.maradns.org/">MaraDNS</a>. Simple to configure (not that <tt class="docutils literal"><span class="pre">bind</span></tt> is all that hard, but some complain just the same), fast, and small. Config file uses Python syntax (n.b. use &quot;somevalue&quot; rather than single quotes 'some value').</p>
</dd>
</dl>
<p><strong>Total savings so far</strong>: 80 - 120MB (more if one factors in Apache), which is pretty substantial given many low end VPS accounts start at 64 - 128MB of RAM allocation.</p>
</div>

]]></description>
  <guid isPermaLink="false">tag:mikewatkins.ca,2007-10-10:journal:mw:entry:700</guid>
  <pubDate>Wed, 11 Mar 2009 03:03:38 GMT</pubDate>
  <category>debian</category>
  <category>python</category>
  <category>technical</category>
  <category>vps</category>
</item>
<item>
  <title>Time to Move, Random Observations</title>
  <link>http://mikewatkins.ca/2009/03/10/time-to-move-random-observations/</link>
  <description><![CDATA[
<div class="document">
<div class="section" id="looking-forward-to-python-3">
<h2>Looking Forward To Python 3</h2>
<p>In my <a class="reference external" href="http://mikewatkins.ca/rawtech.html">tech feed</a> today I noted Thomas Guest <a class="reference external" href="http://wordaligned.org/articles/perl-6-python-3">sticking to his new year commitment</a> to publish Python 3.x compatible <a class="reference external" href="http://wordaligned.org/articles/ordered-sublists-a-brute-force-approach">code examples</a>. I hope this becomes something of a meme and becomes more and more common in the <em>pythonosphere</em>.</p>
</div>
<div class="section" id="on-the-move">
<h2>On The Move</h2>
<p>I'm decommissioning an older server I have co-located in New Jersey so over  the next week or so I'll be moving my non-commercial sites and applications to a <a class="reference external" href="http://fsckvps.com/">Virtual Private Server</a> (VPS).  I'm hoping to deploy all apps on the VPS using &gt;= Python 3.1 (alpha, beta, released) alone.</p>
<p>Thanks to <a class="reference external" href="http://pypi.python.org/pypi?:action=browse&amp;c=533&amp;show=all">QP</a> having already been released on Python 3 this won't be terribly difficult although as most of the applications are document centric, a workaround for <tt class="docutils literal"><span class="pre">docutils</span></tt> is inevitable for the time being as much of the content on the pro bono sites and applications I host lives in ReST format.</p>
<p><a class="reference external" href="http://www.freewisdom.org/projects/python-markdown/">Markdown</a> (the freewisdom.org version, not the ActiveState produced <a class="reference external" href="http://code.google.com/p/python-markdown2/">markdown2</a> code) on the other hand is already more or less serviceable under Python 3 after some <a class="reference external" href="http://docs.python.org/library/2to3.html">2to3</a> incantations.</p>
</div>
<div class="section" id="debian-freebsd-but-enough">
<h2>Debian != FreeBSD but ~ Enough</h2>
<p>After many years of running a FreeBSD-only shop at home and at work this move has more or less forced me to gain some deeper Linux knowledge. In this case I elected to have the VPS decked out with Debian 5.</p>
<p>While it is refreshing to explore a new OS environment just to see the differences, I do miss FreeBSD on the box, particularly the FreeBSD ports system, and I'll no doubt continue to trip on on the file system <tt class="docutils literal"><span class="pre">hier</span></tt> differences but I'll live I guess.</p>
<p>One aspect of running a VPS as opposed to a dedicated server is that you tend to need to be more circumspect about RAM usage. The default install of <tt class="docutils literal"><span class="pre">bind9</span></tt> consumed a huge amount of ram which for what the VPS needs to deliver is just plain silly. So a query for &quot;python bind alternative&quot; drove me to choose another name daemon.</p>
<p><a class="reference external" href="http://www.maradns.org/">MaraDNS</a> turns out to be a nicely lightweight authoritative and recursive DNS that uses far less machine resources than <tt class="docutils literal"><span class="pre">bind</span></tt> does. It seems to be a good alternative for a box which needs to serve up a few dozen or hundred records rather than tens of thousands, and it might even be a good choice for the latter too.</p>
<p>The config file uses Python syntax but that's as far as the Python &quot;integration&quot; goes. I like its &quot;template&quot; and &quot;default&quot; approach; I had a fairly swift looking <tt class="docutils literal"><span class="pre">bind</span></tt> setup which used include files but the MaraDNS config is even simpler - one template file serves all. Nice.</p>
</div>
</div>

]]></description>
  <guid isPermaLink="false">tag:mikewatkins.ca,2007-10-10:journal:mw:entry:699</guid>
  <pubDate>Tue, 10 Mar 2009 20:20:37 GMT</pubDate>
  <category>debian</category>
  <category>freebsd</category>
  <category>python</category>
  <category>technical</category>
</item>
</channel></rss>
