Re: memory strangeness (fwd)

Поиск
Список
Период
Сортировка
От Curt Sampson
Тема Re: memory strangeness (fwd)
Дата
Msg-id Pine.NEB.4.44.0207051104460.478-100000@angelic.cynic.net
обсуждение исходный текст
Ответ на memory strangeness (fwd)  (Gregor Mosheh <stigmata@blackangel.net>)
Ответы Re: memory strangeness (fwd)  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: memory strangeness (fwd)  (Gregor Mosheh <stigmata@blackangel.net>)
Список 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@cynic.net>   +81 90 7737 2974   http://www.netbsd.org
    Don't you know, in this new Dark Age, we're all light.  --XTC




В списке pgsql-admin по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: memory strangeness (fwd)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: memory strangeness (fwd)