ACE4710/Admin# sh resource usage context c2 Allocation Resource Current Peak Min Max Denied ------------------------------------------------------------------------------- Context: c2 conc-connections 0 0 199990 1799910 0 mgmt-connections 0 0 9990 89910 0 proxy-connections 0 0 26214 235928 0 xlates 0 0 6554 58982 0 acc-connections 0 0 11 95 0 bandwidth 23456000 23456000 12375000 235125000 10000 throughput 23456000 23456000 12375000 111375000 10000 [snip] |
上記出力を確認すると、user context c2 の Peak(23,456,000) が Allocation Max(111,375,000) に達していないにも関わらず Denied counter が上昇 (10,000) しています。 これは不具合では? という問い合わせが何件かありました。
Allocation Max = この context で利用可能な resource の最大値
です。 そのため、Allocation Max を超えた場合に、Drop され、Denied counter が上昇すると思われがちですが、Allocation Max を超える前であっても、設定や条件によっては Drop し始めることがあります。 ここでは resource-class の設定と、show resource usage の出力について説明をし、なぜ Allocation Max に達する前であっても Denied counter が上昇するすることがあるのかについて説明します。
ACE は ACE: context の基本設定 の前半部分に書かれているように、context を作成することで、複数の ACE が動作しているように振る舞うことが可能です。 1 つの context が全ての resource を占有することがないよう、resource を管理する必要があり、その設定を resource-class で行います。
ACE4710/Admin# conf t Enter configuration commands, one per line. End with CNTL/Z. ACE4710/Admin(config)# ACE4710/Admin(config)# resource-class r1 !___ リソースクラス r1 を作成 ACE4710/Admin(config-resource)# limit-resource ? acc-connections Limit Application Acceleration connections acl-memory Limit ACL memory all Limit all resource parameters buffer Set resource-limit for buffers conc-connections Limit concurrent connections (thru-the-box traffic) http-comp Limit compression performance mgmt-connections Limit management connections (to-the-box traffic) proxy-connections Limit proxy connections rate Set resource-limit as a rate (number per second) regexp Limit amout of regular expression memory sticky Limit number of sticky entries xlates Limit number of Xlate entries ACE4710/Admin(config-resource)# limit-resource all minimum 10.00 maximum equal-to-min !___ 全体の 10% のリソースを確保し、それを超えた場合ドロップするよう設定 ACE4710/Admin(config-resource)# exit ACE4710/Admin(config)# context c1 !___ コンテキスト c1 を作成 ACE4710/Admin(config-context)# member r1 !___ コンテキスト c1 にリソースクラス r1 を適用 ACE4710/Admin(config)# resource-class r2 !___ リソースクラス r2 を作成 ACE4710/Admin(config-resource)# limit-resource all minimum 10.00 maximum unlimited !___ 全体の 10% のリソースを確保、それを超えた場合でも、もし resource に空きがあれば resource を確保可能 ACE4710/Admin(config-resource)# exit ACE4710/Admin(config)# context c2 !___ コンテキスト c2 を作成 ACE4710/Admin(config-context)# member r2 !___ コンテキスト c2 にリソースクラス r2 を適用 |
ACE4710/Admin# sh run resource-class Generating configuration.... resource-class r1 limit-resource all minimum 10.00 maximum equal-to-min resource-class r2 limit-resource all minimum 10.00 maximum unlimited ACE4710/Admin# sh run context Generating configuration.... context c1 member r1 context c2 member r2 ACE4710/Admin# sh resource usage Allocation Resource Current Peak Min Max Denied ------------------------------------------------------------------------------- Context: Admin throughput 2004 25886 1250000 100250000 0 [snip] Context: c1 throughput 0 0 12375000 12375000 0 [snip] Context: c2 throughput 0 0 12375000 111375000 0 [snip] |
上記のように resource-class 名を設定し、limit-resource で各 resource について minimum と maximum を設定します。
minimum は、確保した resource の割合(%) です。 つまり、ここで設定した値が、その context で保証されている resource となります。 上記設定例の場合、context c1, c2 共に、10% の resource がその context 用に保証されます。 今回、Throughput license 1Gbps (=125,000,000byte/s) を使用し、Admin context 用に 1,250,000 の resource が確保されているため、c1, c2 共に保証されている resource (Allocation Min) は、(125,000,000 - 1,250,000) x 10% = 12,375,000 になります。
maximum の後ろに来るオプション (equal-to-min/unlimited) は、そのリソースが使用できる上限値になります。
equal-to-min の場合、min で設定した値が上限値になります。
unlimited の場合、上限はなく、resource に空きがある限り使用可能となります。
c1 は equal-to-min の設定が入っているので、Allocation Max も 12,375,000 になっています。
これは、12,375,000 を超えると drop する (Denied counter が上昇する) ことを意味しています。
c2 は unlimited の設定が入っているので、resource に空きがあれば Allocation Min を超えていても使用可能です。
ここで重要なのが、"resource の空き" です。 これは Allocation Max を意味しているのではなく、共有 resource の空きを意味しています。
上記の場合、
全体の resource = 125,000,000
Admin context が確保している resource = 1,250,000
c1 context が確保している resource = 12,375,000
c2 context が確保している resource = 12,375,000
となるため、
確保されていない resource = 125,000,000 - 1,250,000 - 12,375,000 - 12,375,000 = 99,000,000
これが共有 resource になります。
c2 は 12,375,000 の resource を確保しているため、最大で 12,375,000 + 99,000,000 = 111,375,000 の resource が使用可能です。
この値が Allocation Max になります。
共有 resource は他の context と共有しているため、他の context で共有 resource を使用していた場合、使用可能な resource は減少します。
例えば、Admin context で共有 resource を 50,000,000 使用している場合、他の context で使用可能な共有 resource は 49,000,000 になり、もし、Admin context が全ての共有 resource 99,000,000 を使いきっている場合、他の context は、共有 resource を使用できませんので、Allocation Min を超えた時点で drop し始め、Denied counter が上昇し始めます。
ACE4710/Admin# sh resource usage context c2 Allocation Resource Current Peak Min Max Denied ------------------------------------------------------------------------------- Context: c2 conc-connections 0 0 199990 1799910 0 mgmt-connections 0 0 9990 89910 0 proxy-connections 0 0 26214 235928 0 xlates 0 0 6554 58982 0 acc-connections 0 0 11 95 0 bandwidth 23456000 23456000 12375000 235125000 10000 throughput 23456000 23456000 12375000 111375000 10000 [snip] |
これらを踏まえたうえで、再度上記を確認してみると、Allocation Max - Current = 87,919,000 であるため、他の context が合計で 87,919,000 の共有 resource を使用している場合、共有 resource を確保できず drop し、Denied counter が上昇します。 他の context の出力があれば、他の context で大量の traffic が流れていることに気づき、共有 resource の枯渇に気づくかもしれません。 そのため、log を取得する際には、問題の発生していない情報も含めた、できるだけ多くの情報を取得することをお勧めします。
Allocation Max は、あくまでその context で使用可能な resource の最大値であり、他の context が共有 resource を使用している環境であれば、その値に達する前であっても drop し始めます。
まとめると、show resource usage の出力は下記のようになります。