From: | David Gilbert <dgilbert(at)velocet(dot)ca> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | David Gilbert <dgilbert(at)velocet(dot)ca>, "Thomas O'Connell" <tfo(at)monsterlabs(dot)com>, pgsql-admin(at)postgresql(dot)org |
Subject: | Re: performance tuning: shared_buffers, sort_mem; swap |
Date: | 2002-08-14 12:49:33 |
Message-ID: | 15706.20957.753062.582158@canoe.velocet.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
>>>>> "Tom" == Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
Tom> David Gilbert <dgilbert(at)velocet(dot)ca> writes:
>> I don't often ask a question, but it's been bugging me for some
>> time: is there any reason why PostgreSQL must use SysV shared
>> memory? Coming from the BSD camp, I've often pondered why it
>> doesn't use BSD-style shared memory (which is often easier to
>> allocate in the BSD world).
Tom> Well, I must say this is the first time I've heard of "BSD-style
Tom> shared memory". What are the syscalls? How portable is it?
Tom> Does it have the semantics we need (specifically, the ability to
Tom> associate an ID with a shmem segment, and the ability to discover
Tom> whether any other processes are attached to an existing shmem
Tom> segment)?
The canonical example is to mmap() a file multiply. BSD will
guarentee this is shared memory. Of course, to address the concern
that you really don't need a file, the MAP_ANON flag can be given
(meaning that there is no file).
With anonymous memory, you pass the file descriptor through your
fork()'s. With non-anonymous memory, you can mmap() it multiply from
different processes and get the same effect.
With a glance at the man page, you'd have MAP_SHARED | MAP_ANON |
MAP_NOSYNC | MAP_HASSEMAPHORE.
One bonus of bsd shared memory (when anonymous) is that it dies with
the process ... even in the worst case.
Dave.
--
============================================================================
|David Gilbert, Velocet Communications. | Two things can only be |
|Mail: dgilbert(at)velocet(dot)net | equal if and only if they |
|http://daveg.ca | are precisely opposite. |
=========================================================GLO================
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2002-08-14 13:41:01 | Re: performance tuning: shared_buffers, sort_mem; swap |
Previous Message | Curt Sampson | 2002-08-14 12:43:06 | Re: performance tuning: shared_buffers, sort_mem; swap |