I am running a php based web application in Ubuntu platform. I want to perform load testing to 1000 concurrent users for the login process. (when correct username and password are provided, it will be directed to the home page).
I am using Apache Benchmark (ab) to do the load testing. I used this command to load the login page alone.
ab -n 1000 -c 1000 http://localhost/etsp/
How can I extend this command to test the login process? What I meant was, is there any way to provide username and password to this?
Any hint will be highly appreciated.
ApacheBench ( ab ) is a benchmarking tool that measures the performance of a web server by inundating it with HTTP requests and recording metrics for latency and success.
ApacheBench ( ab is the real program file name) is a single-threaded command line computer program used for benchmarking (measuring the performance of) HTTP web servers.
Apache Bench (ab) is a load testing and benchmarking tool for Hypertext Transfer Protocol (HTTP) server. It can be run from command line and it is very simple to use. A quick load testing output can be obtained in just one minute.
Look at the man page for Apache Benchmark for the option that makes the most sense given your application:
HTTP Basic Authentication
You want the -A
option to supply basic authentication credentials.
Cookie-Based Authentication
You want the -C
option to supply the cookie name and value.
Form-based Authentication Trigger
You want the -T
and -p
options to specify a POST file and content type for that file. If it's a standard HTML form, the content type is probably going to be application/x-www-form-urlencoded
. The file is going to contain the login form field name/value pairs encoded for the form submission. The Stack Overflow answer application/x-www-form-urlencoded or multipart/form-data? has information about how to do this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With