fix: Quadruple max_locks_per_transaction#1165
Open
Erethon wants to merge 1 commit into
Open
Conversation
Collaborator
|
I ran it with default Postgres settings locally a couple of times, without other concurrent things going on. Larger batch sizes (e.g. 20k, 50k) would error out on their own in the beginning when each batch would produce new packages/attributes. But I didn't do any rigorous measurement, so I don't even know how that 64 figures into a batch size of 10k. |
| max_parallel_workers_per_gather = "4"; | ||
| max_parallel_workers = "8"; | ||
| max_parallel_maintenance_workers = "4"; | ||
| max_locks_per_transaction = "256"; |
Collaborator
There was a problem hiding this comment.
How about we move that into right into configuration.nix and say why it's need to be like that? I don't think this setting is in any way specific to any deployment.
Collaborator
There was a problem hiding this comment.
Discussed with @Erethon:
- The number of advisory locks is x <max_locks> (200x64 = 12400)
- That explains why running batches locally didn't allow for more than 10k
- Bumping to 256 will give us >50k slots, which should be plenty at that batch size
- We should move it to
configuration.nixbecause it's an application-level requirement
Collaborator
|
@Erethon I added a commit to avoid operators having to think about the setting if they don't want to, please take a look. |
Erethon
commented
Jul 8, 2026
The default for this setting is 64, let's quadruple it to allow for bigger batch sizes. Closes NixOS#1153
d152869 to
74a59e1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The default for this setting is 64, let's quadruple it to allow for bigger batch sizes.
@fricklerhandwerk @adekoder did you do any fine-tuning on that 10k rows batch size when testing the PR? I believe lowering that would also help, but I don't know how it would impact speed.
Closes #1153