Python script to simulate multiple concurrent requests to web application
I first created this script to heavy test the web application hosted in elastic beanstalk.
Why python? Just for fun :)
First, define a main function for the python script
Then create a function to perform http requests
If you don’t understand why need the cookie, you can refer Session hijacking: facebook.com example.
Note that the above function
http_test() actually perform POST login, GET sales report, POST sales report
Now in your
main function, replace
# http requests goes here with
Make the python script executable
if you run this script, means 1 client with 20 (for loop) x 3 requests, which equals to 60 requests one after one.
What if want to make it 100 concurrent connections?
Simply create another shell script, let’s name it run.sh
also make it executable
Then run it
Now you can simulate 100 concurrent connections with each 60 requests.
You can download the scripts here: