Taylor R Campbell <[email protected]> writes:

>> Date: Wed, 15 Jul 2026 11:42:00 -0400
>> From: Greg Troxel <[email protected]>
>> 
>> Back in 1993 I had a spiffy computer that had 12 MB of RAM, bought to
>> run 386BSD 0.1 and then I ran NetBSD 0.8.  I say that to calibrate our
>> sense of resource usgae.
>> 
>> On the theory that if a value was appropriate in 1993, 5x that value is
>> totally fine in 2026.  If a machine has less than 60 MB of RAM, then
>> lower might be warranted -- but on such a machine one would be building
>> custom kernels and ripping out everything that isn't neceesary anyway.
>> Therefore:
>> 
>>   I propose to change SEMMNI from 10 to 32.
>>   I propose to change SEMMNS from 60 to 256.
>> 
>> The concept would be, as it is now, that individual ports or kernel
>> configs could just set these to lower values, if that's appropriate.
>
> Why not vary automatically with the amount of RAM at boot?

1) Because that's complicated, and I don't want to do anything
complicated.  A 5x bump is safe (after 33 years) and appears sufficient
for a while, it's easy, and it's a safe bet it won't cause real trouble.

2) It's unclear to me why we have limits.  Right now there is some
(fairly small) amount of wired memory proportional to these limits.   If
it were dynamically allocated, so that asking for another semaphore just
worked, that would be even better.

3) It's really unclear how many semaphores are needed.  It's not really
about RAM; it's about "do you run postgresql or don't you", it seems.
I wouldn't really want to allocate thousands on a big machine.


If you feel like making this based on RAM, as long as 1 GB machines have
at least 32/256, in a way that releng is willing to pull up, soon, then
that's fine with me.  In thinking about writing out suggestions, I don't
really know how much to suggest for say a 64 GB machine, and I don't
know the levels at which trouble begins.  For example, is SEMMNI 16384
and SEMMNS 131072 ok?  I don't see any reason to go that high.

  - I think it's fine for <= 512 MB machines to have the old limit.
  - > 512MB to 16 GB: 32/256
  - higher, could go as high as 256/2048 (just making that up as higher
    than anyone has reported needing) at 128 GB>

But I do not believe that will be meaningfully  more useful than just
32/256.

Reply via email to