Modify network card cache to solve the problem of losing packets on Linux network card

Source: Internet
Author: User

Modify network card cache to solve the problem of losing packets on Linux network card

Bad packet loss for Linux NIC

Production has a Linux device concurrency is relatively large, droped package more, especially when running the game packet, there is a serious loss of packet phenomenon, suspected network card performance is not enough, before the replacement of equipment can not be solved by software method, through some information on the Internet show that this phenomenon, It is also possible that the NIC buffer size is too small for the reason, so try to change the buffer sizes resolved, the following device has been running for 64 days, the packet dropped more than more than 2 billion

Find some foreign articles, you can modify the network card buffer size through Ethtool, first to support the network card, my server is Intel's 1000M network card, we look at Ethtool instructions
-g–show-ringqueries The specified Ethernet device for RX/TX ring parameter information.
-g–set-ringchanges the Rx/tx ring parameters of the specified Ethernet device.
View the buffer size of the current network adapter
Ring parameters for eth0:
Pre-set maximums:
Rx:4096rx mini:0
RX jumbo:0
tx:4096
Current
hardware settings:
rx:256
RX mini:0
RX jumbo:0
tx:256
because my Rx bag is going to have droped, we use
ETHTOOL-G eth0 Rx 2048

The same is true for eth1 ethtool-g eth1 Rx 2048

And look at the changes.

Ring parameters for eth0:
Pre-set maximums:
rx:4096
RX mini:0
RX jumbo:0
tx:4096
Current
hardware settings:
rx:2048
RX mini:0
RX jumbo:0
tx:2048
A few hours later, there was no increase in the packet loss.

Modify network card cache to solve the problem of losing packets on Linux network card

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.