Skip to content

Instantly share code, notes, and snippets.

@miyachan
Created September 8, 2020 05:26
Show Gist options
  • Save miyachan/c532315b580d7464e16ab71d7f50d3ac to your computer and use it in GitHub Desktop.
Save miyachan/c532315b580d7464e16ab71d7f50d3ac to your computer and use it in GitHub Desktop.

Load Testing

Load testing Ayase + Torako. Each run represents the best output with no dropped requests.

Setup

Dataset: Archived.moe dataset

Scraper: Torako

Node: Scraper+Frontend

  • Google Compute Engine
  • e2-highcpu-16
    • 16 vCPU
    • 16GiB memory
  • nginx Frontend
    • worker_connections = 8192;
    • worker_rlimit_nofile 30000;
  • open file limit = 33554432
  • Ayase
    • uvicorn --workers $(($(nproc) * 3 + 1)) --log-level error --no-access-log --loop uvloop --backlog 65536 view.asagi:app
  • Foolfuuka
    • fpm: listen.backlog = 65535
    • fpm: pm.max_children = 128

MySQL: Google Cloud SQL

  • Google Cloud SQL Database
    • 2 vCPU
    • 7.5 GiB memory

Node: Load Generator

  • Google Compute Engine
  • e2-highcpu-16
    • 16 vCPU
    • 16 GiB memory

Load Generator: Vegeta

urls.conf
GET http://10.128.0.5/a
GET http://10.128.0.5/3
GET http://10.128.0.5/aco
GET http://10.128.0.5/adv
GET http://10.128.0.5/an
GET http://10.128.0.5/asp
GET http://10.128.0.5/b
GET http://10.128.0.5/bant
GET http://10.128.0.5/biz
GET http://10.128.0.5/cgl
GET http://10.128.0.5/ck
GET http://10.128.0.5/cm
GET http://10.128.0.5/c
GET http://10.128.0.5/a/thread/208415801
GET http://10.128.0.5/a/thread/208416511
GET http://10.128.0.5/a/thread/208413548
GET http://10.128.0.5/a/thread/208417410 
GET http://10.128.0.5/a/thread/208347709 
GET http://10.128.0.5/a/thread/208407848 
GET http://10.128.0.5/a/thread/208419443 
GET http://10.128.0.5/a/thread/208383789 
GET http://10.128.0.5/a/thread/208408998
GET http://10.128.0.5/a/thread/208327181 
GET http://10.128.0.5/a/thread/208398803 
GET http://10.128.0.5/a/thread/208417410 

Run #1: Results: FoolFuuka

$ cat urls.conf | ./vegeta attack -duration=120s -rate=150/1s -max-body 4b -header "Host: archive.wakarimasen.co"  | tee results.bin | ./vegeta report
Requests      [total, rate, throughput]         18000, 150.01, 149.75
Duration      [total, attack, wait]             2m0s, 2m0s, 203.118ms
Latencies     [min, mean, 50, 90, 95, 99, max]  21.335ms, 1.587s, 963.271ms, 4.113s, 4.302s, 4.468s, 4.644s
Bytes In      [total, mean]                     72000, 4.00
Bytes Out     [total, mean]                     0, 0.00
Success       [ratio]                           100.00%
Status Codes  [code:count]                      200:18000  

Run #2: Results: Ayase

$ cat urls.conf | ./vegeta attack -duration=120s -rate=150/1s -max-body 4b -header "Host: archive.wakarimasen.co"  | tee results.bin | ./vegeta report
Requests      [total, rate, throughput]         18000, 150.01, 76.61
Duration      [total, attack, wait]             2m30s, 2m0s, 29.674s
Latencies     [min, mean, 50, 90, 95, 99, max]  11.63ms, 14.424s, 9.161s, 30s, 30s, 30.001s, 30.008s
Bytes In      [total, mean]                     45864, 2.55
Bytes Out     [total, mean]                     0, 0.00
Success       [ratio]                           63.70%
Status Codes  [code:count]                      0:6534  200:11466  

Summary

FoolFuuka Ayase
Req/s 149.7 r/s 76.61
Avg Latency 1.5s 14.4s
Median Latency 963ms 9.1s
99% Latency 4.4s 30s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment