1. 前言
上一篇文章我们了解了bombardier,并知道了bombardier.yml与开源项目bombardier的关系,接下来的文章我们了解一下wrk、wrk2,并对比一下它们与bombardier的关系
2. 认识wrk
wrk是一种现代 HTTP 基准测试工具,能够在单个多核 CPU 上运行时产生大量负载。它结合了多线程设计和可扩展的事件通知系统,例如 epoll 和 kqueue。
其支持参数:
-c, --connections: total number of HTTP connections to keep open with
each thread handling N = connections/threads
-d, --duration: duration of the test, e.g. 2s, 2m, 2h
-t, --threads: total number of threads to use
-s, --script: LuaJIT script, see SCRIPTING
-H, --header: HTTP header to add to request, e.g. "User-Agent: wrk"
--latency: print detailed latency statistics
--timeout: record a timeout if a response is not received within
this amount of time.
基础用法:
运行了30秒的基准测试, 使用2个线程