Skip site navigation (1) Skip section navigation (2)

Re: Query caching

From: "Poul L(dot) Christiansen" <poulc(at)cs(dot)auc(dot)dk>
To: Frank Joerdens <frank(at)joerdens(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Query caching
Date: 2000-11-01 13:25:10
Message-ID: 3A0019B6.681EC026@cs.auc.dk (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackers
Frank Joerdens wrote:
> 
> On Wed, Nov 01, 2000 at 10:16:58AM +0000, Poul L. Christiansen wrote:
> > PostgreSQL hits the disk on UPDATE/DELETE/INSERT operations. SELECT's
> > are cached, but the default cache is only ½MB of RAM. You can change
> > this to whatever you want.
> 
> That sound like a very cool thing to do, and the default seems awfully
> conservative, given the average server´s RAM equipment nowadays. If you
> have a small Linux server with 128 MB of RAM, it would be interesting to
> see what happens, performance-wise, if you increase the cache for
> selects to, for instance, 64 MB. Has anyone tried to benchmark this? How
> would you benchmark it? Where do you change this cache size? How do you
> keep the cache from being swapped out to disk (which would presumably
> all but eradicate the benefits of such a measure)?

I have a PostgreSQL server with 80MB of RAM running Redhat Linux 7.0 and
in my /etc/rc.d/init.d/postgresql start script I have these 2 lines that
start the postmaster.

echo 67108864 > /proc/sys/kernel/shmmax

su -l postgres -c "/usr/bin/pg_ctl  -D $PGDATA -p /usr/bin/postmaster -o
'-i -B 4096 -o -F' start >/dev/null 2>&1" < /dev/null

The first line increases the maxium shared memory to 64MB.
The "-B 4096" indicates 4096 * 8kb = 32MB to each postmaster.

I haven't benchmarked it, but I know it's MUCH faster.

Poul L. Christiansen

In response to

pgsql-hackers by date

Next:From: Jones, ColinDate: 2000-11-01 14:22:50
Subject: RE: list owner please help me get off the list.
Previous:From: Marc G. FournierDate: 2000-11-01 12:42:57
Subject: Re: Re: [GENERAL] Query caching

pgsql-general by date

Next:From: Lorenz BatemanDate: 2000-11-01 13:43:40
Subject: Speed issues with update
Previous:From: Marc G. FournierDate: 2000-11-01 12:42:57
Subject: Re: Re: [GENERAL] Query caching

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group