sflow sample

Changes the default sampling rate.
Syntax
sflow sample num
no sflow sample num
Command Default

The default sampling rate is 4096 packets.

Parameters
num
Specifies the average number of packets from which each sample is taken. The software rounds the value that you enter to the next higher odd power of 2. Refer to the Usage Guidelines section for information on the range of supported values.
Modes

Global configuration mode

Interface configuration mode

LAG configuration mode

Usage Guidelines

For RUCKUS ICX 8200 and ICX 8100 devices, the command is supported in global configuration mode only.

The value range for the sampling rate is from 256 through 16777215

The sampling rate is a fraction in the form 1/N, meaning that, on average, one out of every N packets is sampled. The sflow sample command specifies N, the denominator of the fraction. Thus a higher number for the denominator means a lower sampling rate because fewer packets are sampled. Likewise, a lower number for the denominator means a higher sampling rate because more packets are sampled. For example, if you change the denominator from 4096 to 2048, the sampling rate increases because four times as many packets are sampled.

Note: Ruckus recommends that you do not change the denominator to a value lower than the default. Sampling requires CPU resources. Using a low denominator for the sampling rate can cause high CPU utilization.

The CPU-bound sFlow sample packets are rate-limited to 50 samples per second to avoid high CPU utilization.

The sampling rate must be set depending on input traffic rate. If the input traffic rate is more on the interface, the sampling rate must be configured to a higher value to keep the number of sample packets within the CPU rate limit. Else, the excess sample packets are dropped by the CPU.

The following examples show the ideal sample rate configurations for various input rates that keep the sample packets within the CPU rate limit.

  • If the input traffic rate is 200,000 packets/sec, the interface sample rate must be set to 4096. (200000/4096 = less than 50 samples)
  • If the input traffic rate is 400,000 packets/sec, the interface sample rate must be set to 8192. (400000/8192 = less than 50 samples)

You cannot change a module's sampling rate directly. You can change a module's sampling rate only by changing the sampling rate of a port on that module.

You can configure an individual port to use a different sampling rate than the global default sampling rate. This is useful when ports have different bandwidths.

You can configure individual LAG ports to use a different sampling rate than the global default sampling rate. For a keep-alive LAG, sFlow can be enabled only at the interface level and not at the LAG level.

When configuring the sample rate, if you configure the value as 1000, the software rounds the value to the next higher odd power of 2; so the actual rate is 2^11 (2048), and 1 in 2048 packets are sampled by the hardware.

The no form of the command resets the sampling rate to the default value.

Examples

The following example changes the default (global) sampling rate.

device(config)# sflow sample 2048

The following example changes the sampling rate on an individual port.

device(config)# interface ethernet 1/1/1
device(config-if-e1000-1/1/1)# sflow sample 8192

The following example enables an sFlow sample rate in a LAG configuration.

device(config)# lag blue static id 1
device(config-lag-blue)# sflow sample 512