シスコサポートコミュニティ
キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

ACE: lb-stats の基本的な確認方法(sfarm)

負荷分散装置の基本機能である、predictor algorithm を中心に show np # lb-stats コマンドの確認方法について説明します。

np が複数ある ACE30 を用いると、コマンドの確認が面倒なので、今回はnp が 1 つしかない ACE4710 を使用します。

rserver はs1, s2 という 2 つのサーバを用意し、weight コマンドで重みづけを行っています。

default weight は 8 なので、s1:s2=2:1 となります。

serverfarm の default predictor は roundrobin なので、2:1 の割合で s1, s2 を選択することになります。

ACE4710/Admin# show run rserver

Generating configuration....

rserver host s1

  ip address 192.168.78.41

  weight 16

  inservice

rserver host s2

  ip address 192.168.78.42

  inservice

ACE4710/Admin# sh run serverfarm sf_http

Generating configuration....

serverfarm host sf_http

  rserver s1 80

    inservice

  rserver s2 80

    inservice

設定直後の np の状態は下記になります。

weight を設定すると Bal Meth は WEIGHTED になります。

ACE4710/Admin# sh np 1 lb-stats sfarm sf_http

==================================

Fri Mar 22 02:24:06 2013

LB is configured to consume 180893504 bytes of memory.

Physical SRAM Address = 0x237bfe00

Virtual SRAM Address = 0x237bfe00

Virtual DRAM address = 0x320d5000

Server Farm ID = 4, offset = 0x0007c400

Bank A = 0x320d5000                     Bank B(*) = 0x321a5400

  Address   = 0x32151500                  Address   = 0x32221900

  Bal Meth  = ROUND ROBIN                 Bal Meth  = WEIGHTED

  Bkup id   = 0                           Bkup id   = 0

  IPV4 Hash NetM = 0xffffffff             IPV4 Hash NetM = 0xffffffff

  IPV6 Hash Prefix = 0                    IPV6 Hash Prefix = 0

  Slow St   = 0                           Slow St   = 0

  Flags     = 0x0                         Flags     = 0x0

  pRSList   = 0x3270bdd0                  pRSList   = 0x3270bdc8

  Seq count = 2                           Seq count = 2

  Auto Adjust = 0                         Auto Adjust = 0

  DWS Cfg State = 0                       DWS Cfg State = 0

RS List (Bank A) @ 0x3270bdd0  = 4 5

RS List (Bank B) @ 0x3270bdc8  = 4 5

Showing SFarm 4 Stats [context 0] [Base 0x3503dc00] [Address 0x3503dcb0]

  Current Conn Cnt    = 0

  Total Conn Drop Cnt = 0

  Sfarm Average Load  = 0

  Flags               = 0x00000000

  Good List Addr    = 0x34f05fc0

Goodlist List @ 0x34f05fc0  = 4 5

NP NUM = 1

==================================

ACE4710/Admin#

RoundRobin (含 Weighted RoundRobin) の場合、Goodlist List に表示された RS ID の順に rserver が選択されます。

RS ID は show cfgmgr internal table sfarm-real コマンドで確認可能です。

ACE 内部では rserver や serverfarm 等、自分で設定する名前には ID が付与され、この番号で管理しています。

今回の場合、s1 が RSID4 で s2 が RSID5 になっています。

ACE4710/Admin# sh cfgmgr internal table sfarm-real | i sf_http

4          s1               80     sf_http          0      DATA_VALID,

5          s2               80     sf_http          0      DATA_VALID,

ACE4710/Admin#

この状態で traffic を流すと、RS ID 4 が選択されます。

実際に traffic を流した後の状態を確認すると、Goodlist の RSID は下記のように遷移します。

2:1 の割合で RSID4 が前に来ていることが確認でき、実際に weight 16 と 8 の rserver それぞれへ 2:1 の割合で転送していることが確認できます。

## リクエスト送信前

ACE4710/Admin# show serverfarm sf_http | i 192

       192.168.78.41:80      16  OPERATIONAL     0          0          0

       192.168.78.42:80      8   OPERATIONAL     0          0          0

ACE4710/Admin#

ACE4710/Admin# sh np 1 lb-stats sfarm sf_http | i Goodlist

Goodlist List @ 0x34f05fc0  = 4 5

## リクエスト送信 1

ACE4710/Admin# show serverfarm sf_http | i 192

       192.168.78.41:80      16  OPERATIONAL     1          1          0

       192.168.78.42:80      8   OPERATIONAL     0          0          0

ACE4710/Admin#

ACE4710/Admin# sh np 1 lb-stats sfarm sf_http | i Goodlist

Goodlist List @ 0x34f05fc0  = 4 5

## リクエスト送信 2

ACE4710/Admin# show serverfarm sf_http | i 192

       192.168.78.41:80      16  OPERATIONAL     2          2          0

       192.168.78.42:80      8   OPERATIONAL     0          0          0

ACE4710/Admin#

ACE4710/Admin# sh np 1 lb-stats sfarm sf_http | i Goodlist

Goodlist List @ 0x34f060b0  = 5 4

## リクエスト送信 3

ACE4710/Admin# show serverfarm sf_http | i 192

       192.168.78.41:80      16  OPERATIONAL     2          2          0

       192.168.78.42:80      8   OPERATIONAL     1          1          0

ACE4710/Admin#

ACE4710/Admin# sh np 1 lb-stats sfarm sf_http | i Goodlist

Goodlist List @ 0x34f05fc0  = 4 5

## リクエスト送信 4

ACE4710/Admin# show serverfarm sf_http | i 192

       192.168.78.41:80      16  OPERATIONAL     3          3          0

       192.168.78.42:80      8   OPERATIONAL     1          1          0

ACE4710/Admin#

ACE4710/Admin# sh np 1 lb-stats sfarm sf_http | i Goodlist

Goodlist List @ 0x34f05fc0  = 4 5

## リクエスト送信 5

ACE4710/Admin# show serverfarm sf_http | i 192

       192.168.78.41:80      16  OPERATIONAL     4          4          0

       192.168.78.42:80      8   OPERATIONAL     1          1          0

ACE4710/Admin#

ACE4710/Admin# sh np 1 lb-stats sfarm sf_http | i Goodlist

Goodlist List @ 0x34f060b0  = 5 4

## リクエスト送信 6

ACE4710/Admin# show serverfarm sf_http | i 192

       192.168.78.41:80      16  OPERATIONAL     4          4          0

       192.168.78.42:80      8   OPERATIONAL     2          2          0

ACE4710/Admin#

ACE4710/Admin# sh np 1 lb-stats sfarm sf_http | i Goodlist

Goodlist List @ 0x34f05fc0  = 4 5

ちなみに、この状態で RSID4 の rserver s1 を no inservice にすると、

ACE4710/Admin# conf t

Enter configuration commands, one per line.  End with CNTL/Z.

ACE4710/Admin(config)# rserver s1

ACE4710/Admin(config-rserver-host)# no in

ACE4710/Admin(config-rserver-host)# end

ACE4710a-yushimaz/Admin#

ACE4710a-yushimaz/Admin# sh np 1 lb-stats sfarm sf_http

==================================

Fri Mar 22 02:52:13 2013

LB is configured to consume 180893504 bytes of memory.

Physical SRAM Address = 0x237bfe00

Virtual SRAM Address = 0x237bfe00

Virtual DRAM address = 0x320d5000

Server Farm ID = 4, offset = 0x0007c400

Bank A(*) = 0x320d5000                  Bank B = 0x321a5400

  Address   = 0x32151500                  Address   = 0x32221900

  Bal Meth  = WEIGHTED                    Bal Meth  = FP ROUND ROBIN

  Bkup id   = 0                           Bkup id   = 0

  IPV4 Hash NetM = 0xffffffff             IPV4 Hash NetM = 0xffffffff

  IPV6 Hash Prefix = 0                    IPV6 Hash Prefix = 0

  Slow St   = 0                           Slow St   = 0

  Flags     = 0x0                         Flags     = 0x0

  pRSList   = 0x3270bdd0                  pRSList   = 0x3270bdc8

  Seq count = 2                           Seq count = 2

  Auto Adjust = 0                         Auto Adjust = 0

  DWS Cfg State = 0                       DWS Cfg State = 0

RS List (Bank A) @ 0x3270bdd0  = *4 5

RS List (Bank B) @ 0x3270bdc8  = 4 5

Showing SFarm 4 Stats [context 0] [Base 0x3503dc00] [Address 0x3503dcb0]

  Current Conn Cnt    = 0

  Total Conn Drop Cnt = 0

  Sfarm Average Load  = 0

  Flags               = 0x00000000

  Good List Addr    = 0x34f05fc0

Goodlist List @ 0x34f05fc0  = 4 5

NP NUM = 1

==================================

上記のように変更を行った RSID 4 の前に * が付きます。 (まだこの時は Goodlist List は更新されていません。)

この状態でリクエストを送信すると、このリクエストは RSID 5 に転送され、Goodlist List も更新され、RSID 5 のみになります。

ACE4710/Admin# show serverfarm sf_http | i 192

       192.168.78.41:80      16  OUTOFSERVICE    0          4          0

       192.168.78.42:80      8   OPERATIONAL     1          3          0

ACE4710/Admin# sh np 1 lb-stats sfarm sf_http

==================================

Fri Mar 22 02:52:40 2013

LB is configured to consume 180893504 bytes of memory.

Physical SRAM Address = 0x237bfe00

Virtual SRAM Address = 0x237bfe00

Virtual DRAM address = 0x320d5000

Server Farm ID = 4, offset = 0x0007c400

Bank A(*) = 0x320d5000                  Bank B = 0x321a5400

  Address   = 0x32151500                  Address   = 0x32221900

  Bal Meth  = FP ROUND ROBIN              Bal Meth  = FP ROUND ROBIN

  Bkup id   = 0                           Bkup id   = 0

  IPV4 Hash NetM = 0xffffffff             IPV4 Hash NetM = 0xffffffff

  IPV6 Hash Prefix = 0                    IPV6 Hash Prefix = 0

  Slow St   = 0                           Slow St   = 0

  Flags     = 0x0                         Flags     = 0x0

  pRSList   = 0x3270bdd0                  pRSList   = 0x3270bdc8

  Seq count = 2                           Seq count = 2

  Auto Adjust = 0                         Auto Adjust = 0

  DWS Cfg State = 0                       DWS Cfg State = 0

RS List (Bank A) @ 0x3270bdd0  = *4 5

RS List (Bank B) @ 0x3270bdc8  = 4 5

Showing SFarm 4 Stats [context 0] [Base 0x3503dc00] [Address 0x3503dcb0]

  Current Conn Cnt    = 1

  Total Conn Drop Cnt = 0

  Sfarm Average Load  = 0

  Flags               = 0x00000000

  Good List Addr    = 0x34f060b0

Goodlist List @ 0x34f060b0  = 5

NP NUM = 1

==================================

predictor に roundrobin を使用した場合、上記 Goodlist を使用しますが、leastconns の場合、List 表示が下記のように変わります。

ACE4710/Admin# conf t

Enter configuration commands, one per line.  End with CNTL/Z.

ACE4710/Admin(config)# serverfarm host sf_http

ACE4710/Admin(config-sfarm-host)# predictor leastconns

ACE4710/Admin(config-sfarm-host)# end

ACE4710/Admin#

ACE4710/Admin# sh np 1 lb-stats sfarm sf_http

==================================

Fri Mar 22 03:08:30 2013

LB is configured to consume 180893504 bytes of memory.

Physical SRAM Address = 0x237bfe00

Virtual SRAM Address = 0x237bfe00

Virtual DRAM address = 0x320d5000

Server Farm ID = 4, offset = 0x0007c400

Bank A(*) = 0x320d5000                  Bank B = 0x321a5400

  Address   = 0x32151500                  Address   = 0x32221900

  Bal Meth  = FP ROUND ROBIN              Bal Meth  = WEIGHTED

  Bkup id   = 0                           Bkup id   = 0

  IPV4 Hash NetM = 0xffffffff             IPV4 Hash NetM = 0xffffffff

  IPV6 Hash Prefix = 0                    IPV6 Hash Prefix = 0

  Slow St   = 0                           Slow St   = 0

  Flags     = 0x0                         Flags     = 0x0

  pRSList   = 0x3270bdb8                  pRSList   = 0x3270bdc8

  Seq count = 2                           Seq count = 2

  Auto Adjust = 0                         Auto Adjust = 0

  DWS Cfg State = 0                       DWS Cfg State = 0

RS List (Bank A) @ 0x3270bdb8  = 4 5

RS List (Bank B) @ 0x3270bdc8  = *4 5

Showing SFarm 4 Stats [context 0] [Base 0x3503dc00] [Address 0x3503dcb0]

  Current Conn Cnt    = 2

  Total Conn Drop Cnt = 0

  Sfarm Average Load  = 0

  Flags               = 0x00000000

  Good List Addr    = 0x34f060b0

Goodlist List @ 0x34f060b0  = 5 4

!__ 設定変更直後はそのまま

NP NUM = 1

==================================

ACE4710/Admin#

ACE4710/Admin# sh np 1 lb-stats sfarm sf_http | b SFarm

Showing SFarm 4 Stats [context 0] [Base 0x3503dc00] [Address 0x3503dcb0]

  Current Conn Cnt    = 3

  Total Conn Drop Cnt = 0

  Sfarm Average Load  = 0

  Flags               = 0x00000001

  Weight Bucket Addr  = 0x79afe110

    Weight  |  RSId

         2        4 5

NP NUM = 1

==================================

ACE4710/Admin#

## しばらく Traffic を流した後

ACE4710/Admin# sh np 1 lb-stats sfarm sf_http | b SFarm

Showing SFarm 4 Stats [context 0] [Base 0x3503dc00] [Address 0x3503dcb0]

  Current Conn Cnt    = 2

  Total Conn Drop Cnt = 0

  Sfarm Average Load  = 0

  Flags               = 0x00000001

  Weight Bucket Addr  = 0x79afe170

    Weight  |  RSId

         1        4

         2        5

NP NUM = 1

==================================


バージョン履歴
改訂番号
1/1
最終更新:
‎03-22-2013 06:09 PM
更新者:
 
タグ(3)