From: | Poul Laust Christiansen <poulc(at)cs(dot)auc(dot)dk> |
---|---|
To: | Guillaume Lémery <glemery(at)comclick(dot)com> |
Cc: | Steve Wolfe <steve(at)iboats(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Re: Load a database into memory |
Date: | 2001-01-25 18:19:43 |
Message-ID: | Pine.GSO.4.21.0101251916220.11370-100000@borg.cs.auc.dk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
You need to specify the memory usage when you start the postmaster.
My /etc/rc.d/init.d/postgresql script has this line:
su -l postgres -c "/usr/bin/pg_ctl -D $PGDATA -p /usr/bin/postmaster -o
'-B 4096 -i' start >/dev/null 2>&1"
The -B option tells postgres to use 8KBx4096= 32MB pr. postmaster. The
default value is somewhere around 1MB.
I also have this line in my start script:
echo 104857600 >/proc/sys/kernel/shmmax
Which defines the maximum amount of shared memory.
HTH,
Poul L. Christiansen
On Thu, 25 Jan 2001, Guillaume Lémery wrote:
> > If you have enough RAM, the database will already be in memory, in a
> > manner of speaking - your kernel will have all of the files held in disk
> > cache.
>
> Ok, but if so, why 10 simultaneous same queries on a well-indexed table with only 500 000 records take a so long time ? :-/
>
> >
> >> What else should I know about memory with PostGreSQL ?
> >
> >
> > You can increase the shared memory, and you can increase the amount of
> > memory used for sorts/joins, but I haven't run across much more than that.
> > Postgres is just a very memory-efficient piece of work. I laugh when I hear
> > of people using MS's database, and adding gigs and gigs of RAM for even
> > modest databases to perform well. Our server has a half of a gig, and I
> > just can't get Postgres to use it all. I guess I better come up with a few
> > more large tables to join to. : )
>
> My server has 1G RAM and yes, I still have 800MB free when PG is running...
> But I tried to avoid join or sorts in my queries, so I don't think I
> need to tune the amount of memory used for sorts/joins...
>
> Guillaume.
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Frank Joerdens | 2001-01-25 18:22:55 | Re: beta3 Solaris 7 (SPARC) port report [ Was: Looking for . . . ] |
Previous Message | Brett W. McCoy | 2001-01-25 18:12:48 | Re: Connection pooling |