Computer
Computer Diary
    RepRap


    "Yes, we scan."

    Barack Obama
    2013/06/30, USA

    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.

    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).



    All posts or individual posts:

  • MetaFS - Dealing With Metadata the Proper Way (2013/12/14 01:00)
  • My Cellphones & Smartphone (2010-2013) (2013/09/02 23:15)
  • KDE / Kubuntu 12.04: 10+ years terrible GUI, A Systemic Problem of OSS (2013/04/27 12:18)
  • UNIX Man on Windows 7: VirtualBox + Ubuntu + LXC (2012/11/27 19:24)
  • Metadata - The Unresolved Mess (2012/07/10 20:59)
  • Cellphone Networks: Thieves, Insanity & Crap (2010/01/26 13:57)
  • MacOS-X for a UNIX Man with a PC (2009/09/26 20:43)
  • Windows XP for a UNIX Man (2009/09/22 18:28)
  • Server Counting (2009/05/18 11:50)
  • Automatically Geotag Photos without GPS (2009/04/22 08:28)
  • Rebirth of FastCGI (2009/04/15 17:17)
  • Online Advertisement & Income for Web-Site Owners (2009/03/18 22:10)
  • iPhone JavaScript Frameworks (aka Avoiding Objective-C) (2009/03/14 22:08)
  • Google - The Almighty Tracker & Advertising Blocking (2009/03/12 22:09)
  • How To Save 300MB RAM (2009/03/07 22:07)
  • Verbosity of Programming Languages (2009/03/06 22:06)
  • Problems with MacOSX (2009/03/03 22:03)
  • MacOSX: My First Steps (2009/02/24 09:57)
  • Catch 22 with HDD/DVD Recorder Medion Life (2009/02/24 09:27)
  • Kubuntu 8.1 as guest on VirtualBox MacOSX host (2009/02/24 01:33)
  • VirtualBox vs VMWare Fusion on MacOSX (2009/02/24 01:19)
  • SQL vs GREP with 230K lines (12MB) GeoLite (2009/02/23 20:10)
  • Kubuntu 8.1: Eye-Candy & Memory Waste (2009/01/24 09:57)
  • Firefox 2.0.x / 3.0.x - Memory Waste (2009/01/22 19:34)


    [ 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