Files
tldr/pages.zh/common/wrk.md

16 lines
565 B
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# wrk
> HTTP 基准测试工具。
> 更多信息:<https://github.com/wg/wrk>。
- 运行一个基准测试,持续 `30` 秒,使用 `12` 个线程,并保持 `400` 个 HTTP 连接打开:
`wrk -t{{12}} -c{{400}} -d{{30s}} "{{http://127.0.0.1:8080/index.html}}"`
- 运行一个带有自定义头部的基准测试:
`wrk -t{{2}} -c{{5}} -d{{5s}} -H "{{Host: example.com}}""{{http://example.com/index.html}}"`
- 运行一个请求超时为 `2` 秒的基准测试:
`wrk -t{{2}} -c{{5}} -d{{5s}} --timeout {{2s}} "{{http://example.com/index.html}}"`