# 使用 Homebrew, apk, apt, MacPorts, Nix, zypper 安装 wrk

查看 wrk 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:wrk
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install wrk
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install wrk
```

  证据: MacPorts ports tree: net/wrk/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add wrk
```

  证据: Alpine Linux edge package indexes: wrk from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install wrk
```

  证据: Debian stable package indexes: wrk from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- Nix (92%):

```sh
nix profile install nixpkgs#wrk
```

  证据: nixpkgs package indexes: pkgs/by-name/wr/wrk/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- zypper (92%):

```sh
sudo zypper install wrk
```

  证据: openSUSE Tumbleweed package metadata: wrk from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

## 软件包事实

- **软件包键:** brew:wrk
- **软件包管理器:** Homebrew
- **版本:** 4.2.0
- **来源摘要:** HTTP benchmarking tool
- **主页:** <https://github.com/wg/wrk>
- **仓库:** <https://github.com/wg/wrk>
- **最后更新:** 2026-06-25T13:38:12+02:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- wrk (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 4.2.0
## 项目历史与用法

wrk is a high-performance HTTP benchmarking tool by Will Glozer. Its README describes it as a modern tool capable of generating significant load from a single multi-core CPU by combining a multithreaded design with scalable event notification systems such as epoll and kqueue.

The tool became a standard name in web-performance circles because it is small, fast, scriptable with LuaJIT, and easy to invoke in repeatable local benchmarks. It occupies the practical space between older ApacheBench-style smoke tests and heavier distributed load-testing systems.

### 项目历史

The `wg/wrk` repository was created on 20 March 2012, and FreeBSD ports metadata shows wrk entering the FreeBSD ports tree on 1 August 2012. That early packaging matters: wrk quickly became a Unix-packaged benchmarking binary rather than only a GitHub project to build manually.

The 4.x line continued the same minimal command-line design. Git tag metadata places wrk 4.1.0 in January 2018 and 4.2.0 in February 2021. The README still emphasizes the core model: threads, connections, duration, optional latency reporting, custom headers, and optional LuaJIT scripting for request generation, response processing, and custom reporting.

### 采用历史

wrk's adoption is visible in both package-manager coverage and GitHub popularity. The repository has accumulated tens of thousands of stars and thousands of forks, and the tool is packaged across common Unix-like ecosystems. FreeBSD has carried it under `benchmarks/wrk` since 2012.

Its niche adoption came from being able to generate large amounts of HTTP load from one machine, which made it attractive for web-server comparisons, local regression checks, and performance blog posts. The README's own example shows a 30-second run with 12 threads and 400 connections, a command shape that became a common shorthand for quick HTTP load tests.

### 使用方式

The canonical invocation is `wrk -t12 -c400 -d30s URL`, where `-t` sets threads, `-c` sets open HTTP connections, and `-d` sets duration. Users add `--latency` for latency distributions, `-H` for headers, and `-s` for LuaJIT scripts when a static GET request is not enough.

wrk is best used for controlled benchmark comparisons rather than full production traffic modeling. The README warns that the client machine needs enough ephemeral ports and that per-request scripting or response callbacks reduce the amount of load the tool can generate.

### 为什么软件包爱好者会关心

wrk is one of the package-manager canonical HTTP benchmark binaries: short name, single executable, stable README usage, and enough performance to stress real services from a laptop or build host. That combination made it a frequent dependency of performance-minded developers even when it is not a library dependency of applications.

It is also historically important as a C/LuaJIT benchmark tool in a field crowded with language-specific clients. Package nerds care because it offers a compact, reproducible baseline for HTTP throughput and latency testing across machines and operating systems.

### 时间线

- 2012-03-20: The `wg/wrk` GitHub repository is created.
- 2012-08-01: FreeBSD ports adds `benchmarks/wrk`.
- 2018-01-21: Git tag metadata places wrk 4.1.0 in early 2018.
- 2021-02-07: Git tag metadata places wrk 4.2.0 in early 2021.
- 2020s: wrk remains widely packaged and commonly cited for HTTP benchmarking.

### Related projects

- LuaJIT is used for wrk's scripting extension point.
- ApacheBench, siege, vegeta, hey, and k6 are common comparison points in HTTP benchmarking and load testing.
- go-wrk and other similarly named tools are separate implementations or derivatives inspired by wrk's niche.

### 来源

- <https://api.github.com/repos/wg/wrk>
- <https://api.github.com/repos/wg/wrk/git/ref/tags/4.1.0>
- <https://api.github.com/repos/wg/wrk/git/ref/tags/4.2.0>
- <https://github.com/wg/wrk>
- <https://www.freshports.org/benchmarks/wrk/>


## 安全说明

broad file, network, media, or database tool signal.

- **Geiger 风险:** blue / 中
- broad file, network, media, or database tool signal

## 其他软件包管理器记录

- Debian apt - wrk - 4.1.0-4+b1: normalized package name match | Debian stable package indexes: wrk from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | HTTP benchmarking tool | https://github.com/wg/wrk
- Nix - wrk: normalized package name match | nixpkgs package indexes: pkgs/by-name/wr/wrk/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - wrk - 4.1.0-4build2: normalized package name match | Ubuntu 24.04 LTS package indexes: wrk from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | HTTP benchmarking tool | https://github.com/wg/wrk
- apk - wrk - 4.2.0-r3: normalized package name match | Alpine Linux edge package indexes: wrk from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | wrk is a modern HTTP benchmarking tool | https://github.com/wg/wrk
- apk - wrk-doc - 4.2.0-r3: normalized package name match | Alpine Linux edge package indexes: wrk-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | wrk is a modern HTTP benchmarking tool (documentation) | https://github.com/wg/wrk
- zypper - wrk - 4.2.0-2.5: normalized package name match | openSUSE Tumbleweed package metadata: wrk from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Modern HTTP benchmarking tool | https://github.com/wg/wrk
- MacPorts - wrk: normalized package name match | MacPorts ports tree: net/wrk/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/wrk.yml](https://github.com/mxcl/pkgdb/blob/main/combined/wrk.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
