The performance of the test system in Linux has found that the packet loss rate is extremely serious. It sends 210000 pieces of data, and the packet loss rate reaches 110000. The packet loss rate exceeds 50%. In the same case, only a few pieces of data are lost during windows testing. The situation is grim and must be solved. It may be because the protocol stack buffer is too low. So let's first look at the default situation:
Sysctl-A | grep net. Core
Found
Net. Core. rmem_max = 131071
Net. Core. rmem_default = 112640
Change the value to 10 MB, and then reboot (restart a service)
Then check the NIC package status:
Netstat-su
The result is as follows:
UDP:
97690 packets received
112310 packets to unknown port already ed.
0 packet receive errors
20 packets sent
If data is lost on the NIC, the firewall may be the cause of the loss. Therefore, run the following command:
Iptables-l
The result is as follows:
Chain input (Policy accept)
Target prot opt source destination
Chain forward (Policy accept)
Target prot opt source destination
Chain output (Policy accept)
Target prot opt source destination
If iptables is enabled, the firewall is stopped:
Service iptables stop
This command takes effect immediately. The command to enable the firewall is as follows:
Service iptables start
If you want to completely disable the firewall, it will take effect after restart
Enable: chkconfig iptables on
Close: chkconfig iptables off
When the firewall is enabled, make the following settings to enable the relevant ports,
Modify the/etc/sysconfig/iptables file and add the following content:
-A RH-Firewall-1-INPUT-M state -- state new-m tcp-p tcp -- dport 80-J accept
-A RH-Firewall-1-INPUT-M state -- state new-m tcp-p tcp -- dport 22-J accept
Test again without losing a piece of data.