{"id":3265,"date":"2020-11-21T21:27:22","date_gmt":"2020-11-21T15:57:22","guid":{"rendered":"https:\/\/www.24x7serversupport.com\/blog\/?p=3265"},"modified":"2020-11-21T21:50:51","modified_gmt":"2020-11-21T16:20:51","slug":"load-testing-web-servers-with-siege-benchmarking-tool","status":"publish","type":"post","link":"https:\/\/www.24x7serversupport.com\/blog\/load-testing-web-servers-with-siege-benchmarking-tool\/","title":{"rendered":"Load Testing Web Servers with Siege Benchmarking Tool"},"content":{"rendered":"\n<p>Knowing how much traffic your web server can handle when under stress is essential for planning future grow of your website or application. By using tool called\u00a0<strong>siege<\/strong>, you can run a\u00a0load test on your server\u00a0and see how your system performs under different circumstances.<\/p>\n\n\n\n<p>You can use&nbsp;<strong>siege<\/strong>&nbsp;to evaluate the amount of data transferred, response time, transaction rate, throughput, concurrency and how many times the server returned responses. The tool has three modes, in which it can operate \u2013&nbsp;<strong>regression<\/strong>,&nbsp;<strong>internet simulation<\/strong>&nbsp;and&nbsp;<strong>brute force<\/strong>.<\/p>\n\n\n\n<p><strong>Important<\/strong>:&nbsp;<strong>Siege<\/strong>&nbsp;should only be ran against servers you own or on such you have explicit permission to test. In some countries, using siege on unauthorized websites can be considered a crime.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Installing Siege HTTP Load Testing Utility in Linux<\/h3>\n\n\n\n<p><strong>Siege<\/strong>&nbsp;is multi platform and can be installed under&nbsp;<strong>Ubuntu\/Debian<\/strong>&nbsp;and&nbsp;<strong>CentOS\/RHEL<\/strong>&nbsp;distributions using following commands.<\/p>\n\n\n\n<p>To install&nbsp;<strong>Siege<\/strong>&nbsp;under&nbsp;<strong>Debin\/Ubuntu<\/strong>, you can run:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo apt install siege\n<\/pre>\n\n\n\n<p>For&nbsp;<strong>CentOS\/RHEL<\/strong>, you need to install and enable repository to install siege with:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># yum install epel-release\n# yum install siege\n<\/pre>\n\n\n\n<p>Alternatively, you can build the&nbsp;<strong>Siege<\/strong>&nbsp;from source. For that purpose you will need to have&nbsp;<strong>build-essential<\/strong>&nbsp;and development packages installed.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo apt install build-essential       #Ubuntu\/Debian\n# yum groupinstall 'Development Tools'   #CentOS\/RHEL\n<\/pre>\n\n\n\n<p>Then you can download\u00a0<strong>Siege<\/strong>\u00a0using\u00a0wget command\u00a0and install from sources as shown.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ wget http:\/\/download.joedog.org\/siege\/siege-latest.tar.gz\n$ tar -zxvf siege-latest.tar.gz\n$ cd siege-*\/\n$ sudo .\/configure --prefix=\/usr\/local --with-ssl=\/usr\/bin\/openssl\n$ sudo make &amp;&amp; make install\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Configuring Siege HTTP Load Testing Utility in Linux<\/h3>\n\n\n\n<p>Once you have completed the installation, you can adjust your&nbsp;<strong>siege<\/strong>&nbsp;configuration file. It is located in&nbsp;<strong>\/etc\/siege\/siegerc<\/strong>. In case you have decided to build the package from source, you will have to run:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo siege.config\n<\/pre>\n\n\n\n<p>This will generate&nbsp;<strong>siege.conf<\/strong>&nbsp;file located in your user\u2019s home&nbsp;<strong>~\/.siege\/siege.conf<\/strong>.<\/p>\n\n\n\n<p>The contents of the file should look something like this. Note that I have uncomment the&nbsp;<strong>logfile<\/strong>&nbsp;and&nbsp;<strong>time<\/strong>&nbsp;directives:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># cat siegerc |egrep -v \"^$|#\"\n<\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Sample Output<\/h5>\n\n\n\n<pre class=\"wp-block-preformatted\">logfile = $(HOME)\/var\/log\/siege.log\nverbose = false\ncolor = on\nquiet = false\nshow-logfile = true\nlogging = false\ngmethod = HEAD\nparser = true\nnofollow = ad.doubleclick.net\nnofollow = pagead2.googlesyndication.com\nnofollow = ads.pubsqrd.com\nnofollow = ib.adnxs.com\nlimit = 255\nprotocol = HTTP\/1.1\nchunked = true\ncache = false\nconnection = close\nconcurrent = 25\ntime = 1M\ndelay = 0.0\ninternet = false\nbenchmark = false\naccept-encoding = gzip, deflate\nurl-escaping = true\nunique = true\n<\/pre>\n\n\n\n<p>With the current configuration,&nbsp;<strong>siege<\/strong>&nbsp;will imitate 25 concurrent users over 1 minute.<\/p>\n\n\n\n<p>You are now ready to run your siege.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Testing Website Load with Siege Benchmarking Utility<\/h3>\n\n\n\n<p>Running&nbsp;<strong>siege<\/strong>&nbsp;is quite easy, you only need to specify the website you wish to test like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># siege example.com\n<\/pre>\n\n\n\n<p>If the availability remains at&nbsp;<strong>100%<\/strong>&nbsp;and there are no failed connections, your system did well and there were no issues. You should also keep an eye on the response time.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Run Siege Against Multiple Websites<\/h4>\n\n\n\n<p>You can test multiple URLs, by setting\u00a0<strong>siege<\/strong>\u00a0to read them from the file. You can describe the URLs in\u00a0<strong>\/usr\/local\/etc\/urls.txt<\/strong>\u00a0<\/p>\n\n\n\n<p>Now to tell&nbsp;<strong>siege<\/strong>&nbsp;to test the URLs from the file, use the&nbsp;<code>-f<\/code>&nbsp;option like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># siege -f \/usr\/local\/etc\/urls.txt\n<\/pre>\n\n\n\n<p>You can also use command-line options if you want to try different settings from the ones described in the configuration file.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><code>-C<\/code>&nbsp;\u2013 specify your own configuration file.<\/li><li><code>-q<\/code>&nbsp;\u2013 suppresses siege\u2019s output.<\/li><li><code>-g<\/code>&nbsp;\u2013 GET, pull down HTTP headers and display the transaction. Useful for debugging.<\/li><li><code>-c<\/code>&nbsp;\u2013 the number of concurrent users, default is 10.<\/li><li><code>-r<\/code>&nbsp;\u2013 how many times to run the test.<\/li><li><code>-t<\/code>&nbsp;\u2013 how much time to run the test. You can specify S, M, or H ex: \u2013time=10S for 10 seconds.<\/li><li><code>-d<\/code>&nbsp;\u2013 random delay before each request.<\/li><li><code>-b<\/code>&nbsp;\u2013 no delays between requests.<\/li><li><code>-i<\/code>&nbsp;\u2013 user simulation. Uses to hit random URLs.<\/li><li><code>-f<\/code>&nbsp;\u2013 test URLs from specified file.<\/li><li><code>-l<\/code>&nbsp;\u2013 log file.<\/li><li><code>-H<\/code>&nbsp;\u2013 Add a header to request.<\/li><li><code>-A<\/code>&nbsp;\u2013 specify a user agent.<\/li><li><code>-T<\/code>&nbsp;\u2013 Sets Content-Type in request.<\/li><li><code>--no-parser<\/code>&nbsp;\u2013 NO PARSER, turn off the HTML page parser.<\/li><li><code>--no-follow<\/code>&nbsp;\u2013 do not follow HTTP redirects.<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Knowing how much traffic your web server can handle when under stress is essential for planning future grow of your website or application. By using tool called\u00a0siege, you can run a\u00a0load test on your server\u00a0and see how your system performs under different circumstances. You can use&nbsp;siege&nbsp;to evaluate the amount of data transferred, response time, transaction [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_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","enabled":false}}},"categories":[139,30],"tags":[119,136,83],"class_list":["post-3265","post","type-post","status-publish","format-standard","hentry","category-apache","category-centos","tag-apache","tag-debian","tag-ubuntu"],"jetpack_publicize_connections":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Load Testing Web Servers with Siege Benchmarking Tool | 24x7serversupport Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.24x7serversupport.com\/blog\/load-testing-web-servers-with-siege-benchmarking-tool\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Load Testing Web Servers with Siege Benchmarking Tool | 24x7serversupport Blog\" \/>\n<meta property=\"og:description\" content=\"Knowing how much traffic your web server can handle when under stress is essential for planning future grow of your website or application. By using tool called\u00a0siege, you can run a\u00a0load test on your server\u00a0and see how your system performs under different circumstances. You can use&nbsp;siege&nbsp;to evaluate the amount of data transferred, response time, transaction [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.24x7serversupport.com\/blog\/load-testing-web-servers-with-siege-benchmarking-tool\/\" \/>\n<meta property=\"og:site_name\" content=\"24x7serversupport Blog\" \/>\n<meta property=\"article:published_time\" content=\"2020-11-21T15:57:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-11-21T16:20:51+00:00\" \/>\n<meta name=\"author\" content=\"24x7support\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@24x7serversuppo\" \/>\n<meta name=\"twitter:site\" content=\"@24x7serversuppo\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"24x7support\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/load-testing-web-servers-with-siege-benchmarking-tool\/\",\"url\":\"https:\/\/www.24x7serversupport.com\/blog\/load-testing-web-servers-with-siege-benchmarking-tool\/\",\"name\":\"Load Testing Web Servers with Siege Benchmarking Tool | 24x7serversupport Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#website\"},\"datePublished\":\"2020-11-21T15:57:22+00:00\",\"dateModified\":\"2020-11-21T16:20:51+00:00\",\"author\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/load-testing-web-servers-with-siege-benchmarking-tool\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.24x7serversupport.com\/blog\/load-testing-web-servers-with-siege-benchmarking-tool\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/load-testing-web-servers-with-siege-benchmarking-tool\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.24x7serversupport.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Load Testing Web Servers with Siege Benchmarking Tool\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#website\",\"url\":\"https:\/\/www.24x7serversupport.com\/blog\/\",\"name\":\"24x7serversupport Blog\",\"description\":\"Linux | CPanel | WHM | webhosting| Plesk | DirectAdmin | CentOs | Debian | Ubuntu Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.24x7serversupport.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401\",\"name\":\"24x7support\",\"url\":\"https:\/\/www.24x7serversupport.com\/blog\/author\/24x7support\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Load Testing Web Servers with Siege Benchmarking Tool | 24x7serversupport Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.24x7serversupport.com\/blog\/load-testing-web-servers-with-siege-benchmarking-tool\/","og_locale":"en_US","og_type":"article","og_title":"Load Testing Web Servers with Siege Benchmarking Tool | 24x7serversupport Blog","og_description":"Knowing how much traffic your web server can handle when under stress is essential for planning future grow of your website or application. By using tool called\u00a0siege, you can run a\u00a0load test on your server\u00a0and see how your system performs under different circumstances. You can use&nbsp;siege&nbsp;to evaluate the amount of data transferred, response time, transaction [&hellip;]","og_url":"https:\/\/www.24x7serversupport.com\/blog\/load-testing-web-servers-with-siege-benchmarking-tool\/","og_site_name":"24x7serversupport Blog","article_published_time":"2020-11-21T15:57:22+00:00","article_modified_time":"2020-11-21T16:20:51+00:00","author":"24x7support","twitter_card":"summary_large_image","twitter_creator":"@24x7serversuppo","twitter_site":"@24x7serversuppo","twitter_misc":{"Written by":"24x7support","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.24x7serversupport.com\/blog\/load-testing-web-servers-with-siege-benchmarking-tool\/","url":"https:\/\/www.24x7serversupport.com\/blog\/load-testing-web-servers-with-siege-benchmarking-tool\/","name":"Load Testing Web Servers with Siege Benchmarking Tool | 24x7serversupport Blog","isPartOf":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/#website"},"datePublished":"2020-11-21T15:57:22+00:00","dateModified":"2020-11-21T16:20:51+00:00","author":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401"},"breadcrumb":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/load-testing-web-servers-with-siege-benchmarking-tool\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.24x7serversupport.com\/blog\/load-testing-web-servers-with-siege-benchmarking-tool\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.24x7serversupport.com\/blog\/load-testing-web-servers-with-siege-benchmarking-tool\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.24x7serversupport.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Load Testing Web Servers with Siege Benchmarking Tool"}]},{"@type":"WebSite","@id":"https:\/\/www.24x7serversupport.com\/blog\/#website","url":"https:\/\/www.24x7serversupport.com\/blog\/","name":"24x7serversupport Blog","description":"Linux | CPanel | WHM | webhosting| Plesk | DirectAdmin | CentOs | Debian | Ubuntu Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.24x7serversupport.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401","name":"24x7support","url":"https:\/\/www.24x7serversupport.com\/blog\/author\/24x7support\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts\/3265","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/comments?post=3265"}],"version-history":[{"count":2,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts\/3265\/revisions"}],"predecessor-version":[{"id":3268,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts\/3265\/revisions\/3268"}],"wp:attachment":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/media?parent=3265"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/categories?post=3265"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/tags?post=3265"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}