Change the TCP Window Size on linux

Source: Internet
Author: User

Use the route command. There are many tool parameters such as ifconfig, route, and ip. If you have any problems, you should check the parameters of these tools. The change in the window size has a significant impact on the performance of FTP and other programs.

[Root @ jcwkyl ipv4] # route del-net 10.60.56.0/24

[Root @ jcwkyl ipv4] # route add-net 10.60.56.0/24 window 4096 dev eth0

[Root @ jcwkyl ipv4] # route-n

Kernel IP routing table

Destination
Gateway
Genmask Flags Metric
Ref Use Iface

10.60.56.0
0.0.0.0
255.255.255.0 U
0
0 0 eth0

169.254.0.0
0.0.0.0
255.255.0.0 U
0
0 0 eth0

0.0.0.0
10.60.56.254
0.0.0.0
UG 0
0 0 eth0

[Root @ jcwkyl ipv4] # netstat-r

Kernel IP routing table

Destination
Gateway
Genmask
Flags MSS Window irtt Iface

10.60.56.0
*
255.255.255.0
U 0
4096 0 eth0

169.254.0.0
*
255.255.0.0
U 0
0 0 eth0

Default
10.60.56.254
0.0.0.0
UG 0
0 0 eth0


[Root @ jcwkyl ipv4] # route del default gw 10.60.56.254

[Root @ jcwkyl ipv4] # route add default gw 10.60.56.254 window 4096 dev eth0

[Root @ jcwkyl ipv4] # route-n

Kernel IP routing table

Destination
Gateway
Genmask Flags Metric
Ref Use Iface

10.60.56.0
0.0.0.0
255.255.255.0 U
0
0 0 eth0

169.254.0.0
0.0.0.0
255.255.0.0 U
0
0 0 eth0

0.0.0.0
10.60.56.254
0.0.0.0
UG 0
0 0 eth0

[Root @ jcwkyl ipv4] # netstat-r

Kernel IP routing table

Destination
Gateway
Genmask
Flags MSS Window irtt Iface

10.60.56.0
*
255.255.255.0
U 0
4096 0 eth0

169.254.0.0
*
255.255.0.0
U 0
0 0 eth0

Default
10.60.56.254
0.0.0.0
UG 0
4096 0 eth0

You also need to turn off scalable, that is:
[Root @ jcwkyl IPv4] # Echo 0>/proc/sys/NET/IPv4/tcp_window_scaling

If you want this change to take effect after restart, you can add the following line to the/etc/sysctl. conf file:
Net. ipv4.tcp _ window_scaling = 0

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.