Chapter 28. Reducing TCP performance spikes
Generating TCP timestamps can result in TCP performance spikes. The sysctl command controls the values of TCP related entries, setting the timestamps kernel parameter found at /proc/sys/net/ipv4/tcp_timestamps.
Prerequisites
- You have administrator privileges.
28.1. Turning off TCP timestamps Copy linkLink copied to clipboard!
Turning off TCP timestamps can reduce TCP performance spikes.
Procedure
Turn off TCP timestamps:
sysctl -w net.ipv4.tcp_timestamps=0 net.ipv4.tcp_timestamps = 0
# sysctl -w net.ipv4.tcp_timestamps=0 net.ipv4.tcp_timestamps = 0Copy to Clipboard Copied! Toggle word wrap Toggle overflow The output shows that the value of
net.ip4.tcp_timestampsoptions is0. That is, TCP timestamps are disabled.
28.2. Turning on TCP timestamps Copy linkLink copied to clipboard!
Generating timestamps can cause TCP performance spikes. You can reduce TCP performance spikes by disabling TCP timestamps. If you find that generating TCP timestamps is not causing TCP performance spikes, you can enable them.
Procedure
Enable TCP timestamps.
sysctl -w net.ipv4.tcp_timestamps=1 net.ipv4.tcp_timestamps = 1
# sysctl -w net.ipv4.tcp_timestamps=1 net.ipv4.tcp_timestamps = 1Copy to Clipboard Copied! Toggle word wrap Toggle overflow The output shows that the value of
net.ip4.tcp_timestampsis1. That is, TCP timestamps are enabled.
28.3. Displaying the TCP timestamp status Copy linkLink copied to clipboard!
You can view the status of TCP timestamp generation.
Procedure
Display the TCP timestamp generation status:
sysctl net.ipv4.tcp_timestamps net.ipv4.tcp_timestamps = 0
# sysctl net.ipv4.tcp_timestamps net.ipv4.tcp_timestamps = 0Copy to Clipboard Copied! Toggle word wrap Toggle overflow The value
1indicates that timestamps are being generated. The value0indicates timestamps are being not generated.