PostgreSQL performance scaling

Ivan Voras ivoras at
Tue Nov 23 00:30:08 UTC 2010

On 11/22/10 17:37, David Xu wrote:
> Mark Felder wrote:
>> I recommend posting this on the Postgres performance list, too.
>> Regards,
>> Mark
> I think if PostgreSQL uses semaphore for inter-process locking,
> it might be a good idea to use POSIX semaphore exits in our head
> branch, the new POSIX semaphore implementation now supports
> process-shared, and is more light weight than SYSV semaphore,
> if there is no contention, a process need not enter kernel to
> acquire/release a lock. Note that I have just fixed a bug in head
> branch. However RELENG_8 does not support process-shared semaphore
> yet.

Another thing might be that, despite that they appear to try to avoid 
it, they possibly have a large number of processes hanging on the same 
semaphore, leading to thundering herd problem.

There already is code for POSIX semaphores in PostgreSQL. It requires 
some manual fiddling with the configuration to enable 

However, I've just tried it on 9-CURRENT and it doesn't work:

Nov 23 01:23:02 biggie postgres[1515]: [1-1] FATAL:  sem_init failed: No 
space left on device

PostgreSQL calls it as "sem_init(sem, 1, 1);"

One more thing: apparently I had to kldload sem.ko - which looks like an 
error, since it is in GENERIC in 8-STABLE !

More information about the freebsd-performance mailing list