{"id":1231,"date":"2017-03-09T22:58:41","date_gmt":"2017-03-09T17:28:41","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=1231"},"modified":"2026-09-30T10:15:11","modified_gmt":"2026-09-30T04:45:11","slug":"ab-benchmark-perform-load-testing","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/ab-benchmark-perform-load-testing\/","title":{"rendered":"How to Perform Website Load Testing Using ApacheBench (ab) on Ubuntu"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>Post Date<\/strong>: March 9, 2017<br><strong>Last Updated<\/strong>: September 30, 2026<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Web server and website performance can be evaluated using various load-testing and benchmarking tools. ApacheBench (<code>ab<\/code>) is a simple command-line utility that can be used to perform basic load and performance testing on a website or web server. It allows you to send multiple HTTP requests concurrently and provides useful statistics such as response time, requests per second, transfer rate, and connection times.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this post, we will explain how to install ApacheBench on an Ubuntu system and use it to perform a basic load test against a website.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before performing the ApacheBench load test, ensure that the following requirements are met:<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>An Ubuntu server or system with access to the command line. The same procedure can also be adapted for other Linux distributions or macOS.<\/li>\n\n\n\n<li>Sufficient privileges, such as <code>sudo<\/code> or root access, to install the ApacheBench utility.<\/li>\n\n\n\n<li>The <code>apache2-utils<\/code> package installed on the system, which provides the <code>ab<\/code> utility.<\/li>\n\n\n\n<li>A valid domain name or IP address of the website or web server that you want to test.<\/li>\n\n\n\n<li>Authorization to perform load testing against the target website or server, especially when testing a third-party or production environment.<\/li>\n<\/ol>\n\n\n<h2>Implementation<\/h2>\n<h3>Assumption:<\/h3>\n<ol>\n<li>We will perform ab benchmark testing on an Ubuntu host. We can perform the same testing on Mac or any Linux flavour as well. We need to install the <strong><em>ab <\/em><\/strong> utility on the machine<\/li>\n<li>Domain name or IP address on which we want to perform load testing.<\/li>\n<\/ol>\n<h3>Performance Testing:<\/h3>\n<p>Let&#8217;s start with ab utility installation. Since this post deals with an Ubuntu host, use apt-get to install the ab utility.<\/p>\n<p><code><\/code><code>apt-get -y install apache2-utils<\/code><\/p>\n<p>The above command will install the ab utility on the host.<\/p>\n<p>Now, execute the ab benchmark command to get the stats.<\/p>\n<p><code>ab -n 100 -c 10 http:\/\/domain.tld<\/code><\/p>\n<p>where,<\/p>\n<p>n &#8211; Number of requests to perform for the benchmarking session. The default is to just perform a single request, which usually leads to non-representative benchmarking results.<\/p>\n<p>c- Number of multiple requests to perform at a time. To load a single webpage, normally the browser sends multiple requests to serve a single page. In our example, we assumed that 10 requests are being sent to load the page.<\/p>\n<p>The sample output<\/p>\n<blockquote>\n<p>Server Software:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Apache<br \/>Server Hostname:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 domain.tld<br \/>Server Port:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 80<\/p>\n<p>Document Path:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/<br \/>Document Length:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 51753 bytes<\/p>\n<p>Concurrency Level:\u00a0\u00a0\u00a0\u00a0\u00a0<strong> 10<\/strong><br \/><em>Time taken for tests:\u00a0\u00a0 <strong>26.274 seconds<\/strong><\/em><br \/>Complete requests:\u00a0\u00a0\u00a0\u00a0\u00a0 <strong>100<\/strong><br \/>Failed requests:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0<br \/>Total transferred:\u00a0\u00a0\u00a0\u00a0\u00a0 5197900 bytes<br \/>HTML transferred:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 5175300 bytes<br \/>Requests per second:\u00a0\u00a0\u00a0 3.81 [#\/sec] (mean)<br \/>Time per request:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2627.362 [ms] (mean)<br \/>Time per request:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 262.736 [ms] (mean, across all concurrent requests)<br \/>Transfer rate:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 193.20 [Kbytes\/sec] received<\/p>\n<p>Connection Times (ms)<br \/>min\u00a0 mean[+\/-sd] median\u00a0\u00a0 max<br \/>Connect:\u00a0\u00a0\u00a0\u00a0\u00a0 271\u00a0 305\u00a0 35.7\u00a0\u00a0\u00a0 293\u00a0\u00a0\u00a0\u00a0 482<br \/>Processing:\u00a0 1760 2177 430.1\u00a0\u00a0 2063\u00a0\u00a0\u00a0 5716<br \/>Waiting:\u00a0\u00a0\u00a0\u00a0\u00a0 561\u00a0 828\u00a0 78.1\u00a0\u00a0\u00a0 821\u00a0\u00a0\u00a0 1242<br \/>Total:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2061 2482 429.0\u00a0\u00a0 2370\u00a0\u00a0\u00a0 6016<\/p>\n<p>Percentage of the requests served within a certain time (ms)<br \/>50%\u00a0\u00a0 2370<br \/>66%\u00a0\u00a0 2458<br \/>75%\u00a0\u00a0 2542<br \/>80%\u00a0\u00a0 2584<br \/>90%\u00a0\u00a0 2780<br \/>95%\u00a0\u00a0 3021<br \/>98%\u00a0\u00a0 3605<br \/>99%\u00a0\u00a0 6016<br \/>100%\u00a0\u00a0 6016<\/p>\n<\/blockquote>\n<p>From the above example, we can see that the concurrency level is 10, which means that at a time, we are sending 10 concurrent connections.<\/p>\n<p>The time taken for tests gives the output on how long the benchmark utility takes to complete the test.<\/p>\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">ApacheBench (<code>ab<\/code>) provides a simple way to perform basic load and performance testing of a website or web server from the command line. By specifying the total number of requests and the concurrency level, you can measure important performance metrics such as response time, requests per second, and transfer rate.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The results can help identify basic performance characteristics and potential bottlenecks under concurrent requests. For more advanced load-testing scenarios, tools such as JMeter or other specialized performance-testing solutions may be more appropriate.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">FAQs<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. What is ApacheBench (<code>ab<\/code>)?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">ApacheBench (<code>ab<\/code>) is a command-line benchmarking tool used to perform basic load and performance testing of web servers and websites. It can send multiple HTTP requests and provide statistics about server performance.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. How do I install ApacheBench on Ubuntu?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You can install ApacheBench using the following command:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">apt-get -y install apache2-utils<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>apache2-utils<\/code> package includes the <code>ab<\/code> utility.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. What does the <code>-n<\/code> option mean in ApacheBench?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>-n<\/code> option specifies the total number of requests that ApacheBench should send during the test. For example, <code>-n 100<\/code> sends 100 requests.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Talk to our experts<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Looking for the right technology solution for your business?. Our experts can help with\u00a0web hosting, domain registration, DevOps and cloud, software development, web applications, mobile applications, and enterprise solutions. Get in touch with our team\u00a0<a href=\"https:\/\/pheonixsolutions.com\/contact\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Post Date: March 9, 2017Last Updated: September 30, 2026 Introduction Web server and website performance can be evaluated using various [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1022],"tags":[296,297,295],"class_list":["post-1231","post","type-post","status-publish","format-standard","hentry","category-web-architecture","tag-ab","tag-apache-benchmark","tag-benchmark","psol-cat-web-architecture"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-jR","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1231","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=1231"}],"version-history":[{"count":1,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1231\/revisions"}],"predecessor-version":[{"id":12034,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1231\/revisions\/12034"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1231"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}