I start consul like this :
consul agent -enable-script-checks=false -log-level error -config-file=./config.hcl -bootstrap=true
config.hcl content :
bind_addr = "127.0.0.1"
data_dir = "./data_dir"
server = true
client_addr = "127.0.0.1"
node_name = "nodename"
enable_debug = true
ui_config = {
enabled = true,
content_path = "/ui/"
}
ports = {
server = 8300
serf_lan = 8301
serf_wan = 8302
http = 8500
dns = 8600
}
limits {
http_max_conns_per_client = 65530
}
Then I use wrk , the result is strange, can somebody tell me why?
wrk -t128 -c500 -s reg_svc.lua -d60 http://127.0.0.1:8500
Running 1m test @ http://127.0.0.1:8500
128 threads and 500 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 1.08s 549.54ms 1.99s 56.58%
Req/Sec 5.25 6.50 20.00 87.93%
2635 requests in 1.00m, 344.81KB read
Socket errors: connect 0, read 0, write 0, timeout 2559
Requests/sec: 43.84
Transfer/sec: 5.74KB
the Result Requests/sec is only 43.84, is that normal?
the reg_svc.lua content :
wrk.method = "PUT"
wrk.body = ""
wrk.headers["Content-Type"] = "application/x-www-form-urlencoded"
math.randomseed(os.time())
local path = "/v1/agent/service/register?replayce-existing-checks=false"
local i = os.time()
local body = [[{
"ID": "mysql%d",
"Name": "mysql%d",
"Address": "127.0.0.1",
"Port": 3306,
"EnableTagOverride": false
}]]
request = function()
query = string.format(body, i, i)
local body = wrk.format(nil, path, nil, query)
i = math.random(0,9000000)
return body
end