Computer
Computer Diary
    RepRap


    "Our greatest fear is not that we are inadequate, but that we are powerful beyond measure."

    Marianne Williamson
    from her book "A Return To Love"

    Here my little rant and praise place, where the daily experiences of my programming work are expressed. I publish them with the idea that others might find it useful and benefit from it.

    Tag <NSD>

    Check also other posts with other tags.

    2009/03/07
    How To Save 300MB RAM
    last edited 2009/04/15 18:12 (*)

    Also known as "Goodbye Apache & Bind, Welcome Lighttpd & NSD" (GABWLN)

    I started to develop webpages at the time when Gopher was available, and Mosaic as first graphical browser was released. At the time the NCSA web-server was 'patched' and so the Apache.org took off. I developed most of my sites either using perl CGIs or mod_perl via handler() and some sophisticated converters to deliver HTML pages at the end. In other words, I was hoocked up to Apache early and I used it intensively for almost everything done for the web, no other options considered - but there is always a first time so to speak, this is happening now.

    The memory usage has been a concern for me the last years - in a nutshell: I kept using a 1GHz Celeron with 1GB RAM for the last 4 years, and noticed with every upgrade doing the same tasks, like browsing the web and programming, required up-to-date programs which themselves became more bloated, used memory and became slower . . . and nobody complained. How so? Most people upgrade to faster machine to do the same tasks with more bloated software having the same user experience in regards of responsiveness - the programs aren't faster, they are actually getting slower, just the machines we use get faster - not a good development. Anywyay.

    I had a bit outdated Linux/Debian based web-server with Apache 1.3.x and finally had to upgrade to Apache 2.x and so the memory footprint was increased significantly, over 190MB for the first process, yet, the subprocesses much less, but still. Anyway, I was looking for an alternative, and I found Lighttpd.net , and now I'm dropping Apache.org . . . goodbye.

    Lighttpd is a single process application, using 5MB memory - it supports CGI, even FastCGI (which I will look at again), virtual hosts, URL rewrite, and other "must-have" features I require - and I made a few tests, and most features I do need are there. So, I give it a try on my main server and see how it behaves.

    Further, I noticed named (bind9) and nscd, its dns cache, using up 80-90MB alone - incredible, just being a primary for a couple of domains I run? This is inacceptable - so I was looking for an alternative, and I found NSD . I was able to use most zone-files from bind, so the switch was roughly done quickly - the nsd uses 7MB memory . . .

    Update 2009/03/11: under Debian/(K)Ubuntu, package 'nsd' is version 2, in order to use up-to-date nsd version 3, install package nsd3 - in case you wonder why certain settings aren't possible

    Real progress for me is: do more with less.

    As said, unfortunately people do not realize the majority of programs, like web-browsers or text-processors, are using more memory, and are slower - and just due the upgrade to new hardware with faster CPUs and more memory this isn't noticed. A good example for such backwardness in software development is Microsoft with Vista, and it deserved to fail so miserable on the market - it was a good sign people didn't buy into advertising but paid close attention to the unbiased reviews.

    Update: If require to have recursive name resolving, e.g. serving a local domain plus resolving public domains, you may choose MaraDNS.org as NSD doesn't resolve recursively (yet).



    Check also other posts with other tags.


    [ post new entry ] (only for administators)

    Title:

    Text:

    Tags: (separated by commas)

    Date (optional):

    Password:
     


    .:.




    Copyright 2007-2016, 2020-2024 © by René K. Müller <spiritdude@gmail.com>
    Illustrations and graphics made with Inkscape, GIMP and Tgif