feat(ansible): add net.core sysctl tuning params to tuned profile#2245
Merged
Conversation
Standalone yamllint used its default ruleset, which conflicts with Ansible conventions (Jinja brace spacing, omitted document-start markers, long lines) and flagged the tuned profile despite ansible-lint passing. Add a .yamllint that mirrors the yamllint profile ansible-lint applies internally so both tools agree, and un-ignore it in .gitignore (which ignores all dotfiles).
Contributor
Author
|
@claude review |
matthudsonatx
approved these changes
Jun 29, 2026
jfreeland
reviewed
Jun 29, 2026
| - option: 'net.core.rmem_default' | ||
| value: '262144' | ||
| - option: 'net.core.rmem_max' | ||
| value: '104857600' |
Contributor
There was a problem hiding this comment.
this seems awfully high for free tier? cc: @danielmitterdorfer for review from #team-perf-eng
Contributor
Author
There was a problem hiding this comment.
you're probably not wrong, but as I said on Slack, i'm just consolidating the values from elsewhere in our repos into tuned. once it's all in tuned, then we can talk instance sizing 🤞🏻
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.
What
Adds the following
net.core.*parameters to thesysctlsection of the PostgreSQL tuned profile (ansible/tasks/setup-tuned.yml):net.core.netdev_budget1024net.core.netdev_max_backlog10000net.core.rmem_default262144net.core.rmem_max104857600net.core.somaxconn16384net.core.wmem_default262144net.core.wmem_max104857600It also adds a tracked
.yamllintconfig (and a.gitignorenegation so it survives the repo's.*dotfile ignore) so that standaloneyamllintagrees with the yamllint profileansible-lintalready applies internally.Why / Benefit to PostgreSQL
These kernel network-stack settings improve how Postgres handles connections and high-throughput client traffic:
net.core.somaxconn(16384) — raises the ceiling on the listen backlog so bursts of incoming connections aren't dropped during connection storms (e.g. poolers reconnecting, many clients starting at once). Pairs with Postgres's ownlistenbacklog.net.core.netdev_max_backlog(10000) — allows more incoming packets to queue when the NIC receives faster than the kernel can process, reducing packet drops under heavy network load and the retransmits/latency spikes that follow.net.core.netdev_budget(1024) — lets the kernel process more packets per softirq poll cycle, improving network throughput on busy database servers handling many concurrent connections.net.core.rmem_default/rmem_max(256 KiB / 100 MiB) — larger receive socket buffers let Postgres backends absorb large inbound payloads (bulk INSERT/COPY, large query parameters) without stalling on slow/high-latency links.net.core.wmem_default/wmem_max(256 KiB / 100 MiB) — larger send socket buffers let backends ship large result sets (big SELECTs, COPY TO, replication streams) without blocking, improving throughput over high-bandwidth-delay-product networks.Together these raise the buffer and queue headroom of the network stack so a high-connection, high-throughput Postgres instance is less likely to drop connections or bottleneck on the kernel under load.
Notes
net.core.somaxconnwas previously set to16834— corrected to16384(transposed-digit typo)..yamllintconfig mirrorsansible-lint's embedded yamllint profile (line-length off,document-startdisabled,braces/truthyrelaxed for Ansible). With it in place,setup-tuned.ymlpasses bothansible-lintandyamllintwith no playbook content changes. Pre-existing lint debt in other, untouched task files is intentionally left out of scope.INDATA-378