Configuration Guide Vol. 2


21.3.4 How to adjust the sample rate of sFlow statistic

When the sFlow statistics functionality is used on the Switch, the sampling interval can be adjusted as explained below.

<Structure of this section>

(1) Adjust from the line speed

When the rate of traffic (pps) of all ports on which the sFlow statistics functionality is enabled is checked by using the show interfaces command and received packets are to be collected as statistics, add the value of Input rate. If sent packets are to be collected, add the value of Output rate as well. The value calculated by dividing the total value by 100 gives a sampling interval. Set the sampling interval using this value, and then use the show sflow command to make sure that the number of packets to be discarded does not increase.

The following is an example of the sampling interval that is used as a guideline when receiving packets for ports 1/0/4 and 1/0/5.

Figure 21-12: Result of executing show interfaces command
> show interfaces gigabitethernet 1/0/4
Date 20XX/12/24 17:18:54 UTC
NIF0:
Port4: active up  100BASE-TX full(auto)    0012.e220.ec30
        Time-since-last-status-change:1:47:47
        Bandwidth:10000kbps  Average out:0Mbps  Average in:5Mbps
        Peak out:5Mbps at 15:44:36  Peak in:5Mbps at 15:44:18
        Output rate:       0.0bps         0.0pps
        Input  rate:    4063.5kbps       10.3kpps
        Flow control send   :off
        Flow control receive:off
        TPID:8100
                               :
 
> show interfaces gigabitethernet 1/0/5
Date 20XX/12/24 17:19:34 UTC
NIF0:
Port5: active up  100BASE-TX full(auto)    0012.e220.ec31
        Time-since-last-status-change:1:47:47
        Bandwidth:10000kbps  Average out:5Mbps  Average in:5Mbps
        Peak out:5Mbps at 15:44:36  Peak in:5Mbps at 15:44:18
        Output rate:    4893.5kbps       16.8kpps
        Input  rate:    4893.5kbps       16.8kpps
        Flow control send   :off
        Flow control receive:off
        TPID:8100
                               :
Sampling interval to be used as a guideline

= Total PPS value of the ports on which the sFlow statistics functionality is enabled / 100

= (10.3 kpps + 16.8 kpps) / 100

= 271 #

#: When the sampling interval is set to 271, the operation is actually performed with the sampling interval set to 512. For details about the sampling interval, see the description of the sflow sample configuration command.

(2) Adjusting from Detailed Information

Sets the value for Sampling rate to collector (recommended sampling interval in which no packets are discarded) displayed by executing the show sflow detail command as the sampling interval. Next, execute the clear sflow statistics command to check the behavior for a while. If, after this time, the Sampling rate to collector value is still larger than the setting, use the same procedure to adjust the sampling interval again.

Figure 21-13: Result of executing show sflow detail command
> show sflow detail
Date 20XX/12/21 20:04:01 UTC 
sFlow service status: enable
Progress time from sFlow statistics cleared:  8:00:05
                           :
   Collector IP address: 192.168.4.203  UDP:65535  Source IP address: 130.130.130.1
   Send FlowSample UDP packets   : 12077  Send failed packets:     0
   Send CounterSample UDP packets:   621  Send failed packets:     0
Detail data :
   Max packet size: 1400 bytes
   Packet information type: header
   Max header size: 128 bytes
   Extended information type: switch,router,gateway,user,url
   Url port number: 80,8080
   Sampling mode: random-number
   Sampling rate to collector: 1 per 2163 packets
   Target ports for CounterSample: 1/0/2-4