Translated message

A translation of this page exists in English.

RHEL8 の tuned.service で net.core.somaxconn を 2048 に設定したが、一部のサービスで設定が機能しない

Solution In Progress - Updated -

Issue

  • tuned.service で net.core.somaxconn を 2048 に設定しましたが、一部のサービスで設定が機能しません。
  • tuned.service および httpd.service のサンプル:
# 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))

リッスンバックログを ListenBackLog のデフォルト値である 511 に設定するために、ここで httpd.service を再起動する必要があります。

man listen(2) より抜粋:

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 以降

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