Simulate network anomaly test

The online network will encounter various problems, such as network disconnection, network delay, packet loss, etc. Generally, network disconnection operation and maintenance can be found and solved in time. The most fearful thing is the latter two situations. The system may continue to request timeouts, and then continue to apply for new connections. The final result is that the ports are exhausted and the system is dead. Therefore, in order to simulate these situations, tc can be used to simulate network anomalies and perform targeted stress testing on the system under test.

This command sets the transmission of the eth0 NIC to be sent with a delay of 100ms

tc qdisc add dev eth0 root netem delay 100ms

This command deletes the transport settings of the eth0 network card

tc qdisc del dev eth0 root netem delay 100ms

tc qdisc add dev eth0 root netem loss 1%

This command sets the transmission of the eth0 NIC to randomly drop 1% of the packets

tc qdisc add dev eth0 root netem loss 10%

This command sets the transmission of the eth0 network card to randomly drop 1% of the packets, with a success rate of 30%

tc qdisc add dev eth0 root netem loss 1% 30%

View the configured network conditions: # tc qdisc show dev eth0

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326869362&siteId=291194637