# queue weighting-constant

Use **queue weighting-constant** to specify an exponent for average queue length calculation for a queue.

Use **undo queue weighting-constant** to restore the default.

## Syntax

**queue** *queue-id* **weighting-constant** *exponent *

**undo ****queue ***queue-id ***weighting-constant**

## Default

The exponent for average queue length calculation is 9.

## Views

WRED table view

## Predefined user roles

network-admin

## Parameters

*queue-id*: Specifies a queue by its ID.

**weighting-constant*** exponent*: Specifies the WRED exponent for average queue length calculation, in the range of 0 to 15.

## Usage guidelines

The bigger the exponent is, the less sensitive the average queue size is to real-time queue size changes. The average queue size is calculated using the formula: average queue size = previous average queue size × (1-2^{-n}) + current queue size × 2^{-n}, where n can be set with the **qos wred weighting-constant** command.

## Examples

# In WRED table **queue-table1**, set the exponent for average queue length calculation to 12 for queue 1.

<Sysname> system-view [Sysname] qos wred queue table queue-table1 [Sysname-wred-table-queue-table1] queue 1 weighting-constant 12

## Related commands

**display qos wred table****qos wred table**