oha
介绍oha 是一个开源的 HTTP 负载测试工具,用于测试服务器的性能
- 具体的使用场景
- 性能测试:模拟高并发请求以测试 web 服务的性能。
- 负载测试:检测系统在高负载情况下的表现。
- 容量规划:帮助确定服务器的硬件和网络需求。
- 稳定性测试:确保在长期运行下系统的稳定性。
- 压力测试:查找系统的瓶颈,从而优化性能。
安装
该程序基于稳定的 Rust 构建,make并具备cmake通过 Cargo 安装的先决条件。
cargo install
oha您可以选择针对native-tls而不是rustls构建 oha 。
cargo install --no-default-features --features rustls oha
您可以通过启用功能来启用 VSOCK 支持vsock。cargo install --features vsock oha
在 Arch Linux 上
pacman -S
oha在 macOS 上 (Homebrew)
brew install
oha 在 Windows 上
(winget) winget install hatoo.oha
在 Debian 上(Azlux 的存储库)
echo "deb [signed-by=/usr/share/keyrings/azlux-archive-keyring.gpg] http://packages.azlux.fr/debian/ stable main" | sudo tee /etc/apt/sources.list.d/azlux.list sudo wget -O /usr/share/keyrings/azlux-archive-keyring.gpg https://azlux.fr/repo.gpg apt update apt install oha