Pg 8.3 tuning recommendations for embedded low-memory device (for OLPC :-) ) - Mailing list pgsql-general

From Martin Langhoff
Subject Pg 8.3 tuning recommendations for embedded low-memory device (for OLPC :-) )
Date
Msg-id 46a038f90809141655o27e2adc4ta315ac649b8135f9@mail.gmail.com
Whole thread Raw
Responses Re: Pg 8.3 tuning recommendations for embedded low-memory device (for OLPC :-) )  ("Martin Langhoff" <martin.langhoff@gmail.com>)
Re: Pg 8.3 tuning recommendations for embedded low-memory device (for OLPC :-) )  (Tomasz Ostrowski <tometzky@batory.org.pl>)
List pgsql-general
Hi,

I am working on the School Server (aka XS: a Fedora 9 spin, tailored
to run on fairly limited hw), I'm preparing the configuration settings
for it. It's a somewhat new area for me -- I've done a lot of tuning
with Pg 7.4 to 8.2 on mid-range hardware (several GBs RAM, RAID
controllers, many spindles, etc) and written and maintained lots of sw
that uses Pg... but this is... different. So I'm interested in hearing
from other people that may be working in similar low-mem
configurations.

In brief:

 - The workload is relatively "light": mainly Moodle and Mediawiki.
Small datasets, but those webapps are somewhat "intensive" in that
they'll do >30 SELECTs  + 1 INSERT (to a log table) before they serve
a page. To make things more interesting, we sometimes get teachers
saying "and now we all click [OK]" -- on the apache/php side there are
a few tricks to tame the thundering herd, but Pg will still have to
handle some sudden traffic spikes. I'll patch that INSERT on the
webapp side to use the new async commits.

 - The XS will (in some locations) be hooked to *very* unreliable
power... uncontrolled shutdowns are the norm. I don't expect this to
be a problem with Pg :-)

 - After a bad shutdown, graceful recovery is the most important
aspect. If a few transactions were lost we can cope.

 - The XS hardware runs many services (mostly webbased), so Pg gets
only a limited slice of memory. To make matters worse, I *really*
don't want the webservices processes (Pg, Apache/PHP) to get paged
out. So I am interested in pegging the max (non-mmapped) memory Pg
will take.

 - The XS hw is varied. In small schools it may have 256MB RAM (likely
to be running on XO hardware + usb-connected ext hard-drive).
Medium-to-large schools will have the recommended 1GB RAM and a cheap
SATA disk. A few very large schools will be graced with more RAM (2 or
4GB).

... so RAM allocation for Pg will prob range between 32MB at the
lower-end and 128MB/196MB at the 1GB "recommended" RAM.

My main question is: for the moodle/mediawiki workload, how would you
tune Pg 8.3 so that

  - it does not allocate directly more than 32MB / 196MB? (Here, I
assume that the linux kernel with be smart about mmapped stuff. Is
that a reasonable assumption with current kernels and Pg?)

 - still gives us good thoughput? :-)

cheers,




m
--
 martin.langhoff@gmail.com
 martin@laptop.org -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff

pgsql-general by date:

Previous
From: Jack Orenstein
Date:
Subject: Re: Autocommit, isolation level, and vacuum behavior
Next
From: "Martin Langhoff"
Date:
Subject: Re: Pg 8.3 tuning recommendations for embedded low-memory device (for OLPC :-) )