Skip to content

Commit

Permalink
Fixes #37964 - Increase foreman.socket's Backlog option to INT_MAX
Browse files Browse the repository at this point in the history
Ever since 3e38815 we've shipped with
Backlog=1024. That value was taken somewhere from the internet and it
sort of made sense. The default back then was 128, which was often a
bottleneck. Why 1024, that's a good question.

Taking a step back, I wrote a long analysis[1] which can be summarized:

systemd < 254 uses SOMAXCONN as a default for Backlog=, which is a
constant defined by libc. glibc < 2.31 defaults to 128 while >= 2.31
uses 4096 to match the Linux kernel's net.core.somaxconn. systemd >= 254
defaults to INT_MAX (4294967295) for Backlog= and will be capped by the
kernel's net.core.somaxconn value.

Linux < 5.4 defaults to 128 for net.core.somaxconn while >= 5.4 defaults
to 4096.

EL 9 ships with Linux 5.14, glibc 2.34 and systemd 252. That makes me
think it defaults to 4096 for Backlog=, but is also hard capped. Setting
it to INT_MAX (like systemd 254+) should solely leave it to the kernel's
net.core.somaxconn, making it easier for users to tune their system.

[1]: https://issues.redhat.com/browse/SAT-6776#comment-25982829
  • Loading branch information
ekohl authored and ehelms committed Nov 18, 2024
1 parent a525369 commit 001cf0d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion extras/systemd/foreman.socket
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ ListenStream=3000
# Socket options matching Puma defaults
NoDelay=true
ReusePort=true
Backlog=1024
# Match systemd v254+'s default because EL9 has 252
Backlog=4294967295

[Install]
WantedBy=sockets.target

0 comments on commit 001cf0d

Please sign in to comment.