The log-threshold input-discard command sets the threshold for packet loss caused by congestion and interval for collecting statistics on discarded packets in the inbound direction of an interface.
The log-threshold output-discard command sets the threshold for packet loss caused by congestion and interval for collecting statistics on discarded packets in the outbound direction of an interface.
The undo log-threshold input-discard command restores the default settings.
The undo log-threshold output-discard command restores the default settings.
By default, the threshold for packet loss caused by congestion in the inbound or outbound direction of an interface is 300, and the interval for collecting statistics on discarded packets in the inbound or outbound direction of an interface is 300s.
log-threshold { input-discard | output-discard } [ threshold-value interval interval-value ]
undo log-threshold { input-discard | output-discard }
Parameter | Description | Value |
---|---|---|
input-discard |
Records logs about packet loss caused by congestion in the inbound direction of an interface. |
- |
output-discard |
Records logs about packet loss caused by congestion in the outbound direction of an interface. |
- |
threshold-value |
Specifies the packet loss threshold for triggering a log. |
The value is an integer in the range from 100 to 4294967295. |
interval interval-value |
Specifies the interval for collecting statistics on discarded packets due to congestion. |
The value is an integer in the range from 60 to 86400, in seconds. |
Ethernet interface view, GE interface view, XGE interface view, 25GE interface view, MultiGE interface view, 40GE interface view, 100GE interface view, port group view
Usage Scenario
Network congestion during service transmission may cause packet loss. If a lot of packets are discarded, services are affected. To better monitor the number of discarded packets, you can run the log-threshold output-discard or log-threshold input-discard command to set the threshold for packet loss caused by congestion and interval for collecting statistics on discarded packets in the inbound or outbound direction of an interface. The device generates a log when the number of discarded incoming and outgoing packets on the interface in a specified period exceeds the threshold. Logs help you know the congestion on the interface. You can determine whether to increase the bandwidth or cancel the bandwidth limit on the interface based on the logs. In this way, the congestion problem can be solved.
Precautions
If the number of discarded packets exceeds the threshold in an interval for collecting statistics on discarded packets, the device immediately generates a log indicating that the number of discarded packets exceeds the threshold, and enters the next statistics interval. In the next statistics interval, the number of discarded packets on an interface is calculated using the following formula:
Number of discarded packets = Current number of discarded packets - Number of discarded packets in the beginning of the statistics interval
# Set the threshold for packet loss caused by congestion to 100 and interval for collecting statistics on discarded packets to 60 seconds in the inbound direction of GE0/0/1.
<HUAWEI> system-view [HUAWEI] interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1] log-threshold input-discard 100 interval 60