pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Problem with PostgreSQL 18 and semaphores



Martin Husemann <martin%duskware.de@localhost> écrit :
> On Sat, Oct 25, 2025 at 08:28:13PM +0200, Marc Baudoin wrote:
> > Is it a bug in PostgreSQL 18?
> 
> I don't know but we should find out. Maybe ask upstream?

Does somebody have regular contact with the PostgreSQL
development group?

> It is possible that they added code using a lot more semaphores on 
> purpose, and they should document that ... somewhere.

It is:

https://www.postgresql.org/docs/current/kernel-resources.html

The runtime-computed parameter num_os_semaphores reports the
number of semaphores required. This parameter can be viewed
before starting the server with a postgres command like:

$ postgres -D $PGDATA -C num_os_semaphores

Which gives for me:

174

According to the same URL:

SEMMNI should be greater than ceil(num_os_semaphores / 16) = 11
SEMMNS should be greater than ceil(num_os_semaphores / 16) * 17 = 185

which gives values very close to what I've come to empirically:

kern.ipc.semmni=11
kern.ipc.semmns=187

The num_os_semaphores configuration parameter is new with
PostgreSQL 18.  I wonder if it is linked to the new asynchronous
IO system.

> I am still using postgres 14 and it is happy with the 10/60 defaults.

I've always been also but it looks like things have changed with
version 18.


Home | Main Index | Thread Index | Old Index