{"id":16366452,"url":"https://github.com/centminmod/k6-benchmarking","last_synced_at":"2025-07-22T01:02:27.055Z","repository":{"id":49817078,"uuid":"512252158","full_name":"centminmod/k6-benchmarking","owner":"centminmod","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-01T14:41:45.000Z","size":2324,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-30T23:08:43.622Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/centminmod.png","metadata":{"files":{"readme":"readme-old.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-09T17:57:31.000Z","updated_at":"2024-03-01T07:41:53.000Z","dependencies_parsed_at":"2024-11-08T05:42:39.392Z","dependency_job_id":"c3f61660-e783-48b9-8eb5-632e4c824a26","html_url":"https://github.com/centminmod/k6-benchmarking","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/centminmod/k6-benchmarking","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Fk6-benchmarking","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Fk6-benchmarking/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Fk6-benchmarking/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Fk6-benchmarking/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/centminmod","download_url":"https://codeload.github.com/centminmod/k6-benchmarking/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Fk6-benchmarking/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266405360,"owners_count":23923533,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T02:46:28.819Z","updated_at":"2025-07-22T01:02:25.928Z","avatar_url":"https://github.com/centminmod.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[k6 benchmarking](https://k6.io/docs/)\n\n# Install\n\n* https://k6.io/docs/getting-started/installation/#linux\n\n```\nwget -4 https://github.com/grafana/k6/releases/download/v0.40.0/k6-v0.40.0-linux-amd64.tar.gz -O k6-v0.40.0-linux-amd64.tar.gz\ntar xvzf k6-v0.40.0-linux-amd64.tar.gz\n\\cp -af k6-v0.40.0-linux-amd64/k6 /usr/local/bin/k6\nrm -rf k6-v0.40.0-linux-amd64/k6\n```\n```\nk6 version\nk6 v0.40.0 (2022-09-08T09:06:02+0000/v0.39.0-92-gdcbe2f9c, go1.18.6, linux/amd64)\n```\n\n# Benchmarks\n\n## Constant Request Rate Benchmarks\n\nFor REQRATE = 100 request/s constant rate test with [`psrecord`](https://github.com/astrofrog/psrecord/)\n\n```\nVU=20\nREQRATE=100\nTIME=30\nDOMAIN=https://yourdomain.com/\n\npsrecord \"taskset -c 0-3 k6 run -e RPS=${REQRATE} -e DURATION=${TIME}s -e USERS=${VU} -e URL=$DOMAIN --no-usage-report --out json=summary-raw-rps.gz benchmark-rps.js\" --include-children --interval 0.1 --duration 30 --log psrecord.log --plot plot.png\n```\n```\nVU=20\nREQRATE=100\nTIME=30\nDOMAIN=https://yourdomain.com/\n\npsrecord \"taskset -c 0-3 k6 run -e RPS=${REQRATE} -e DURATION=${TIME}s -e USERS=${VU} -e URL=$DOMAIN --no-usage-report --out json=summary-raw-rps.gz benchmark-rps.js\" --include-children --interval 0.1 --duration 30 --log psrecord.log --plot plot.png\n\nStarting up command 'taskset -c 0-3 k6 run -e RPS=100 -e DURATION=15s -e USERS=20 -e URL=https://domain1.com/ --no-usage-report --out json=summary-raw-rps.gz benchmark-rps.js' and attaching to process\n\n          /\\      |‾‾| /‾‾/   /‾‾/   \n     /\\  /  \\     |  |/  /   /  /    \n    /  \\/    \\    |     (   /   ‾‾\\  \n   /          \\   |  |\\  \\ |  (‾)  | \n  / __________ \\  |__| \\__\\ \\_____/ .io\n\n  execution: local\n     script: benchmark-rps.js\n     output: json (summary-raw-rps.gz)\n\n  scenarios: (100.00%) 1 scenario, 1000 max VUs, 45s max duration (incl. graceful stop):\n           * open_model: 100.00 iterations/s for 15s (maxVUs: 20-1000, gracefulStop: 30s)\n\n\nrunning (15.0s), 0000/0020 VUs, 1501 complete and 0 interrupted iterations\nopen_model ✓ [======================================] 0000/0020 VUs  15s  100.00 iters/s\n     █ main index page\n\n       ✓ is status 200\n\n     checks.........................: 100.00% ✓ 1501       ✗ 0   \n     data_received..................: 3.6 MB  239 kB/s\n     data_sent......................: 73 kB   4.8 kB/s\n     group_duration.................: avg=278.22µs min=225.94µs med=260.97µs max=4.7ms    p(95)=304.74µs p(99)=963.37µs p(99.99)=4.21ms   count=1501\n     http_req_blocked...............: avg=9.72µs   min=160ns    med=262ns    max=922.33µs p(95)=361ns    p(99)=649.83µs p(99.99)=919.25µs count=1501\n     http_req_connecting............: avg=700ns    min=0s       med=0s       max=99.76µs  p(95)=0s       p(99)=44.79µs  p(99.99)=96.78µs  count=1501\n     http_req_duration..............: avg=213.93µs min=181.89µs med=209.62µs max=588.97µs p(95)=238.92µs p(99)=327.53µs p(99.99)=586.16µs count=1501\n       { expected_response:true }...: avg=213.93µs min=181.89µs med=209.62µs max=588.97µs p(95)=238.92µs p(99)=327.53µs p(99.99)=586.16µs count=1501\n     ✓ { gzip:yes }.................: avg=213.93µs min=181.89µs med=209.62µs max=588.97µs p(95)=238.92µs p(99)=327.53µs p(99.99)=586.16µs count=1501\n     http_req_failed................: 0.00%   ✓ 0          ✗ 1501\n     http_req_receiving.............: avg=21.72µs  min=14.74µs  med=19.78µs  max=194.79µs p(95)=27.82µs  p(99)=93.34µs  p(99.99)=193.84µs count=1501\n     http_req_sending...............: avg=57.33µs  min=25.28µs  med=31.96µs  max=312.68µs p(95)=202.96µs p(99)=211.36µs p(99.99)=309.35µs count=1501\n     http_req_tls_handshaking.......: avg=7.8µs    min=0s       med=0s       max=744.19µs p(95)=0s       p(99)=547.02µs p(99.99)=740.18µs count=1501\n     http_req_waiting...............: avg=134.87µs min=0s       med=152.74µs max=520.46µs p(95)=174.36µs p(99)=230.68µs p(99.99)=510.61µs count=1501\n     http_reqs......................: 1501    100.053087/s\n     iteration_duration.............: avg=291.89µs min=236.67µs med=273.92µs max=4.72ms   p(95)=319.85µs p(99)=983.59µs p(99.99)=4.24ms   count=1501\n     iterations.....................: 1501    100.053087/s\n     vus............................: 20      min=20       max=20\n     vus_max........................: 20      min=20       max=20Process finished (15.58 seconds)\n```\n\n![benchmark-rps.js](/screenshots/rps/plot.png)\n\n## User Concurrency Benchmarks\n\nUser concurrency 4 stage benchmarks with [`psrecord`](https://github.com/astrofrog/psrecord/)\n\n```\nTIME=30\nDOMAIN=https://yourdomain.com/\npsrecord \"taskset -c 0-3 k6 run -e STAGETIME=${TIME}s -e URL=$DOMAIN --no-usage-report --out json=summary-raw2.gz benchmark2.js\" --include-children --interval 0.1 --duration 30 --log psrecord-user.log --plot plot-user.png\n```\n\n```\nTIME=30\nDOMAIN=https://yourdomain.com/\npsrecord \"taskset -c 0-3 k6 run -e STAGETIME=${TIME}s -e URL=$DOMAIN --no-usage-report --out json=summary-raw2.gz benchmark2.js\" --include-children --interval 0.1 --duration 30 --log psrecord-user.log --plot plot-user.png\n\n\n```\n\n```\ncat summary.json | jq -r '.metrics.iterations.values'\n{\n  \"count\": 16510,\n  \"rate\": 549.995877862512\n}\n\ntotal_reqs=$(cat summary.json | jq -r '.metrics.iterations.values.count')\necho $total_reqs\n16510\n\ntotal_time_ms=$(cat summary.json | jq -r '.state.testRunDurationMs')\necho $total_time_ms\n30018.4068\n\nreq_avg=$(echo \"scale=4; (($total_reqs*1000)+1)/$total_time_ms\" | bc)\necho $req_avg\n549.9959\n```\n```\ncat summary.json | jq -r\n{\n  \"root_group\": {\n    \"name\": \"\",\n    \"path\": \"\",\n    \"id\": \"d41d8cd98f00b204e9800998ecf8427e\",\n    \"groups\": [],\n    \"checks\": [\n      {\n        \"path\": \"::is status 200\",\n        \"id\": \"548d37ca5f33793206f7832e7cea54fb\",\n        \"passes\": 16510,\n        \"fails\": 0,\n        \"name\": \"is status 200\"\n      }\n    ]\n  },\n  \"options\": {\n    \"summaryTrendStats\": [\n      \"avg\",\n      \"min\",\n      \"med\",\n      \"max\",\n      \"p(95)\",\n      \"p(99)\",\n      \"p(99.99)\",\n      \"count\"\n    ],\n    \"summaryTimeUnit\": \"\",\n    \"noColor\": false\n  },\n  \"state\": {\n    \"isStdOutTTY\": true,\n    \"isStdErrTTY\": true,\n    \"testRunDurationMs\": 30018.4068\n  },\n  \"metrics\": {\n    \"iterations\": {\n      \"type\": \"counter\",\n      \"contains\": \"default\",\n      \"values\": {\n        \"count\": 16510,\n        \"rate\": 549.995877862512\n      }\n    },\n    \"http_req_receiving\": {\n      \"type\": \"trend\",\n      \"contains\": \"time\",\n      \"values\": {\n        \"count\": 16510,\n        \"avg\": 36.10654372192611,\n        \"min\": 0.059631,\n        \"med\": 31.0860625,\n        \"max\": 1339.348538,\n        \"p(95)\": 54.239267049999995,\n        \"p(99)\": 132.0235648099999,\n        \"p(99.99)\": 1252.4198957093668\n      }\n    },\n    \"checks\": {\n      \"type\": \"rate\",\n      \"contains\": \"default\",\n      \"values\": {\n        \"rate\": 1,\n        \"passes\": 16510,\n        \"fails\": 0\n      }\n    },\n    \"data_sent\": {\n      \"type\": \"counter\",\n      \"contains\": \"data\",\n      \"values\": {\n        \"count\": 2369335,\n        \"rate\": 78929.4054073516\n      }\n    },\n    \"iteration_duration\": {\n      \"type\": \"trend\",\n      \"contains\": \"time\",\n      \"values\": {\n        \"count\": 16510,\n        \"avg\": 45.59901832755892,\n        \"min\": 25.148598,\n        \"med\": 40.4515685,\n        \"max\": 1348.143286,\n        \"p(95)\": 64.59459915000001,\n        \"p(99)\": 143.66649320999957,\n        \"p(99.99)\": 1261.8934037913673\n      }\n    },\n    \"data_received\": {\n      \"type\": \"counter\",\n      \"contains\": \"data\",\n      \"values\": {\n        \"count\": 372009371,\n        \"rate\": 12392708.696318952\n      }\n    },\n    \"http_req_tls_handshaking\": {\n      \"type\": \"trend\",\n      \"contains\": \"time\",\n      \"values\": {\n        \"p(95)\": 0,\n        \"p(99)\": 0,\n        \"p(99.99)\": 14.321864458399698,\n        \"count\": 16510,\n        \"avg\": 0.03539912822531798,\n        \"min\": 0,\n        \"med\": 0,\n        \"max\": 16.66999\n      }\n    },\n    \"http_req_failed\": {\n      \"type\": \"rate\",\n      \"contains\": \"default\",\n      \"values\": {\n        \"rate\": 0,\n        \"passes\": 0,\n        \"fails\": 16510\n      }\n    },\n    \"http_req_blocked\": {\n      \"values\": {\n        \"p(99.99)\": 22.952176860398826,\n        \"count\": 16510,\n        \"avg\": 0.06179921380982189,\n        \"min\": 0.000127,\n        \"med\": 0.000219,\n        \"max\": 59.246316,\n        \"p(95)\": 0.000239,\n        \"p(99)\": 0.00036290999999999987\n      },\n      \"type\": \"trend\",\n      \"contains\": \"time\"\n    },\n    \"vus\": {\n      \"values\": {\n        \"value\": 1,\n        \"min\": 1,\n        \"max\": 49\n      },\n      \"type\": \"gauge\",\n      \"contains\": \"default\"\n    },\n    \"http_reqs\": {\n      \"type\": \"counter\",\n      \"contains\": \"default\",\n      \"values\": {\n        \"count\": 16510,\n        \"rate\": 549.995877862512\n      }\n    },\n    \"http_req_waiting\": {\n      \"type\": \"trend\",\n      \"contains\": \"time\",\n      \"values\": {\n        \"p(99.99)\": 59.61232987369813,\n        \"count\": 16510,\n        \"avg\": 8.845250028285916,\n        \"min\": 7.561289,\n        \"med\": 8.307763,\n        \"max\": 65.514674,\n        \"p(95)\": 11.69161625,\n        \"p(99)\": 19.115903949999993\n      }\n    },\n    \"http_req_duration\": {\n      \"values\": {\n        \"count\": 16510,\n        \"avg\": 44.9799197625076,\n        \"min\": 24.640801,\n        \"med\": 39.877318,\n        \"max\": 1347.61271,\n        \"p(95)\": 63.726093199999994,\n        \"p(99)\": 143.15519861999957,\n        \"p(99.99)\": 1261.191049104467\n      },\n      \"thresholds\": {\n        \"avg\u003c150\": {\n          \"ok\": true\n        },\n        \"p(95)\u003c500\": {\n          \"ok\": true\n        }\n      },\n      \"type\": \"trend\",\n      \"contains\": \"time\"\n    },\n    \"http_req_duration{expected_response:true}\": {\n      \"values\": {\n        \"p(99.99)\": 1261.191049104467,\n        \"count\": 16510,\n        \"avg\": 44.9799197625076,\n        \"min\": 24.640801,\n        \"med\": 39.877318,\n        \"max\": 1347.61271,\n        \"p(95)\": 63.726093199999994,\n        \"p(99)\": 143.15519861999957\n      },\n      \"type\": \"trend\",\n      \"contains\": \"time\"\n    },\n    \"http_req_connecting\": {\n      \"type\": \"trend\",\n      \"contains\": \"time\",\n      \"values\": {\n        \"min\": 0,\n        \"med\": 0,\n        \"max\": 7.982053,\n        \"p(95)\": 0,\n        \"p(99)\": 0,\n        \"p(99.99)\": 7.965347443099998,\n        \"count\": 16510,\n        \"avg\": 0.023538600847970922\n      }\n    },\n    \"http_req_sending\": {\n      \"values\": {\n        \"min\": 0.016031,\n        \"med\": 0.026752,\n        \"max\": 9.180571,\n        \"p(95)\": 0.03207839999999999,\n        \"p(99)\": 0.04113023999999999,\n        \"p(99.99)\": 2.363560251196925,\n        \"count\": 16510,\n        \"avg\": 0.028126012295578446\n      },\n      \"type\": \"trend\",\n      \"contains\": \"time\"\n    },\n    \"vus_max\": {\n      \"type\": \"gauge\",\n      \"contains\": \"default\",\n      \"values\": {\n        \"value\": 50,\n        \"min\": 50,\n        \"max\": 50\n      }\n    }\n  }\n}\n```\n\nFilter for `http_req_duration` and status = `200`\n\n```\npzcat -f summary-raw.gz | jq '. | select(.type==\"Point\" and .metric == \"http_req_duration\" and .data.tags.status \u003e= \"200\")'\n```\n\nAverage for `http_req_duration` and status = `200`\n\n```\npzcat -f summary-raw.gz | jq '. | select(.type==\"Point\" and .metric == \"http_req_duration\" and .data.tags.status \u003e= \"200\") | .data.value' | jq -s 'add/length'\n```\n\nMin for `http_req_duration` and status = `200`\n\n```\npzcat -f summary-raw.gz | jq '. | select(.type==\"Point\" and .metric == \"http_req_duration\" and .data.tags.status \u003e= \"200\") | .data.value' | jq -s min\n```\n\nMax for `http_req_duration` and status = `200`\n\n```\npzcat -f summary-raw.gz | jq '. | select(.type==\"Point\" and .metric == \"http_req_duration\" and .data.tags.status \u003e= \"200\") | .data.value' | jq -s max\n```\n\n`http_reqs`\n\nTotal requests\n\n```\npzcat -f summary-raw.gz | jq '. | select(.type==\"Point\" and .metric == \"http_reqs\" and .data.tags.status \u003e= \"200\") | .data.value' | jq -s 'add'\n16510\n```\n\n```\npzcat -f summary-raw.gz | jq '. | select(.type==\"Point\" and .metric == \"http_reqs\" and .data.tags.status \u003e= \"200\")' | jq -c | tail -2 | jq\n{\n  \"type\": \"Point\",\n  \"data\": {\n    \"time\": \"2022-07-11T00:18:34.249760961Z\",\n    \"value\": 1,\n    \"tags\": {\n      \"expected_response\": \"true\",\n      \"group\": \"\",\n      \"url\": \"https://domain.com/\",\n      \"proto\": \"HTTP/2.0\",\n      \"tls_version\": \"tls1.3\",\n      \"status\": \"200\",\n      \"scenario\": \"default\",\n      \"stage\": \"2\",\n      \"name\": \"https://domain.com/\",\n      \"method\": \"GET\"\n    }\n  },\n  \"metric\": \"http_reqs\"\n}\n{\n  \"type\": \"Point\",\n  \"data\": {\n    \"time\": \"2022-07-11T00:18:34.29347122Z\",\n    \"value\": 1,\n    \"tags\": {\n      \"group\": \"\",\n      \"stage\": \"2\",\n      \"method\": \"GET\",\n      \"status\": \"200\",\n      \"tls_version\": \"tls1.3\",\n      \"scenario\": \"default\",\n      \"url\": \"https://domain.com/\",\n      \"name\": \"https://domain.com/\",\n      \"proto\": \"HTTP/2.0\",\n      \"expected_response\": \"true\"\n    }\n  },\n  \"metric\": \"http_reqs\"\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcentminmod%2Fk6-benchmarking","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcentminmod%2Fk6-benchmarking","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcentminmod%2Fk6-benchmarking/lists"}