Sunday, January 6, 2019

Benchmarking web application tools



1. Apache benchmarking 

Home page https://httpd.apache.org/docs/2.4/programs/ab.html

  • 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" functionality 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.
    The final argument is simply the host. By default it will hit http:// protocol if you don't specify it.
ab -k -c 350 -n 20000 example.com/ 

By issuing the command above, you will be hitting http://example.com/ with 350 simultaneous connections until 20 thousand requests are met. It will be done using the keep alive header.


E.g: Get user profile

ab -n2000 -c10 -k -m GET -T "application/json" -H "${accessToken}" http://localhost:8080/api/v1/users/profile


2. Apache Jmeter



Create many users using __UUID() random method example:






References:




No comments:

Post a Comment