Adjust DSM and DSA slot usage constants.
authorThomas Munro <tmunro@postgresql.org>
Fri, 31 Jan 2020 03:58:38 +0000 (16:58 +1300)
committerThomas Munro <tmunro@postgresql.org>
Fri, 31 Jan 2020 04:29:38 +0000 (17:29 +1300)
commitd061ea21fc1cc1c657bb5c742f5c4a1564e82ee2
tree812300662f52ce3edaefdbe98c717bc1de1864a9
parenta069218163704c44a8996e7e98e765c56e2b9c8e
Adjust DSM and DSA slot usage constants.

When running a lot of large parallel queries concurrently, or a plan with
a lot of separate Gather nodes, it is possible to run out of DSM slots.
There are better solutions to these problems requiring architectural
redesign work, but for now, let's adjust the constants so that it's more
difficult to hit the limit.

1.  Previously, a DSA area would create up to four segments at each size
before doubling the size.  After this commit, it will create only two at
each size, so it ramps up faster and therefore needs fewer slots.

2.  Previously, the total limit on DSM slots allowed for 2 per connection.
Switch to 5 per connection.

Also remove an obsolete nearby comment.

Author: Thomas Munro
Reviewed-by: Robert Haas, Andres Freund
Discussion: https://postre.es/m/CA%2BhUKGL6H2BpGbiF7Lj6QiTjTGyTLW_vLR%3DSn2tEBeTcYXiMKw%40mail.gmail.com
src/backend/storage/ipc/dsm.c
src/backend/utils/mmgr/dsa.c