LoginSignup
6
5

More than 5 years have passed since last update.

F5 BIG-IP LTMにおける流量制限方法

Last updated at Posted at 2016-10-31

サーバの流量制限を行う際、サーバ負荷分散装置であるF5 BIG-IP LTM(以下、BIG-IP)にて流量のコントロールが可能です。
ここではBIG-IPの流量制限設定方法と考慮点についてまとめておきます。

BIG-IP 流量制限設定

前提

  • 構成例

クライアント -①- BIG-IP -②- Webサーバ - DBサーバ

上記構成において、BIG-IPで実施可能な流量制限は以下の2箇所のいずれかになります。

1. クライアント - BIG-IP
BIG-IP設定項目・・・Virtual Server設定

2. BIG-IP - Webサーバ
BIG-IP設定項目・・・Pool Member/Node設定

流量制限方法

特定のTCPコネクション数に達すると、BIG-IPは 新規 のTCP Connectionを割り振らなくなります。
※同時接続Connection数とは、クライアントとBIG-IPでTCP 3 Hands Shake後のConnectionの数を指す。

1. Connection Limit
同時接続数を制限します。

2. Connection Rate Limit
1秒あたりの新規接続数を制限します。

考慮点

Connection Limit、Connection Rate Limit とも、設定後からの新規Connection に対して有効となる機能であり、既存Connection数に対して流量の制限を行うものではない点に注意が必要です。
また、Virtual ServerやPool、Pool MemberをDisableにしたところで、上記同様、既存Connectionには影響を与えず、新規Connectionが受け付けられない動作となるだけです。
つまり、流量制限は予め与えられた要件に応じて設定しておくか、既存のConnectionについては手動で切断する必要があります。

補足

  • 既存Connection切断

現在のコネクションを強制切断するコマンドは以下。

CLIコマンド
tmsh delete sys connection

オプションを指定することにより、特定のConnectionを切断することもできます。

コマンドオプション
root@(BIG-IP1600-3)(cfg-sync Disconnected)(Active)(/Common)(tmos)# delete sys connection ?
Options:
  all             Includes all items
Properties:
  "{"             Optional delimiter
  age             Specifies the age, in seconds, of a connection
  cs-client-addr  Specifies the clientside remote address of the active
                  connections
  cs-client-port  Specifies the clientside remote port of the active connections
  cs-server-addr  Specifies the clientside local address of the active
                  connections
  cs-server-port  Specifies the clientside local port of the active connections
  protocol        Specifies the protocol used for specified connections (for
                  example: tcp, udp)
  ss-client-addr  Specifies the serverside local address of the active
                  connections
  ss-client-port  Specifies the serverside local port of the active connections
  ss-server-addr  Specifies the serverside remote address of the active
                  connections
  ss-server-port  Specifies the serverside remote port of the active connections
  type            Specifies the connnection type used for specified connections
                  (for example: any, mirror, self)
  • 既存Connection数確認

仮想サーバ(Virtual Server)毎、割り振り先サーバ(Pool Member)に、現在の接続数を確認することができます。

【GUI】
Statistics ›› Module Statistics : Local Traffic ›› Virtual Servers
image

Statistics ›› Module Statistics : Local Traffic ›› Pools
image

【CLI】

CLIコマンド
tmsh show sys connections
出力例
root@(BIG-IP1600-3)(cfg-sync Disconnected)(Active)(/Common)(tmos)# show sys connection
Sys::Connections
10.1.20.8:33582  10.1.20.126:123  10.1.20.8:33582  10.1.20.126:123  udp   2  (tmm: 1)  none
10.1.20.8:56753  10.1.20.128:8    10.1.20.8:56753  10.1.20.128:8    icmp  8  (tmm: 1)  none
10.1.20.8:3010   10.1.20.128:8  10.1.20.8:3010   10.1.20.128:8  icmp  4  (tmm: 0)  none
10.1.20.8:23300  10.1.20.125:8  10.1.20.8:23300  10.1.20.125:8  icmp  2  (tmm: 0)  none
10.1.20.8:16822  10.1.20.162:8  10.1.20.8:16822  10.1.20.162:8  icmp  3  (tmm: 0)  none
10.1.20.8:61896  10.1.20.127:8  10.1.20.8:61896  10.1.20.127:8  icmp  5  (tmm: 0)  none
10.1.20.8:19863  10.1.20.127:8    10.1.20.8:19863  10.1.20.127:8    icmp  9  (tmm: 1)  none
10.1.20.8:36762  10.1.20.128:123  10.1.20.8:36762  10.1.20.128:123  udp   0  (tmm: 1)  none
10.1.20.8:29041  10.1.20.162:8    10.1.20.8:29041  10.1.20.162:8    icmp  7  (tmm: 1)  none
10.1.20.8:49758  10.1.20.127:123  10.1.20.8:49758  10.1.20.127:123  udp   1  (tmm: 1)  none
10.1.20.8:57765  10.1.20.125:8    10.1.20.8:57765  10.1.20.125:8    icmp  6  (tmm: 1)  none
10.1.20.8:7994   10.1.20.126:8    10.1.20.8:7994   10.1.20.126:8    icmp  1   (tmm: 0)  none
10.1.20.8:38091  10.1.20.125:123  10.1.20.8:38091  10.1.20.125:123  udp   4   (tmm: 0)  none

まとめ

Connection LimitやConnection Rate Limitを設定したら即時に既存Connectionに対しても流量が制限されると思われがちですが、そうはなりませんのでご注意を。
Virtual ServerやPool、Pool MemberをDisableにしても既存通信は切断されないのです。

参考

Manual Chapter: Setting Connection Limits:
https://support.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/ltm-implementations-11-5-1/33.html?sr=58280155

以上。

6
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
5