Advanced

Load Testing

Load Testing

Requirements

  1. Everything is running in distributed mode.
  2. wrk is installed in your system.
  3. Create a file named put.lua with sample data, for example -
put.lua
1wrk.method = "PUT"2wrk.headers["Content-Type"] = "application/json"3wrk.body = '{ "tag": "github", "target": "https://github.com" }'

Running Test

  1. Load test link creation
$wrk -t8 -d10s -c100 -s "./put.lua" http://localhost:5002
  1. Load test link data API. Get one of shortIDs created in previous step
$wrk -t8 -d10s -c100 http://localhost:5002/<shortID>
  1. load test link redirection
$wrk -t8 -d10s -c100 http://localhost:5000/<shortID>

Results

Following is a sample result on a quad core machine with wrk running on the same machine. The run duration for each test was 1 minute. This is not meant as professional benchmark as that will require a different and controlled setup.

TaskCache HitPerformance (Avg)Total OpsLatency (Avg)
Create Links121K reqs/sec7.26M47.39ms
Get LinkRedis60K reqs/sec3.60M1.68ms
Get LinkNone25K reqs/sec1.5M4.30ms
RedirectMemory398K reqs/sec23M0.94ms
RedirectRedis39K reqs/sec2.3M23.33ms
RedirectNone21K reqs/sec1.3M90.22ms