Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Web server performance test with ApacheBench

DZone's Guide to

Web server performance test with ApacheBench

· Performance Zone
Free Resource

Transform incident management with machine learning and analytics to help you maintain optimal performance and availability while keeping pace with the growing demands of digital business with this eBook, brought to you in partnership with BMC.


When you set up new web server instance you need to test its performance. Same thing when you need to change some option that can directly affect web server performance or you want to make it better. There are a lot of tools available for doing that, but my favorite is ApacheBench.
Basically it is simple tool that is available almost on all Linux distributions like basic package. Usage:

ab [options] [http[s]://]hostname[:port]/path

To perform web server performance test with ApacheBench execute this sample command that will send 1000 requests to the server:

ab -n 1000 http://HOSTNAME:80/

Most used options for ApacheBench are:

-n requests     Number of requests to perform
-c concurrency  Number of multiple requests to make

Also there are useful options like:

-e filename     Output CSV file with percentages served
-X proxy:port   Proxyserver and port number to use
-k              Use HTTP KeepAlive feature

For full list of options use help:

ab -h

I hope it will be useful to know about this great tool.

Evolve your approach to Application Performance Monitoring by adopting five best practices that are outlined and explored in this e-book, brought to you in partnership with BMC.

Topics:

Published at DZone with permission of Alen Komljen, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}