LoginSignup
57

More than 5 years have passed since last update.

Lambda を利用した分散 Web 負荷テストツール Goad を使ってみた

Posted at

概要

AWS Lambda を使用して複数 Region から分散して Web 負荷テストが実行できるツール Goad を使ってみる。

アーキテクチャ

02.png

公式サイトに Demo があるので、自分のサイトにもお試しできる

Goad インストール

適当な場所にバイナリをダウンロードして解凍するだけ

$ wget https://github.com/gophergala2016/goad/releases/download/gopher-gala/goad-gopher-gala-linux-x86-64.zip
$ unzip goad-gopher-gala-linux-x86-64.zip
Archive:  goad-gopher-gala-linux-x86-64.zip
  inflating: goad

Goad の使い方

option 参照

$ ./goad --help
Usage of ./goad:
  -c uint
        number of concurrent requests (default 10)
  -m string
        HTTP method (default "GET")
  -n uint
        number of total requests to make (default 1000)
  -r string
        AWS regions to run in (comma separated, no spaces) (default "us-east-1,eu-west-1,ap-northeast-1")
  -t uint
        request timeout in seconds (default 15)
  -u string
        URL to load test (required)

Goad の実行

Credential を環境変数にセットする

export AWS_ACCESS_KEY_ID="AKXXXXXXXXXXXXXXXXXX"
export AWS_SECRET_ACCESS_KEY="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

AWSで作成したインスタンス(t2.micro)に対して、3箇所(us-east-1,eu-west-1,ap-northeast-1)から load testing 実行

$ ./goad -c 10 -n 10000 -r us-east-1,eu-west-1,ap-northeast-1 -m GET -u http://54.249.83.184
Regional results

Region: ap-northeast-1
   TotReqs   TotBytes    AvgTime   AvgReq/s  AvgKbps/s
      3334      63 MB     0.004s     849.60   15591.43
   Slowest    Fastest   Timeouts  TotErrors
    0.013s     0.001s          0          0
Region: us-east-1
   TotReqs   TotBytes    AvgTime   AvgReq/s  AvgKbps/s
      1936      36 MB     0.464s       7.34     134.62
   Slowest    Fastest   Timeouts  TotErrors
    0.482s     0.293s          0          0
Region: eu-west-1
   TotReqs   TotBytes    AvgTime   AvgReq/s  AvgKbps/s
      1352      25 MB     0.661s       5.75     105.49
   Slowest    Fastest   Timeouts  TotErrors
    0.456s     0.436s          0          0

Overall

   TotReqs   TotBytes    AvgTime   AvgReq/s  AvgKbps/s
      6622     124 MB     0.272s     431.07    7910.76
   Slowest    Fastest   Timeouts  TotErrors
    0.482s     0.001s          0          0
HTTPStatus   Requests
       200       6622

Apache Access ログ

access_log
52.16.167.156 - - [27/Jan/2016:05:27:16 +0000] "GET / HTTP/1.1" 200 18792 "-" "Mozilla/5.0 (compatible; Goad/1.0; +https://goad.io)"
52.16.167.156 - - [27/Jan/2016:05:27:17 +0000] "GET / HTTP/1.1" 200 18792 "-" "Mozilla/5.0 (compatible; Goad/1.0; +https://goad.io)"
52.16.167.156 - - [27/Jan/2016:05:27:17 +0000] "GET / HTTP/1.1" 200 18792 "-" "Mozilla/5.0 (compatible; Goad/1.0; +https://goad.io)"
54.172.10.160 - - [27/Jan/2016:05:27:17 +0000] "GET / HTTP/1.1" 200 18792 "-" "Mozilla/5.0 (compatible; Goad/1.0; +https://goad.io)"
54.172.10.160 - - [27/Jan/2016:05:27:17 +0000] "GET / HTTP/1.1" 200 18792 "-" "Mozilla/5.0 (compatible; Goad/1.0; +https://goad.io)"

AWS コンソールから確認すると Function が作成されている

01.png

CloudWatch で負荷確認

NetWorkOut で 20MB 程度でた
03.png

AWSアカウントがあれば ab 並にお手軽に負荷テストができる

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
57