Search Postgresql Archives

Pg 8.3 tuning recommendations for embedded low-memory device (for OLPC :-) )

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx
 martin@xxxxxxxxxx -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux