From: | Curt Sampson <cjs(at)cynic(dot)net> |
---|---|
To: | Gregor Mosheh <stigmata(at)blackangel(dot)net> |
Cc: | pgsql-admin(at)postgresql(dot)org |
Subject: | Re: memory strangeness (fwd) |
Date: | 2002-07-05 02:31:45 |
Message-ID: | Pine.NEB.4.44.0207051104460.478-100000@angelic.cynic.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
On Thu, 4 Jul 2002, Gregor Mosheh wrote:
> Hiya. I've installed Postgres 7.2 on a dedicated FreeBSD system with 384
> MB RAM. Because the system will be doing nothing except PG, I'd like to
> dump as much memory as possible into PG's shared memory.
Well, see Tom's comments on this, 'cause that's what I always say
too. (I'm a NetBSD developer, but FreeBSD's internals aren't so
different, really.)
However, if you wanted to do it both ways, and benchmark your
application, I'd be really interested in hearing about the results.
> I rebuilt the kernel with very large limits: 330 MB on the MAXDSIZ and
> DFLDSIZ, and 330 MB for SHMMAXPAGES. This gives me:
You don't need to rebuild for DFLDSIZ; you can always bump that
up to MAXDSIZ with sysctl (assuming you're root--do it before
you "su pgsql -c nadanada" in your startup script). And moving
MAXDSIZ to 330 MB looks like a reduction to me; FreeBSD's default in
4.6-RELEASE is 512 MB. (NetBSD's is 1GB.) You probably want to check
/usr/include/machine/vmparam.h for default settings before changing
stuff like this, lest you accidently lower it instead.
> I still cannot set PG's shared_buffers higher than 20000 (160 MB):
Shared memory pages, IIRC, are locked, meaning that they cannot be
swapped. There's always a limit on the number of locked pages you
may have in the system in total, if only becuase the system has only
so much physical RAM. But for some reasont he RLIMIT_MEMLOCK parameter
on my nearest FreeBSD 4.6 system is a bit bogus:
server2 $ ulimit -Ha | grep locked
lockedmem(kbytes) unlimited
(I certainly cannot lock an unlimited number of pages in this 1GB
machine! And for some reason it's also saying that my RLIMIT_RSS
is unlimited; again, this should return no more than the physical
RAM available in the machine.)
So I suspect you're running into some other, more secret, limit on
the number of pages that the system or a process may lock into RAM.
So you'll want to dig around the kernel to find out where this is,
and tweak it.
cjs
--
Curt Sampson <cjs(at)cynic(dot)net> +81 90 7737 2974 http://www.netbsd.org
Don't you know, in this new Dark Age, we're all light. --XTC
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2002-07-05 03:18:22 | Re: memory strangeness (fwd) |
Previous Message | Tom Lane | 2002-07-05 01:30:32 | Re: memory strangeness (fwd) |