Skip to content

Instantly share code, notes, and snippets.

@dictav
Last active September 11, 2017 01:55
Show Gist options
  • Save dictav/397a1d08a3e4bebfda0eaf6f5ade34ae to your computer and use it in GitHub Desktop.
Save dictav/397a1d08a3e4bebfda0eaf6f5ade34ae to your computer and use it in GitHub Desktop.
GCP benchmark

history

  • rev6: debian9 のプロセスを見直して余計なプロセスを停止
  • rev4: nginx-slim:0.23 を追加
  • rev3: ubuntu16.04 を追加

instances

$ gcloud compute instances list
NAME          ZONE               MACHINE_TYPE   PREEMPTIBLE  INTERNAL_IP  EXTERNAL_IP     STATUS
centos7       asia-northeast1-a  n1-standard-1  true         10.146.0.2   35.189.153.112  RUNNING
debian9       asia-northeast1-a  n1-standard-1  true         10.146.0.4   35.189.153.174  RUNNING
dictav-dev    asia-northeast1-a  n1-standard-4  true         10.146.0.6   35.189.158.72   RUNNING
nginx-alpine  asia-northeast1-a  n1-standard-1  true         10.146.0.7   35.189.152.213  RUNNING
nginx-slim    asia-northeast1-a  n1-standard-1  true         10.146.0.8   35.189.158.103  RUNNING
nginx-vm      asia-northeast1-a  n1-standard-1  true         10.146.0.3   35.189.151.61   RUNNING
ubuntu        asia-northeast1-a  n1-standard-1  true         10.146.0.9   35.189.154.79   RUNNING

centos7

Running 1m test @ http://10.146.0.2
  4 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     2.94ms    1.05ms  99.23ms   98.64%
    Req/Sec     8.61k   665.62    17.70k    61.29%
  2057221 requests in 1.00m, 1.63GB read
Requests/sec:  34275.65
Transfer/sec:     27.78MB

debian9

Running 1m test @ http://10.146.0.4
  4 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    58.29ms   86.17ms   1.01s    81.99%
    Req/Sec    10.09k     3.86k   23.92k    68.31%
  2383162 requests in 1.00m, 1.89GB read
Requests/sec:  39691.80
Transfer/sec:     32.17MB

nginx-alpine

Running 1m test @ http://10.146.0.7
  4 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     6.01ms    5.03ms 299.89ms   99.02%
    Req/Sec     4.31k   349.29     8.12k    79.32%
  1029874 requests in 1.00m, 834.79MB read
Requests/sec:  17157.63
Transfer/sec:     13.91MB

nginx-slim

Running 1m test @ http://10.146.0.8
  4 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     6.82ms    4.57ms 282.04ms   98.65%
    Req/Sec     3.78k   303.85     8.01k    87.08%
  902083 requests in 1.00m, 731.21MB read
Requests/sec:  15026.53
Transfer/sec:     12.18MB

nginx-vm

Running 1m test @ http://10.146.0.3
  4 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     4.07ms    3.88ms 123.85ms   86.38%
    Req/Sec     6.55k   636.60    22.70k    89.80%
  1563849 requests in 1.00m, 1.61GB read
Requests/sec:  26020.76
Transfer/sec:     27.39MB

ubuntu

Running 1m test @ http://10.146.0.9
  4 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    62.81ms   84.81ms 677.60ms   79.62%
    Req/Sec     9.21k     3.44k   24.79k    70.96%
  2190697 requests in 1.00m, 1.75GB read
Requests/sec:  36492.01
Transfer/sec:     29.89MB
#!/bin/bash
list=`gcloud compute instances list | grep RUNNING | grep -v dictav-dev`
ifs_bak=$IFS
IFS="
"
rm result.txt
for line in $list
do
os=`echo $line | awk -F ' ' '{print $1}'`
echo $os
echo "## $os" >> result.txt
echo '' >> result.txt
echo '```' >> result.txt
ip=`echo $line | awk -F ' ' '{print $5}'`
/usr/local/bin/wrk -t 4 -c 100 -d 1m http://$ip >> result.txt
echo '```' >> result.txt
echo '' >> result.txt
done
IFS=$ifs_bak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment