Increasing the maximum number of tcp/ip connections in linux
2011-05-27 10:22
501 查看
Maximum number of connections are impacted by certain limits on both client & server sides, albeit a little differently.
On the client side:Increase the ephermal port range, and decrease the fin_timeout To find out the default values:
[/code]
The ephermal port range defines the maximum number of outbound sockets a host can create from a particular I.P. address. The fin_timeout defines the minimum time these sockets will stay in TIME_WAIT state (unusable after being used once).Usual system defaults are:
net.ipv4.ip_local_port_range = 32768 61000
net.ipv4.tcp_fin_timeout = 60This basically means your system cannot guarantee more than (61000 - 32768) / 60 = 470 sockets at any given time. If you are not happy with that, you could begin with increasing the port_range. Setting the range to 15000 61000 is pretty common these days. You could further increase the availability by decreasing the fin_timeout. Suppose you do both, you should see over 1500 outbound connections, more readily.
On the Server Side:The net.core.somaxconn value has an important role. It limits the maximum number of requests queued to a listen socket. If you are sure of your server application's capability, bump it up from default 128 to something like 128 to 1024. Now you can take advantage of this increase by modifying the listen backlog variable in your application's listen call, to an equal or higher integer.
txqueuelen parameter of your ethernet cards also have a role to play. Default values are 1000, so bump them up to 5000 or even more if your system can handle it.
Similarly bump up the values for net.core.netdev_max_backlog and net.ipv4.tcp_max_syn_backlog. Their default values are 1000 and 1024 respectively.
Now remember to start both your client and server side applications by increasing the FD ulimts, in the shell.
On the client side:Increase the ephermal port range, and decrease the fin_timeout To find out the default values:
sysctl net.ipv4.ip_local_port_range sysctl net.ipv4.tcp_fin_timeout
[/code]
The ephermal port range defines the maximum number of outbound sockets a host can create from a particular I.P. address. The fin_timeout defines the minimum time these sockets will stay in TIME_WAIT state (unusable after being used once).Usual system defaults are:
net.ipv4.ip_local_port_range = 32768 61000
net.ipv4.tcp_fin_timeout = 60This basically means your system cannot guarantee more than (61000 - 32768) / 60 = 470 sockets at any given time. If you are not happy with that, you could begin with increasing the port_range. Setting the range to 15000 61000 is pretty common these days. You could further increase the availability by decreasing the fin_timeout. Suppose you do both, you should see over 1500 outbound connections, more readily.
On the Server Side:The net.core.somaxconn value has an important role. It limits the maximum number of requests queued to a listen socket. If you are sure of your server application's capability, bump it up from default 128 to something like 128 to 1024. Now you can take advantage of this increase by modifying the listen backlog variable in your application's listen call, to an equal or higher integer.
txqueuelen parameter of your ethernet cards also have a role to play. Default values are 1000, so bump them up to 5000 or even more if your system can handle it.
Similarly bump up the values for net.core.netdev_max_backlog and net.ipv4.tcp_max_syn_backlog. Their default values are 1000 and 1024 respectively.
Now remember to start both your client and server side applications by increasing the FD ulimts, in the shell.
相关文章推荐
- "Your computer could not be joined to the domain. You have exceeded the maximum number of computer accounts you are allowed to create in this domain. Contact your system administrator to have this limit reset or increased."
- proxool--高并发异常:We are already in the process of making 11 connections and the number of simultaneous
- We are already in the process of making 6 connections and the number of simultan
- The maximum number of processes for the user account running is currently , which can cause performance issues. We recommend increasing this to at least 4096.
- LINUX AND THE MAXIMUM NUMBER OF PROCESSES (THREADS)
- 增加Linux最大打开文件数/文件描述符 https://www.centos.bz/2012/05/linux-increase-the-maximum-number-of-open-files/
- Change the value of "Maximum number of concurrent connections" about SQL Server 2012
- We are already in the process of making 11 connections and the number of simultaneous builds has be
- We are already in the process of making 11 connections and the number of simultaneous builds has been throttled to 10
- tomcat consider increasing the maximum size of the cache java.lang.IncompatibleClassChangeError: Imp
- exchange2013警告The maximum number of concurrent connections has exceeded a limit
- Some text formatting may have changed in this file because the maximum number of fonts was exceeded解决办法
- How to count the number of threads in a process on Linux
- The terminal server has exceeded the maximum number of allowed connections
- poi导出excel报The maximum number of cell styles was exceeded. You can define up to 4000 styles in a .xl
- Linux Increase The Maximum Number Of Open Files / File Descriptors (FD)
- ERROR The terminal server has exceeded the maximum number of allowed connections
- The Maximum Number of Bytes Per Row in SQL Server 2000 -- 8060.
- 【POI】导出xls文件报错:The maximum number of cell styles was exceeded. You can define up to 4000 styles in a .xls workbook
- The terminal server has exceeded the maximum number of allowed connections