Forrest logo
back to the wrk tool

wrk:tldr:aca9c

wrk: Run a benchmark with a custom header.
$ wrk -t${2} -c${5} -d${5s} -H "${Host: example-com}" "${http:--example-com-index-html}"
try on your machine

This command is using the "wrk" tool, which is a modern HTTP benchmarking tool, to measure the performance of a web server under a specific load.

Let's break down each parameter used in this command:

  • -t${2}: This sets the number of threads to ${2}. The value of ${2} is a placeholder and should be replaced by the desired number of threads. Threads represent concurrent connections to the server that will be simulated in order to create load.

  • -c${5}: This sets the number of connections to ${5}. Again, the value of ${5} is a placeholder and should be replaced by the desired number of connections. Each connection represents a unique user interacting with the server.

  • -d${5s}: This sets the duration of the test to ${5s}. Like before, ${5s} is a placeholder that should be replaced by the desired duration of the test. The 's' represents seconds. So, this specifies how long the test will run.

  • -H "${Host: example-com}": This sets the Host header of the HTTP request. The Host header usually identifies the target server to access. In this case, it is set to "example-com", which should be replaced by the actual hostname or IP address.

  • "${http:--example-com-index-html}": This specifies the URL (Uniform Resource Locator) that will be used for the benchmarking test. Again, this is a placeholder and should be replaced by the actual URL of the web page you want to test.

Overall, this command will run a benchmark test using the wrk tool with a specified number of threads, connections, and duration. It will send HTTP requests to the specified URL, simulating multiple users interacting with the server, and measure the server's performance under this particular load.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the wrk tool