<?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>Straylight Run &#187; load</title>
	<atom:link href="http://blog.straylightrun.net/tag/load/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.straylightrun.net</link>
	<description>Software, Technology, PHP</description>
	<lastBuildDate>Tue, 11 May 2010 03:53:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>httperf: Yet Another Website Load Testing Tool</title>
		<link>http://blog.straylightrun.net/2009/04/23/httperf-yet-another-website-load-testing-tool/</link>
		<comments>http://blog.straylightrun.net/2009/04/23/httperf-yet-another-website-load-testing-tool/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 20:25:41 +0000</pubDate>
		<dc:creator>gerard</dc:creator>
				<category><![CDATA[Performance]]></category>
		<category><![CDATA[httperf]]></category>
		<category><![CDATA[load]]></category>
		<category><![CDATA[scalability]]></category>
		<category><![CDATA[throughput]]></category>

		<guid isPermaLink="false">http://blog.straylightrun.net/?p=142</guid>
		<description><![CDATA[I&#8217;ve mentioned Apache Bench before. Httperf serves the same purpose as ab, but has a few more features, and has one very nice value-add.
While ab cannot really simulate a user visiting a website and performing multiple requests, httperf can. You can feed it a number of URL&#8217;s to visit, and specify how many requests to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve mentioned <a href="http://blog.straylightrun.net/2009/04/23/apache-bench/">Apache Bench</a> before. <a href="http://www.hpl.hp.com/research/linux/httperf/">Httperf </a>serves the same purpose as <code>ab</code>, but has a few more features, and has one very nice value-add.</p>
<p>While ab cannot really simulate a user visiting a website and performing multiple requests, httperf can. You can feed it a number of URL&#8217;s to visit, and specify how many requests to send within one session. You can also spread out requests over a time period randomly according a uniform or Poisson distribution, or a constant.</p>
<p>But the big value-add is <a href="http://www.xenoclast.org/autobench/">autobench</a>. Autobench is a perl wrapper around httperf for automating the process of load testing a web server. Autobench runs httperf a specified number of times against a URI, increasing the number of requests per second (which I equate to <code>-c</code> in ab) so that the response rate or the response time can be graphed vs. requests per second. (So response rate or response time on the vertical, and requests per second on the horizontal.)</p>
<p>With this, you can generate pretty graphs like this:</p>
<p><a href="http://blog.straylightrun.net/wp-content/uploads/2009/04/httperf-requests-sec.png"><img style="border-width: 0px;" src="http://blog.straylightrun.net/wp-content/uploads/2009/04/httperf-requests-sec-thumb.png" border="0" alt="Requests per sec" width="399" height="280" /></a></p>
<p><a href="http://blog.straylightrun.net/wp-content/uploads/2009/04/httperf-response-time.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" src="http://blog.straylightrun.net/wp-content/uploads/2009/04/httperf-response-time-thumb.png" border="0" alt="Response time" width="399" height="280" /></a></p>
<p>From the graphs above, you could determine the approximate capacity of your website. In the first graph, the number of responses received was equal to the number of requests sent until 16 req/sec. At 16 req/sec., the number of responses starts going <em>down</em> as requests begin to error out.  In the second graph, the response time stays level at about 500ms (a reflection of your code and database) until 15 req/sec.  At 16 req/sec. the time goes up to nearly 1s, and at 17 req/sec. the response time is over a second.  You would conclude that the capacity of this website is around 15 requests per second.</p>
<p>The people who provide autobench also offer an <a href="http://www.xenoclast.org/doc/benchmark/HTTP-benchmarking-HOWTO/HTTP-benchmarking-HOWTO.html">excellent HOWTO on benchmarking web servers in general</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.straylightrun.net/2009/04/23/httperf-yet-another-website-load-testing-tool/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Apache Bench</title>
		<link>http://blog.straylightrun.net/2009/04/23/apache-bench/</link>
		<comments>http://blog.straylightrun.net/2009/04/23/apache-bench/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 14:22:53 +0000</pubDate>
		<dc:creator>gerard</dc:creator>
				<category><![CDATA[Performance]]></category>
		<category><![CDATA[apache bench]]></category>
		<category><![CDATA[load]]></category>
		<category><![CDATA[scalability]]></category>
		<category><![CDATA[throughput]]></category>

		<guid isPermaLink="false">http://blog.straylightrun.net/?p=135</guid>
		<description><![CDATA[Apache Bench is either the first or second most useful PHP tool (with Xdebug being the other). I described the basic theory of Apache Bench in an earlier post. That&#8217;s a short post, so I won&#8217;t repeat it. This will be another short post, with a small note on how I use it day-to-day. If [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://httpd.apache.org/docs/2.2/programs/ab.html">Apache Bench</a> is either the first or second most useful PHP tool (with <a href="http://blog.straylightrun.net/2009/02/23/xdebug/">Xdebug </a>being the other). I described the basic theory of Apache Bench in <a href="http://blog.straylightrun.net/2008/11/25/performance-scalability/">an earlier post</a>. That&#8217;s a short post, so I won&#8217;t repeat it. This will be another short post, with a small note on how I use it day-to-day. If you are changing something in the system, a piece of code, a database setting, an OS setting&#8230; anything! for performance reasons, and you want to see if it makes any difference, use Apache Bench. Fire up a quick test before the change, and after the change. ab runs very quickly (on the order of a few minutes on a slow machine), so you can run 1000 requests and not have to worry about your sample size. I even run it on my laptop. Even though my laptop introduces a lot of noise, it still gives relative results. I usually run it two ways before the change, and two ways after.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">%</span> ab <span style="color: #339933;">-</span>n <span style="color: #cc66cc;">1000</span> <span style="color: #339933;">-</span>c <span style="color: #cc66cc;">1</span> http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.whatever.com</span></pre></div></div>

<p>That usually gets me a good idea of improving <em>performance</em>.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">%</span> ab <span style="color: #339933;">-</span>c <span style="color: #cc66cc;">100</span> <span style="color: #339933;">-</span>t <span style="color: #cc66cc;">60</span> http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.whatever.com</span></pre></div></div>

<p>That usually gets me a good idea of <em>scaling </em>under load.</p>
<p><strong>UPDATE: </strong>There have been reports that <a href="http://paul-m-jones.com/?p=413">Apache Bench is not reliable</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.straylightrun.net/2009/04/23/apache-bench/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->