number of semaphores and semaphore sets

Started by Anton Yuzhaninovabout 15 years ago3 messagesdocs
Jump to latest
#1Anton Yuzhaninov
citrin@citrin.ru

This page:
http://www.postgresql.org/docs/9.0/interactive/kernel-resources.html

has formula:
ceil((max_connections + autovacuum_max_workers) / 16)

for number of semaphore sets (identifiers).

It seems to be wrong (outdated).

Correct formula seems to be

ceil((max_connections + autovacuum_max_workers + 4) / 16)

Semaphore sets created in src/backend/storage/lmgr/proc.c:
1. MaxConnections
2. autovacuum_max_workers + 1
3. NUM_AUXILIARY_PROCS (currently 3)

--
Anton Yuzhaninov

#2Robert Haas
robertmhaas@gmail.com
In reply to: Anton Yuzhaninov (#1)
Re: number of semaphores and semaphore sets

On Mon, Mar 21, 2011 at 12:05 PM, Anton Yuzhaninov <citrin@citrin.ru> wrote:

This page:
http://www.postgresql.org/docs/9.0/interactive/kernel-resources.html

has formula:
ceil((max_connections + autovacuum_max_workers) / 16)

for number of semaphore sets (identifiers).

It seems to be wrong (outdated).

Correct formula seems to be

ceil((max_connections + autovacuum_max_workers + 4) / 16)

Semaphore sets created in src/backend/storage/lmgr/proc.c:
1. MaxConnections
2. autovacuum_max_workers + 1
3. NUM_AUXILIARY_PROCS (currently 3)

Yeah, I think you're right. It appears that nothing material has
changed here since 8.3, so I'm inclined to back-patch this doc fix
back that far.

Barring objections, I'll go change this.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

#3Bruce Momjian
bruce@momjian.us
In reply to: Robert Haas (#2)
Re: number of semaphores and semaphore sets

Robert Haas wrote:

On Mon, Mar 21, 2011 at 12:05 PM, Anton Yuzhaninov <citrin@citrin.ru> wrote:

This page:
http://www.postgresql.org/docs/9.0/interactive/kernel-resources.html

has formula:
ceil((max_connections + autovacuum_max_workers) / 16)

for number of semaphore sets (identifiers).

It seems to be wrong (outdated).

Correct formula seems to be

ceil((max_connections + autovacuum_max_workers + 4) / 16)

Semaphore sets created in src/backend/storage/lmgr/proc.c:
1. MaxConnections
2. autovacuum_max_workers + 1
3. NUM_AUXILIARY_PROCS (currently 3)

Yeah, I think you're right. It appears that nothing material has
changed here since 8.3, so I'm inclined to back-patch this doc fix
back that far.

Barring objections, I'll go change this.

I have applied the attached patch and backpatched it to 9.0 and 9.1.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

Attachments:

/rtmp/semaphoretext/x-diffDownload+6-6