From: | Doug Fields <dfields-pg-general(at)pexicom(dot)com> |
---|---|
To: | terry(at)greatgulfhomes(dot)com |
Cc: | "'Martin Dillard'" <martin(at)edusoftinc(dot)com>, <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Linux max on shared buffers? |
Date: | 2002-07-10 19:58:51 |
Message-ID: | 5.1.0.14.2.20020710155445.02ce1240@pop.pexicom.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
At 02:17 PM 7/10/2002, terry(at)greatgulfhomes(dot)com wrote:
>How does one increase the SHMMAX? Does it require recompiling the kernel?
To answer both questions:
Increase it with /etc/sysctl.conf entries such as: (Linux 2.2 and up)
kernel.shmall = 1073741824
kernel.shmmax = 1073741824
Or:
echo 1073741824 > /proc/sys/kernel/shmall
etc.
Linux on i386 has a problem with much memory: a 4 gig limit on addressible
memory per process (at least, without using bank switching). The Kernel
usually reserves 1 or 2 gigs for itself, leaving only 2 or 3 gigs for the
process. Hence, it's unlikely you'd ever be able to map a larger shared
memory segment into a process anyway, so I figure the 2gb limit is pretty
reasonable.
On my 8gb system, I give only 256-512 megs to shared memory, and also set
effective_cache_size = 625000
Telling Postgresql that there's probably 5 gigs of data in the OS level
cache. I'm not sure if that does anything, but since there's more like 6.5
or 7 gigs in the OS cache, I figure it can't hurt.
Cheers,
Doug
>Terry Fielder
>Network Engineer
>Great Gulf Homes / Ashton Woods Homes
>terry(at)greatgulfhomes(dot)com
>
> > -----Original Message-----
> > From: pgsql-general-owner(at)postgresql(dot)org
> > [mailto:pgsql-general-owner(at)postgresql(dot)org]On Behalf Of Martin Dillard
> > Sent: Wednesday, July 10, 2002 1:45 PM
> > To: pgsql-general(at)postgresql(dot)org
> > Subject: [GENERAL] Linux max on shared buffers?
> >
> >
> > We are trying to throw a lot of memory at PostgreSQL to try to boost
> > performance. In an attempt to put our entire database into
> > memory, I want to
> > allocate 2 to 3 GB out of 4 GB on a dual processor server
> > running Red Hat
> > Linux 7.3 and PostgreSQL 7.2.1. We only expect 4 or 5
> > concurrent backends.
> >
> > When I try to allocate 2 GB or more, I get the following
> > error when I try to
> > start PostgreSQL (after setting kernel.shmall and kernel.shmmax
> > appropriately):
> >
> > IpcMemoryCreate: shmat(id=163840) failed: Cannot allocate memory
> >
> > I can safely allocate a little under 2 GB. Is this a Linux
> > upper bound on
> > how much memory can be allocated to a single program? Is there another
> > kernel parameter besides kernel.shmall and kernel.shmmax that
> > can be set to
> > allow more memory to be allocated?
> >
> >
> > ---------------------------(end of
> > broadcast)---------------------------
> > TIP 3: if posting/reading through Usenet, please send an appropriate
> > subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> > message can get through to the mailing list cleanly
> >
>
>---------------------------(end of broadcast)---------------------------
>TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
From | Date | Subject | |
---|---|---|---|
Next Message | scott.marlowe | 2002-07-10 20:16:53 | Re: Serious Crash last Friday |
Previous Message | Roderick A. Anderson | 2002-07-10 19:58:09 | MySQL password function |