How to install wrk on ubuntu system?
1. Purpose
In this post, I will demonstrate how to install wrk, a web URL performance test tool, on Linux/Unix/Mac systems.
2. The Solution
2.1 What is wrk?
wrk is a modern HTTP benchmarking tool capable of generating significant load when run on a single multi-core CPU. It combines a multithreaded design with scalable event notification systems such as epoll and kqueue.
2.2 How to install wrk?
On Ubuntu systems, you should update the local cache first:
root@launch-advisor-20191120:/etc/nginx# apt update....
root@launch-advisor-20191120:/etc/nginx# apt install wrkReading package lists... DoneBuilding dependency treeReading state information... DoneE: Unable to locate package wrk
wrk can only run on Unix-like systems. Such as linux, mac, solaris, etc. It can only be compiled on these systems.
So we can install it from source:
download wrk source code:
sudo apt-get install build-essential libssl-dev git -ygit clone https://github.com/wg/wrk.git wrk
Then build it:
cd wrksudo make
Then we can use the binary:
# move the wrk executable to your PATHsudo cp wrk /usr/local/bin
2.3 Verify the installation of wrk
root@launch-advisor-20191120:~/wrk# wrkUsage: wrk <options> <url> Options: -c, --connections <N> Connections to keep open -d, --duration <T> Duration of test -t, --threads <N> Number of threads to use
-s, --script <S> Load Lua script file -H, --header <H> Add header to request --latency Print latency statistics --timeout <T> Socket/request timeout -v, --version Print version details
Numeric arguments may include a SI unit (1k, 1M, 1G) Time arguments may include a time unit (2s, 2m, 2h)root@launch-advisor-20191120:~/wrk#
3. Summary
In this post, I demonstrated how to install wrk , a great performance test tool on ubuntu systems. That’s it, thanks for your reading.