Powerful wrk

Powerful wrk

https://github.com/wg/wrk
SCRIPTING
scripts
multiplepaths.lua

random arg while benchmarking

For this example, I want benchmark this url, user is a number.

http://eureka.arkii.com/polls/14/progress/?user=\d+

Lua script test.lua

-- print(wrk.scheme)
-- print(wrk.host)
-- print(wrk.port)
-- print(wrk.path)
-- print(wrk.body)
math.randomseed(os.time())
math.random(); math.random(); math.random()
function request()
local n = math.random(999999)
local path = wrk.path
local url = path..n
return wrk.format(nil, url)
end
# wrk -d 300 -c 3000 -t 16 --timeout 5 -s test.lua 'http://eureka.arkii.com/polls/14/progress/?user='
Running 5m test @ http://eureka.arkii.com/polls/14/progress/?user=
16 threads and 3000 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 1.86s 1.19s 5.00s 75.43%
Req/Sec 46.27 23.79 1.46k 75.01%
220502 requests in 5.00m, 1.84GB read
Socket errors: connect 0, read 3657, write 0, timeout 63411
Non-2xx or 3xx responses: 2196
Requests/sec: 734.77
Transfer/sec: 6.29MB
# wrk -d 300 -c 3000 -t 16 --timeout 5 -s test.lua 'http://eureka.arkii.com/polls/14/progress/?user='
Running 5m test @ http://eureka.arkii.com/polls/14/progress/?user=
16 threads and 3000 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 1.86s 1.21s 5.00s 73.99%
Req/Sec 46.40 23.55 0.90k 66.45%
220857 requests in 5.00m, 1.84GB read
Socket errors: connect 0, read 0, write 0, timeout 64029
Non-2xx or 3xx responses: 2566
Requests/sec: 735.95
Transfer/sec: 6.29MB

Application logs on server side

127.0.0.1 - - [30/Aug/2017 11:21:20] "GET /polls/14/progress/?user=106856 HTTP/1.1" 200 -
127.0.0.1 - - [30/Aug/2017 11:21:20] "GET /polls/14/progress/?user=770189 HTTP/1.1" 200 -
127.0.0.1 - - [30/Aug/2017 11:21:20] "GET /polls/14/progress/?user=901519 HTTP/1.1" 200 -
127.0.0.1 - - [30/Aug/2017 11:21:20] "GET /polls/14/progress/?user=645483 HTTP/1.1" 200 -
127.0.0.1 - - [30/Aug/2017 11:21:20] "GET /polls/14/progress/?user=370875 HTTP/1.1" 200 -
127.0.0.1 - - [30/Aug/2017 11:21:20] "GET /polls/14/progress/?user=431874 HTTP/1.1" 200 -
127.0.0.1 - - [30/Aug/2017 11:21:20] "GET /polls/14/progress/?user=250223 HTTP/1.1" 200 -
127.0.0.1 - - [30/Aug/2017 11:21:20] "GET /polls/14/progress/?user=598406 HTTP/1.1" 200 -
127.0.0.1 - - [30/Aug/2017 11:21:20] "GET /polls/14/progress/?user=464561 HTTP/1.1" 200 -
127.0.0.1 - - [30/Aug/2017 11:21:20] "GET /polls/14/progress/?user=585691 HTTP/1.1" 200 -
127.0.0.1 - - [30/Aug/2017 11:21:20] "GET /polls/14/progress/?user=275949 HTTP/1.1" 200 -
127.0.0.1 - - [30/Aug/2017 11:21:20] "GET /polls/14/progress/?user=963801 HTTP/1.1" 200 -
127.0.0.1 - - [30/Aug/2017 11:21:20] "GET /polls/14/progress/?user=188118 HTTP/1.1" 200 -
127.0.0.1 - - [30/Aug/2017 11:21:20] "GET /polls/14/progress/?user=674099 HTTP/1.1" 200 -
127.0.0.1 - - [30/Aug/2017 11:21:20] "GET /polls/14/progress/?user=600031 HTTP/1.1" 200 -
127.0.0.1 - - [30/Aug/2017 11:21:20] "GET /polls/14/progress/?user=744967 HTTP/1.1" 200 -
127.0.0.1 - - [30/Aug/2017 11:21:20] "GET /polls/14/progress/?user=743827 HTTP/1.1" 200 -
127.0.0.1 - - [30/Aug/2017 11:21:20] "GET /polls/14/progress/?user=504839 HTTP/1.1" 200 -
127.0.0.1 - - [30/Aug/2017 11:21:20] "GET /polls/14/progress/?user=869017 HTTP/1.1" 200 -
127.0.0.1 - - [30/Aug/2017 11:21:20] "GET /polls/14/progress/?user=197191 HTTP/1.1" 200 -
127.0.0.1 - - [30/Aug/2017 11:21:20] "GET /polls/14/progress/?user=943787 HTTP/1.1" 200 -
127.0.0.1 - - [30/Aug/2017 11:21:20] "GET /polls/14/progress/?user=895053 HTTP/1.1" 200 -
127.0.0.1 - - [30/Aug/2017 11:21:20] "GET /polls/14/progress/?user=383663 HTTP/1.1" 200 -
127.0.0.1 - - [30/Aug/2017 11:21:20] "GET /polls/14/progress/?user=967306 HTTP/1.1" 200 -