<?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; apache bench</title> <atom:link href="http://blog.straylightrun.net/tag/apache-bench/feed/" rel="self" type="application/rss+xml" /><link>http://blog.straylightrun.net</link> <description>Software, Technology, PHP</description> <lastBuildDate>Mon, 07 Nov 2011 19:26:59 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <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> <item><title>Performance !== Scalability</title><link>http://blog.straylightrun.net/2008/11/25/performance-scalability/</link> <comments>http://blog.straylightrun.net/2008/11/25/performance-scalability/#comments</comments> <pubDate>Tue, 25 Nov 2008 18:28:37 +0000</pubDate> <dc:creator>gerard</dc:creator> <category><![CDATA[Performance]]></category> <category><![CDATA[ab]]></category> <category><![CDATA[apache bench]]></category> <category><![CDATA[scalability]]></category> <guid
isPermaLink="false">http://blog.straylightrun.net/2008/11/25/performance-scalability/</guid> <description><![CDATA[When we talk about performance, it is the response time of a single request, web page, SQL query, etc. It is the actual execution time for something in the absence of load. To illustrate, suppose you wanted to test the performance of a web page using Apache Bench. You should run something like: % ab [...]]]></description> <content:encoded><![CDATA[<p>When we talk about <em>performance</em>, it is the <em>response time</em> of a <em>single</em> request, web page, SQL query, etc. It is the actual execution time for something in the absence of load. To illustrate, suppose you wanted to test the performance of a web page using <a
href="http://httpd.apache.org/docs/2.0/programs/ab.html">Apache Bench</a>. You should run something like:</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> <br
/>The -n is the number of requests and the -c is the number of concurrent requests. Since we&#8217;re interested in end-to-end response time, we only need one concurrent request.<em> Scalability </em>is usually about <em>throughput</em>, or the number of concurrent requests within a certain period of time. Using the example above, the Apache Bench command should be something like:</p><p></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> <br
/>The -t is the amount of time to run the test. We can vary -c until individual response times begin to grow, at which point something in the system has reached its maximum capacity.</p> ]]></content:encoded> <wfw:commentRss>http://blog.straylightrun.net/2008/11/25/performance-scalability/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
