キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 
cancel
1289
閲覧回数
0
いいね!
0
コメント
yushimaz
Cisco Employee
Cisco Employee

ACE の Network Processor (NP) の状態を確認するコマンドとして、show np xxx が多用されますが、A4 になってから、新たに lb-stats というオプションが追加されました。

switch/Admin# show np 1 lb-stats ?

  <WORD>                Options for LbInspectTool utility (Max Size - 80)

  buddy                 Show Lb stats for buddy

  client-cipher         Show Lb stats for client-cipher

  client-map            Show Lb stats for client-map

  client-map-selection  Show Lb stats for default policy

  context               Show Lb stats for context

  cookie-expiry-string  Show Lb stats for cookie expiry string

  default-policy        Show Lb stats for default policy

  member                Show Lb stats for member group

  policy-map            Show Lb stats for policy-map

  retcode               Show Lb stats for retcode

  rserver               Show Lb stats for rserver

  sfarm                 Show Lb stats for serverfarm

  sfarm-real            Show Lb stats for real server

  sticky                Show Lb stats for sticky

  vserver               Show Lb stats for vserver

lb-stats オプションは np 毎の状態を確認するためのコマンドになります。

以前は、Data Plane の問題解析のため、TAC エンジニアに要求され、LbInspectTool というよくわからないコマンドを実行した人もいるかもしれませんが、lb-stats オプションは、これを show コマンドで簡単に出力できるようになったものです。

ACE4710 の場合、np が 1 つしかないため、それほど使用する頻度は高くないですが、ACE module のように複数 np を使用している環境で、各 np の状態を知りたい時に使用します。

例えば、rserver の状態を確認するコマンドとして最も使用するのは show rserver だと思いますが、この出力は各 np から受信した情報の合計値になります。 合計値のみしか確認できないと、ACE: [事例] max-conn に達していないのに packet が drop する のように、show conn と show rserver を比較し、片方の np が max-conn に達していることを確認する必要があり、とても面倒でしたが、lb-stats オプションを使用すると簡単に確認できます。

例えば、下記 rserver の設定ですが、show rserver では、合計の 3 が表示されていますが、np 毎に見てみると、dc1 に実装されている np1, 2 には 2 が、dc2 の np3, 4 には 1 が割り当てられていることが確認できます。

switch/Admin# show running-config rserver s1

Generating configuration....

rserver host s1

  ip address 192.168.32.1

  conn-limit max 3 min 3

  inservice

switch/Admin# show rserver s1 detail

rserver              : s1, type: HOST

state                : OPERATIONAL (verified by arp response)

description          : -

max-conns            : 3         ,  out-of-rotation count  : 0

min-conns            : 3

conn-rate-limit      : -         ,  out-of-rotation count  : -

bandwidth-rate-limit : -         ,  out-of-rotation count  : -

weight               : 8

---------------------------------

                                                ----------connections-----------

       real                  weight state        current    total

   ---+---------------------+------+------------+----------+--------------------

   serverfarm: sf1

       192.168.32.1:80       8      OPERATIONAL  0          0

         max-conns            : 3         ,  out-of-rotation count  : 0

         min-conns            : 3

         conn-rate-limit      : -         ,  out-of-rotation count  : -

         bandwidth-rate-limit : -         ,  out-of-rotation count  : -

         total conn-failures  : 0

         buddy_group          : -

switch/Admin#

switch/Admin# show np 1 lb-stats rserver s1

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

Fri Mar 22 03:36:56 2013

LB is configured to consume 209038144 bytes of memory.

Physical SRAM Address = 0x2372fb00

Virtual SRAM Address = 0x2372fb00

Virtual DRAM address = 0x301d0000

Rserver ID = 1, offset = 0x00079000

Bank A(*) = 0x301d0000                  Bank B = 0x30541000

  Address   = 0x30249020                  Address   = 0x305ba020

  Cfgmap conn_limit = 1                   Cfgmap conn_limit = 0

         conn_rate_limit = 0                     conn_rate_limit = 0

         band_rate_limit = 0                     band_rate_limit = 0

  Max conns = 2                           Max conns = 2147483648

  Min conns = 2                           Min conns = 2147483648

  Conn rate limit = 2147483648            Conn rate limit = 2147483648

  Band rate limit = 1073741824            Band rate limit = 1073741824

Showing Rserver 1 Stats [context 0] [Base 0x33d7a800] [Address 0x33d7a848]

  Current Conn  = 0:0(0:0)                Max Conn OOR  = 0

Conn Rate Cnt = 0(0)                      Conn Rate OOR = 0

  Band Rate Cnt = 0                       Band Rate OOR = 0

  Rserver State = 0(0)                    Rserver EncapsId = 10

  Stopped List  = 0x00000000              My Reals List = 0x339ba8f0

NP NUM = 1

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

switch/Admin# show np 2 lb-stats rserver s1 | i conns

  Max conns = 2                           Max conns = 2147483648

  Min conns = 2                           Min conns = 2147483648

switch/Admin# show np 3 lb-stats rserver s1 | i conns

  Max conns = 1                           Max conns = 2147483647

  Min conns = 1                           Min conns = 2147483647

switch/Admin# show np 4 lb-stats rserver s1 | i conns

  Max conns = 1                           Max conns = 2147483647

  Min conns = 1                           Min conns = 2147483647

switch/Admin#

そこで、最初に np4 へ次も np4 に connection を張るような traffic を送信してみます。

そうすると、1 つ目のリクエストを送信した直後に np4 の Rserver state が 0 から 2 になり、新規 connection を受け付けなくなります。 また、この np は max-conn に達したため、Max Conn OOR の値が 1 上昇します。

つまり、このコマンドを使用することで、どの np はコネクションを受け付け、どの np は受け付けないのかを確認することが可能です。

root@vlan731-1:/# nc -p 10003 192.168.31.100 80 < get2 &

[1] 15290

root@vlan731-1:/# HTTP/1.1 200 OK

Date: Fri, 22 Mar 2013 05:24:49 GMT

Server: Apache/2.2.16 (Debian)

Last-Modified: Wed, 28 Nov 2012 05:52:53 GMT

ETag: "9de14c-3-4cf87c6ff5740"

Accept-Ranges: bytes

Content-Length: 3

Vary: Accept-Encoding

Content-Type: text/html

s1

root@vlan731-1:/#

root@vlan731-1:/# nc -p 10007 192.168.31.100 80 < get2 &

[2] 15291

root@vlan731-1:/# (UNKNOWN) [192.168.31.100] 80 (www) : Connection refused

## Traffic 送信前

switch/Admin# show np 4 lb-stats rserver s1

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

Fri Mar 22 04:03:48 2013

LB is configured to consume 209038144 bytes of memory.

Physical SRAM Address = 0x2372fb00

Virtual SRAM Address = 0x2372fb00

Virtual DRAM address = 0x301d0000

Rserver ID = 1, offset = 0x00079000

Bank A(*) = 0x301d0000                  Bank B = 0x30541000

  Address   = 0x30249020                  Address   = 0x305ba020

  Cfgmap conn_limit = 1                   Cfgmap conn_limit = 0

         conn_rate_limit = 0                     conn_rate_limit = 0

         band_rate_limit = 0                     band_rate_limit = 0

  Max conns = 1                           Max conns = 2147483647

  Min conns = 1                           Min conns = 2147483647

  Conn rate limit = 2147483647            Conn rate limit = 2147483647

  Band rate limit = 1073741823            Band rate limit = 1073741823

Showing Rserver 1 Stats [context 0] [Base 0x33d7a800] [Address 0x33d7a848]

  Current Conn  = 0:14(0:12)              Max Conn OOR  = 4

Conn Rate Cnt = 0(0)                      Conn Rate OOR = 0

  Band Rate Cnt = 0                       Band Rate OOR = 0

  Rserver State = 0(0)                    Rserver EncapsId = 10

  Stopped List  = 0x00000000              My Reals List = 0x339ba8f0

NP NUM = 4

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

switch/Admin#

## 1 つ目のリクエスト送信後

switch/Admin# show conn

conn-id    np dir proto vlan source                destination           state

----------+--+---+-----+----+---------------------+---------------------+------+

11         4  in  TCP   731  192.168.31.1:10003    192.168.31.100:80     ESTAB

12         4  out TCP   732  192.168.32.1:80       192.168.31.204:1043   ESTAB

total active connections : 2

switch/Admin# show np 4 lb-stats rserver s1

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

Fri Mar 22 04:04:35 2013

LB is configured to consume 209038144 bytes of memory.

Physical SRAM Address = 0x2372fb00

Virtual SRAM Address = 0x2372fb00

Virtual DRAM address = 0x301d0000

Rserver ID = 1, offset = 0x00079000

Bank A(*) = 0x301d0000                  Bank B = 0x30541000

  Address   = 0x30249020                  Address   = 0x305ba020

  Cfgmap conn_limit = 1                   Cfgmap conn_limit = 0

         conn_rate_limit = 0                     conn_rate_limit = 0

         band_rate_limit = 0                     band_rate_limit = 0

  Max conns = 1                           Max conns = 2147483647

  Min conns = 1                           Min conns = 2147483647

  Conn rate limit = 2147483647            Conn rate limit = 2147483647

  Band rate limit = 1073741823            Band rate limit = 1073741823

Showing Rserver 1 Stats [context 0] [Base 0x33d7a800] [Address 0x33d7a848]

  Current Conn  = 1:15(0:12)              Max Conn OOR  = 5

Conn Rate Cnt = 0(0)                      Conn Rate OOR = 0

  Band Rate Cnt = 0                       Band Rate OOR = 0

  Rserver State = 2(0)                    Rserver EncapsId = 10

  Stopped List  = 0x339ba8f0              My Reals List = 0x339ba8f0

NP NUM = 4

Getting Started

検索バーにキーワード、フレーズ、または質問を入力し、お探しのものを見つけましょう

シスコ コミュニティをいち早く使いこなしていただけるよう役立つリンクをまとめました。みなさんのジャーニーがより良いものとなるようお手伝いします