< Home

metric (real server group view)

Function

The metric command configures the load balancing algorithm.

Format

metric { roundrobin | weight-roundrobin | least-connection | weight-least-connection | source-ip-hash | weight-source-ip-hash }

Parameters

Parameter Description Value
roundrobin

Indicates the round robin algorithm.

-

weight-roundrobin

Indicates the weighted round robin algorithm.

-

least-connection

Indicates the least connections algorithm.

-

weight-least-connection

Indicates the weighted least connections algorithm.

-

source-ip-hash

Indicates the source ip hash algorithm.

-

weight-source-ip-hash

Indicates the weighted source ip hash algorithm.

-

Views

Real server group view

Default Level

2: Configuration level

Usage Guidelines

The default algorithm is round robin (roundrobin). One real server group can use only one load balancing algorithm.

If real servers have different performance, use a weighted load balancing algorithm (weight-roundrobin, weight-least-connection, or weight-source-ip-hash) and set weights for each real server.

Example

# Configure the least connections algorithm as the load balancing algorithm.

<sysname> system-view
[sysname] slb
[sysname-slb] group 1 grp1
[sysname-slb-group-1] metric least-connection
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >