- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- LINUX Max Socket Connections Queue
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-03-2009 12:10 AM
тАО12-03-2009 12:10 AM
Can someone help me how to determine max socket connection queue in Linux?
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-03-2009 01:36 AM
тАО12-03-2009 01:36 AM
SolutionThese parameters are visible as files in /proc/sys/net, and root can directly write new values to them to make changes immediately, and/or use /etc/sysctl.conf to make the changes persist through system reboots. Please see also "man sysctl".
----
/proc/sys/net/ipv4/tcp_max_syn_backlog:
Maximal number of remembered connection requests, which are still did not receive an acknowledgment from connecting client.
Default value is 1024 for systems with more than 128Mb of memory, and 128 for low memory machines. If server suffers of overload, try to increase this number.
/proc/sys/net/core/somaxconn:
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.
----
In /etc/sysctl.conf file, you're supposed to omit /proc/sys from the beginning of the parameter pathnames and replace all slashes with dots. So, in /etc/sysctl.conf, these parameters should be expressed as:
net.core.somaxconn
net.ipv4.tcp_max_syn_backlog
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-03-2009 02:00 AM
тАО12-03-2009 02:00 AM
Re: LINUX Max Socket Connections Queue
One more thing, would you know how i can monitor the usage?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-03-2009 04:24 PM
тАО12-03-2009 04:24 PM
Re: LINUX Max Socket Connections Queue
BTW, the actual limit may be lower than those sysctls depending on what the application passes-in on a listen() call.
PPS - these are queued/pending connections, not a limit to the total number of sockets (connected or otherwise) in the system.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-03-2009 09:45 PM
тАО12-03-2009 09:45 PM
Re: LINUX Max Socket Connections Queue
Actually, server being investigated is a postgre application system that has too many connections.
This server already rebooted for 4-6 times for the past 5 days and we have been seeing too many TIME_WAIT, CLOSE_WAITs status via netstat.
Our developer is currently looking at the connection parameters that we could tune on the server.
Not sure if related to the following messages seend on /var/log/messages
[root@`hostname` log]# grep segfault messages*
messages:Nov 30 18:48:52 SPCC1 kernel: sshd[8228]: segfault at 0000000000000000 rip 00000000002842dc rsp 00000000ffffd05c error 4
messages:Nov 30 21:30:33 SPCC1 kernel: sshd[19165]: segfault at 0000000000000000 rip 00000000002842dc rsp 00000000ffffd05c error 4
messages:Nov 30 23:56:35 SPCC1 kernel: sshd[25822]: segfault at 0000000000000000 rip 00000000002842dc rsp 00000000ffffd05c error 4
messages:Dec 1 09:42:06 SPCC1 kernel: sshd[7869]: segfault at 0000000000000000 rip 00000000002842dc rsp 00000000ffffd05c error 4
messages:Dec 1 12:55:05 SPCC1 kernel: sshd[13884]: segfault at 0000000000000000 rip 00000000002842dc rsp 00000000ffffd05c error 4
messages:Dec 3 17:38:27 SPCC1 kernel: spcc_core.exe[27857]: segfault at 0000007fc6de5b20 rip 0000000000409d3a rsp 0000007fbff7d450 error 4
messages:Dec 4 08:31:15 SPCC1 kernel: sshd[24187]: segfault at 0000000000000000 rip 00000000002842dc rsp 00000000ffffd05c error 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-04-2009 09:32 AM
тАО12-04-2009 09:32 AM
Re: LINUX Max Socket Connections Queue
I could see where an sshd dying would leave behind a TIME_WAIT - in theory the kernel will close all the file descriptors when the process dies and TIME_WAIT is there to protect new connections with the same "name" (local/remote IP, local/remote port) from inadvertently accepting old, delayed segmnets from previous connections. That would be doubplebpluungood as it can lead to silent data corruption.
CLOSE_WAIT though is the state TCP enters when it has received and ACKed the remote's FINished segment and is now waiting for the local side to call close() or shutdown(). From "our" perspective a CLOSE_WAIT connection is a simplex connection where we can send data to the remote, but the remote will not be sending us data. The remote in this case should be in FIN_WAIT_2.