<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>code-diesel &#187; benchmarking</title>
	<atom:link href="http://www.codediesel.com/tag/benchmarking/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codediesel.com</link>
	<description>/* PHP &#38; MySQL Journal */</description>
	<lastBuildDate>Thu, 02 Feb 2012 13:19:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Benchmarking server performance with http_load</title>
		<link>http://www.codediesel.com/tools/benchmarking-server-performance-with-http_load/</link>
		<comments>http://www.codediesel.com/tools/benchmarking-server-performance-with-http_load/#comments</comments>
		<pubDate>Sat, 02 May 2009 15:00:45 +0000</pubDate>
		<dc:creator>sameer</dc:creator>
				<category><![CDATA[testing]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[benchmarking]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://www.codediesel.com/?p=789</guid>
		<description><![CDATA[Recently due to increased traffic on my site the server was taking a while to return pages, many times timing out the request. I was thinking of shifting my hosting with another provider, but before I could do that I first needed to test the load the present server could take. What I needed was [...]]]></description>
			<content:encoded><![CDATA[<p>Recently due to increased traffic on my site the server was taking a while to return pages, many times timing out the request. I was thinking of shifting my hosting with another provider, but before I could do that I first needed to test the load the present server could take. What I needed was a simple load testing tool, <a target="_blank" href="http://www.acme.com/software/http_load/">http_load</a> being one such.<br />
<span id="more-789"></span><br />
http_load is a useful HTTP benchmarking utility that lets you run multiple http fetches in parallel to test the throughput of your web server. It gives you a rough idea of how many bytes a server can serve in a predetermined time. A compiled binary can be downloaded from <a target="_blank" href="http://www.orenosv.com/misc/">here</a>.</p>
<p>A note before proceeding : Hitting a server quickly for an extended period of time constitutes a <a target="_blank" href="http://en.wikipedia.org/wiki/Denial-of-service_attack">DOS attack</a>. So make sure you load a server only for a short period.</p>
<p>Before you run the tool you have to save the urls to test in a text file &#8211; one url per line, which you than pass to the program. In the following example we run the program emulating 3 concurrent users for a time of 10 seconds. The program fetches the urls as fast as it can. The type of net connection also affects the end result, so make sure you use http_load on a fast broadband connection.</p>

<div class="wp_codebox"><table><tr id="p7895"><td class="code" id="p789code5"><pre class="dos" style="font-family:monospace;">c:/&gt; http_load -parallel <span style="color: #cc66cc;">3</span> -seconds <span style="color: #cc66cc;">10</span> ./urls.txt</pre></td></tr></table></div>

<p>The statistics returned is shown below.</p>

<div class="wp_codebox"><table><tr id="p7896"><td class="code" id="p789code6"><pre class="dos" style="font-family:monospace;"><span style="color: #cc66cc;">148</span> fetches, <span style="color: #cc66cc;">3</span> max parallel, <span style="color: #cc66cc;">32708</span> bytes, <span style="color: #00b100; font-weight: bold;">in</span> <span style="color: #cc66cc;">10</span> seconds
<span style="color: #cc66cc;">221</span> mean bytes/connection
<span style="color: #cc66cc;">14.8</span> fetches/sec, <span style="color: #cc66cc;">3270.8</span> bytes/sec
msecs/connect: <span style="color: #cc66cc;">33.3615</span> mean, <span style="color: #cc66cc;">812.5</span> max, <span style="color: #cc66cc;">15.625</span> min
msecs/first-response: <span style="color: #cc66cc;">157.2</span> mean, <span style="color: #cc66cc;">390.625</span> max, <span style="color: #cc66cc;">140.625</span> min
HTTP response codes:
  code <span style="color: #cc66cc;">200</span> -- <span style="color: #cc66cc;">148</span></pre></td></tr></table></div>

<p>The following is a list of options for the program:</p>
<p>* One start specifier, either -parallel or -rate<br />
parallel &#8211; number of requests to open at a time<br />
rate &#8211; number of requests to open per second</p>
<p>jitter &#8211; vary the rate by about 10%<br />
You can specify a -jitter flag that tells http_load to vary the rate randomly by about 10%.</p>
<p>* One end specifier, either -fetches or -seconds<br />
fetches &#8211; quit after this many fetches<br />
seconds &#8211; seconds to run the program</p>
<p>The following will emulate 1 user and exit after fetching 50 pages rather than after a predetermined time as above.</p>

<div class="wp_codebox"><table><tr id="p7897"><td class="code" id="p789code7"><pre class="dos" style="font-family:monospace;">c:/&gt; http_load -parallel <span style="color: #cc66cc;">1</span> -fetches <span style="color: #cc66cc;">50</span> ./urls.txt</pre></td></tr></table></div>


<div class="wp_codebox"><table><tr id="p7898"><td class="code" id="p789code8"><pre class="dos" style="font-family:monospace;"><span style="color: #cc66cc;">50</span> fetches, <span style="color: #cc66cc;">1</span> max parallel, 1.27445e+006 bytes, <span style="color: #00b100; font-weight: bold;">in</span> <span style="color: #cc66cc;">106.156</span> seconds
<span style="color: #cc66cc;">25489</span> mean bytes/connection
<span style="color: #cc66cc;">0.471004</span> fetches/sec, <span style="color: #cc66cc;">12005.4</span> bytes/sec
msecs/connect: <span style="color: #cc66cc;">286.563</span> mean, <span style="color: #cc66cc;">312.5</span> max, <span style="color: #cc66cc;">281.25</span> min
msecs/first-response: <span style="color: #cc66cc;">741.563</span> mean, <span style="color: #cc66cc;">1125</span> max, <span style="color: #cc66cc;">640.625</span> min
HTTP response codes:
  code <span style="color: #cc66cc;">200</span> -- <span style="color: #cc66cc;">50</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.codediesel.com/tools/benchmarking-server-performance-with-http_load/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

