New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compute_ctl: Auto-set dynamic_shared_memory_type #7348
Merged
sharnoff
merged 6 commits into
main
from
sharnoff/compute_ctl-auto-dynamic_shared_memory_type
Apr 10, 2024
Merged
compute_ctl: Auto-set dynamic_shared_memory_type #7348
sharnoff
merged 6 commits into
main
from
sharnoff/compute_ctl-auto-dynamic_shared_memory_type
Apr 10, 2024
Conversation
This file contains 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
Part of neondatabase/cloud#12047. The basic idea is that for our VMs, we want to enable swap and disable Linux memory overcommit. Alongside these, we should set postgres' dynamic_shared_memory_type to mmap, but we want to avoid setting it to mmap if swap is not enabled. Implementing this in the control plane would be fiddly, but it's relatively straightforward to add to compute_ctl.
tristan957
reviewed
Apr 9, 2024
2754 tests run: 2636 passed, 0 failed, 118 skipped (full report)Code coverage* (full report)
* collected from Rust tests only The comment gets automatically updated with the latest test results
fe5032c at 2024-04-10T13:28:02.477Z :recycle: |
tristan957
approved these changes
Apr 9, 2024
Need to test on staging first, then will merge. 🤞 |
This reverts commit 3e54a0e. Apparently cfg!(unix) is valid, but for linux it needs to be cfg!(target_os = "linux"). :/
Tested on staging successfully. Noticed some other issues because I was testing with weird settings: https://neondb.slack.com/archives/C06SW383C79/p1712714106564139 |
sharnoff
deleted the
sharnoff/compute_ctl-auto-dynamic_shared_memory_type
branch
April 10, 2024 13:13
sharnoff
added a commit
that referenced
this pull request
Apr 10, 2024
Part of neondatabase/cloud#12047. The basic idea is that for our VMs, we want to enable swap and disable Linux memory overcommit. Alongside these, we should set postgres' dynamic_shared_memory_type to mmap, but we want to avoid setting it to mmap if swap is not enabled. Implementing this in the control plane would be fiddly, but it's relatively straightforward to add to compute_ctl.
sharnoff
added a commit
that referenced
this pull request
Apr 11, 2024
Release 2024-04-11 (cherry-pick #7348 only) See here for more: https://neondb.slack.com/archives/C04DGM6SMTM/p1712776981582679
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.
Part of neondatabase/cloud#12047.
The basic idea is that for our VMs, we want to enable swap and disable Linux memory overcommit. Alongside these, we should set postgres' dynamic_shared_memory_type to mmap, but we want to avoid setting it to mmap if swap is not enabled.
Implementing this in the control plane would be fiddly, but it's relatively straightforward to add to compute_ctl.
Summary of changes
Change compute_ctl's
write_postgres_conf
to injectdynamic_shared_memory_type = mmap
iffvm.overcommit_memory = 2
(which we can check by reading/proc/sys/vm/overcommit_memory
).