RHEL8 tuned.service set net.core.somaxconn to 2048, however it doesn't work for some services.

Solution Unverified - Updated -

Issue

  • tuned.service set net.core.somaxconn to 2048, however it doesn't work for some services.
  • tuned.service and httpd.service sample:
# rpm -q tuned
tuned-2.21.0-1.el8_9.noarch
# rpm -q tuned-2.21.0-1.el8_9.noarch --changelog | grep -B1 1998310
  - throughput-performance: set net.core.somaxconn to at least 2048
    resolves: rhbz#1998310
# systemctl is-active tuned.service 
active
# grep somaxconn -R /lib/tuned/*
/lib/tuned/throughput-performance/tuned.conf:net.core.somaxconn=>2048
# sysctl net.core.somaxconn
net.core.somaxconn = 2048
# systemctl is-active httpd
active
# ss -ltnp sport = :80
State              Recv-Q             Send-Q                         Local Address:Port                          Peer Address:Port             Process             
LISTEN             0                  128                                  0.0.0.0:80                                 0.0.0.0:*                 users:(("httpd",pid=850,fd=3),("httpd",pid=841,fd=3),("httpd",pid=836,fd=3),("httpd",pid=835,fd=3),("httpd",pid=834,fd=3),("httpd",pid=793,fd=3))
# systemctl restart httpd.service 
# ss -ltnp sport = :80
State              Recv-Q             Send-Q                         Local Address:Port                          Peer Address:Port             Process             
LISTEN             0                  511                                  0.0.0.0:80                                 0.0.0.0:*                 users:(("httpd",pid=1708,fd=3),("httpd",pid=1707,fd=3),("httpd",pid=1706,fd=3),("httpd",pid=1705,fd=3),("httpd",pid=1704,fd=3),("httpd",pid=1700,fd=3))

Please note httpd.service needs to restart here to set listen backlog to 511 which is a default value of ListenBackLog.

man 2 listen:

The behavior of the backlog argument on TCP sockets changed with Linux 2.2.  Now it specifies the queue length for completely established sockets waiting to be accepted, instead of the number of incomplete connection requests.  The maximum length of the queue for incomplete sockets can be  set  using /proc/sys/net/ipv4/tcp_max_syn_backlog.   When  syncookies  are enabled there is no logical maximum length and this setting is ignored.  See tcp(7) for more information.

/usr/share/doc/kernel-doc-4.18.0-513.5.1.el8_9/Documentation/networking/ip-sysctl.txt:

somaxconn - INTEGER
        Limit of socket listen() backlog, known in userspace as SOMAXCONN.
        Defaults to 128.  See also tcp_max_syn_backlog for additional tuning
        for TCP sockets.

Environment

  • Red Hat Enterprise Linux 8
  • tuned-2.20.0-1.el8 or later

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content