Skip to main content
Question

UV 14.2.1 uvconfig N_GLM_SELF_BUCKET setting


Gregor Scott
Forum|alt.badge.img+4

Docs on this setting describe it thus:

Sets the number of hash buckets in the per-user locking table. Adjust this based on the number of concurrent locks a user may hold.

and

The number of hash buckets for the per-process locking table. 
This parameter is highly application dependent, If the application requires a large number of locks in one transaction (more than 20), you should increase this setting to the closest prime number to the maximum number of locks per transaction.
 

 

So if we have identified our maximum locks per transaction is a rather large number, like 5000, then this calculation would derive to 4999.

 

That does not seem to make sense.

Is there any real-world feedback on this?

2 replies

Jonathan Smith
Forum|alt.badge.img+4

The lock table structures have now been taken from UniData and the recommendation I have followed and provided to UniData customers (and has been successful) for a long time is to use "the closest prime number to the maximum number of locks per transaction" — the per-process lock table (PTLT) is a flat hash, so one bucket per expected lock gives ~1 entry per chain. 

As noted the value must be prime. UniData (and I suspect UniVerse does this is as well) doesn't just warn — it silently rounds up to the next prime. So Entering 5000 yields 5003 anyway, plus the startup message "N_GLM_SELF_BUCKET should be a prime number". (4999 is also prime and technically 1 closer, but 5003 matches what the engine resolves to and avoids the warning.

There is a companion tuneable to look at — GLM_MEM_ALLOC should be max locks per transaction × 2, i.e. 10000.

Cost / caveats

Shared memory: NUSERS × N_GLM_SELF_BUCKET × 8 bytes in the control segment. At 5003 that's ~40 KB per user — 100 users ≈ 4 MB, 500 users ≈ 20 MB.
Don't inflate it beyond the real maximum. Unlock-all, transaction cleanup and lock-dump paths do a full scan of all buckets per call so 5003 buckets means 5003 iterations each time regardless of how many locks are actually held.


Gregor Scott
Forum|alt.badge.img+4
  • Author
  • Participating Frequently
  • October 16, 2026

Thanks for those details ​@Jonathan Smith .

The extra info about needing the next higher prime is very helpful.