Apache Bench – How to Load Test Web Server

Apache Bench – How to Load Test Web Server


hello and welcome to red stapler in this video I’m going to show you how to test max concurrent connection on
your website using apache bench this will let you know approximated number of
users that your site can handle at the same time and also the overview of the
site performance let’s go check it out the apache bench or ab tool comes with apache so if you install xampp you already have it if not just download and
install apache server from the website the Apache bench is located under apache/bin folder you can run it using command prompt and execute ab.exe it will show you the syntax and option available now I’m going to run a basic
command to start flooding my local server with test requests the -n tell ab tool that we want to make a total of 1000 requests the -c set the
number of concurrent requests at the same time so this means we’ll have ab tool to make ten requests concurrently as fast as possible and stop until we
reach the total of 1,000 requests here comes the stat you see the total time
taken for the test the number of completed and fail requests time used
for each request and also the distribution stat of the request served
under a certain time so you can see that for a first test the time used for each
request is 0.492 milliseconds and there is no failed request yet now let’s
increase the max concurrent request to 50 and try again you see that the time use each request
this time is getting slower still no fail request though
let’s hit the server with something bigger let’s increase the max connection
to 2000 and max concurrent to 200 and I’m going to also add the – k option
which will send a keepalive header along with the request this we asked the
server not to shut down the connection after each request is done but keep
reusing it instead you see that it takes considerably longer and now we started
to have failed request you see from the distribution step below that the
congestion start after around 95% of the requests were made so that should be the
limit of our server you can try adjusting the max number of the requests
and the max concurrency level to find threshold that your web server is
starting to break one final note is while ab tool is very useful, abusing it to flood
the request against other website as an attack is illegal so don’t do it now
thanks for watching and hope you guys enjoyed this video don’t forget to Like
and subscribe for more interesting video bye

3 thoughts on “Apache Bench – How to Load Test Web Server

  1. Please do step by step guide instead of jumping on to installation without mentioning where the actually link is.

Leave a Reply

Your email address will not be published. Required fields are marked *