Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

6.13. Better manage your TCP/IP resources

This hack just make the time default values for TCP/IP connection lower so that more connections can be handled by time on your TCP/IP protocol. The following will decrease the amount of time your Linux box will try take to finish closing a connection and the amount of time before it will kill a stale connection. This will also turn off some IP extensions that aren't needed. The default setup for the TCP/IP parameters we'll change under Red Hat Linux are:

  • For the tcp_fin_timeout 180

  • For the tcp_keepalive_time 7200

  • For the tcp_window_scaling 1

  • For the tcp_sack 1

  • For the tcp_timestamps 1

To adjust the new TCP/IP values, type the following commands on your terminal:

             [root@deep] /#echo 30 >/proc/sys/net/ipv4/tcp_fin_timeout 
             [root@deep] /#echo 1800 >/proc/sys/net/ipv4/tcp_keepalive_time 
             [root@deep] /#echo 0  >/proc/sys/net/ipv4/tcp_window_scaling 
             [root@deep] /#echo 0  >/proc/sys/net/ipv4/tcp_sack 
             [root@deep] /#echo 0  >/proc/sys/net/ipv4/tcp_timestamps
             
Execute the above commands and put them in your /etc/rc.d/rc.local file so you don't need to type them again each time your system reboots.

Version 6.2 only

Edit the /etc/sysctl.conf file and add the following lines:
             # Decrease the time default value for tcp_fin_timeout connection
             net.ipv4.tcp_fin_timeout = 30
             # Decrease the time default value for tcp_keepalive_time connection
             net.ipv4.tcp_keepalive_time = 1800
             # Turn off the tcp_window_scaling
             net.ipv4.tcp_window_scaling = 0
             # Turn off the tcp_sack
             net.ipv4.tcp_sack = 0
             # Turn off the tcp_timestamps
             net.ipv4.tcp_timestamps = 0
             
You must restart your network for the change to take effect. The command to manually restart the network is the following:
             [root@deep] /# /etc/rc.d/init.d/network restart
             

Setting network parameters [ OK ] Bringing up interface lo [ OK ] Bringing up interface eth0 [ OK ] Bringing up interface eth1 [ OK ]

 
 
  Published under the terms of the Open Publication License Design by Interspire