Commit de06717d authored by Cédric F.'s avatar Cédric F.

Add benchmarking tools

parent 0c31facc
Pipeline #14421563 (#) passed with stage
elm-stuff/
/public/assets/js/elm.min.js
/deploy.sh
/results.bin
/metrics.json
/plot.html
{"jsonrpc":"2.0","id":0,"method":"getblock","params":["0000000000000014271b616a089657e5f816ad4e563b55ca712de2786694611b"]}
{"jsonrpc":"2.0","id":0,"method":"getrawtransaction","params":["28bb4fe2006fc9b35b029db767cdb815721f4e98dda46f75d9c7712a18896f49",1]}
#!/bin/bash -eux
vegeta attack -insecure -http2 -targets=targets.txt -duration=60s -rate=100 -timeout 1s > results.bin
vegeta report -inputs=results.bin -reporter=json > metrics.json
vegeta report -reporter=plot < results.bin > plot.html
vegeta report -reporter="hist[0,1ms,2ms,3ms,4ms,5ms,6ms,7ms,8ms,9ms,10ms]" < results.bin
vegeta report -reporter=text < results.bin
{"jsonrpc":"2.0","id":0,"method":"searchrawtransactions","params":["DceSxzYa5gaN5pWZ8oGEEjSAFdY9Cdw6ddj",1,0,250,1,true]}
POST https://localhost:8000/rpc
accept: */*
accept-encoding: gzip, deflate, br
content-type: application/json
origin: https://localhost:8000
referer: https://localhost:8000/
@./getblock.json
POST https://localhost:8000/rpc
accept: */*
accept-encoding: gzip, deflate, br
content-type: application/json
origin: https://localhost:8000
referer: https://localhost:8000/
@./getrawtransaction.json
POST https://localhost:8000/rpc
accept: */*
accept-encoding: gzip, deflate, br
content-type: application/json
origin: https://localhost:8000
referer: https://localhost:8000/
@./searchrawtransactions.json
......@@ -8,15 +8,10 @@ events {
http {
access_log /tmp/access.log;
server_tokens off;
sendfile on;
tcp_nopush on;
tcp_nodelay on; # FIXME: off?
keepalive_timeout 5; # FIXME?
types_hash_max_size 2048;
server_tokens off;
server_names_hash_bucket_size 128; # needed for ACME Let's Encrypt long domain name verification
include /etc/nginx/mime.types;
include /etc/nginx/mime.types;
proxy_cache_path nginx/cache/rpc levels=1 keys_zone=rpc:100m max_size=10g inactive=1y use_temp_path=off;
......@@ -59,15 +54,13 @@ http {
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
limit_req zone=default burst=10;
# limit_req zone=default burst=10; # disabled for benchmarking
error_page 502 @maintenance;
root public;
location @maintenance {
root /somewhere;
if (!-f $request_filename) {
rewrite ^(.*)$ /maintenance.html break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment