Skip to content

Instantly share code, notes, and snippets.

@NISH1001
Created July 10, 2018 09:43
Show Gist options
  • Save NISH1001/8f77ccc0797ab9cb6aeae862ed71099b to your computer and use it in GitHub Desktop.
Save NISH1001/8f77ccc0797ab9cb6aeae862ed71099b to your computer and use it in GitHub Desktop.

-c("Concurrency")

Indicates how many clients (people/users) will be hitting the site at the same time. While ab runs, there will be -c clients hitting the site. This is what actually decides the amount of stress your site will suffer during the benchmark.

-n

Indicates how many requests are going to be made. This just decides the length of the benchmark. A high -n value with a -c value that your server can support is a good idea to ensure that things don't break under sustained stress: it's not the same to support stress for 5 seconds than for 5 hours.

-k

This does the "KeepAlive" funcionality browsers do by nature. You don't need to pass a value for -k as it it "boolean" (meaning: it indicates that you desire for your test to use the Keep Alive header from HTTP and sustain the connection). Since browsers do this and you're likely to want to simulate the stress and flow that your site will have from browsers, it is recommended you do a benchmark with this.

ab -p test.json -T application/json  -k -c 8 -n 8 http://127.0.0.1:8000/predict/emotion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment