<?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>atc &#187; htop</title>
	<atom:link href="http://blog.beplacid.net/tag/htop/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.beplacid.net</link>
	<description>Musings of technology, sport, life et al</description>
	<lastBuildDate>Thu, 10 Jun 2010 10:24:24 +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>Why does htop display an exclamation mark next to uptime?</title>
		<link>http://blog.beplacid.net/2009/01/14/why-does-htop-display-an-exclamation-mark-next-to-uptime/</link>
		<comments>http://blog.beplacid.net/2009/01/14/why-does-htop-display-an-exclamation-mark-next-to-uptime/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 11:02:27 +0000</pubDate>
		<dc:creator>atc</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[NoNeedForWindows]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[easteregg]]></category>
		<category><![CDATA[htop]]></category>
		<category><![CDATA[uptime]]></category>

		<guid isPermaLink="false">http://blog.beplacid.net/?p=62</guid>
		<description><![CDATA[I keep getting the exclamation mark in htop next to the uptime and always wondered why it&#8217;s there. According to this mailing list post it&#8217;s a little easter egg in UptimeMeter.c:

35    char daysbuf[15];
36    if (days &#62; 100) {
37       sprintf(daysbuf, "%d days(!), ", days);
38 [...]]]></description>
			<content:encoded><![CDATA[<p>I keep getting the exclamation mark in htop next to the uptime and always wondered why it&#8217;s there. According to t<a title="htop mailing list post" href="http://sourceforge.net/mailarchive/forum.php?forum_name=htop-general&amp;max_rows=25&amp;style=nested&amp;viewmonth=200707" target="_blank">his mailing list post</a> it&#8217;s a little easter egg in <a title="UptimeMeter.c in htop [new window]" href="http://htop.svn.sourceforge.net/viewvc/htop/trunk/UptimeMeter.c?view=markup" target="_blank">UptimeMeter.c</a>:<br />
<code><br />
35    char daysbuf[15];<br />
36    if (days &gt; 100) {<br />
37       sprintf(daysbuf, "%d days(!), ", days);<br />
38    } else if (days &gt; 1) {<br />
39       sprintf(daysbuf, "%d days, ", days);<br />
40    } else if (days == 1) {<br />
41       sprintf(daysbuf, "1 day, ");<br />
42    } else {<br />
43       daysbuf[0] = '\0';<br />
44    }<br />
</code></p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.beplacid.net%2F2009%2F01%2F14%2Fwhy-does-htop-display-an-exclamation-mark-next-to-uptime%2F';
  addthis_title  = 'Why+does+htop+display+an+exclamation+mark+next+to+uptime%3F';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.beplacid.net/2009/01/14/why-does-htop-display-an-exclamation-mark-next-to-uptime/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Server Benchmarking Diary &#8211; Debian, Apache 2 and MySQL</title>
		<link>http://blog.beplacid.net/2008/09/05/server-benchmarking-tips-debian/</link>
		<comments>http://blog.beplacid.net/2008/09/05/server-benchmarking-tips-debian/#comments</comments>
		<pubDate>Fri, 05 Sep 2008 20:32:16 +0000</pubDate>
		<dc:creator>atc</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Site News]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[ab]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[benchmarking]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[htop]]></category>
		<category><![CDATA[slicehost]]></category>
		<category><![CDATA[traffic]]></category>
		<category><![CDATA[website]]></category>
		<category><![CDATA[wget]]></category>

		<guid isPermaLink="false">http://blog.beplacid.net/2008/09/05/server-benchmarking-tips-debian/</guid>
		<description><![CDATA[This blog took nearly 7 thousand hits yesterday. At its peak, it took 1.8 thousand an hour. That&#8217;s a decent amount of traffic. This was all brought about when I submitted a link to reddit.com regarding a way to crash Google Chrome instantly. Coincidentally, I had spent an hour or so the night before testing [...]]]></description>
			<content:encoded><![CDATA[<p>This blog took nearly 7 thousand hits yesterday. At its peak, it took 1.8 thousand an hour. That&#8217;s a decent amount of traffic. This was all brought about when I submitted a link to <a href="http://reddit.com" title="Reddit ">reddit.com</a> regarding <a href="http://blog.beplacid.net/2008/09/04/tasty-google-chrome-bug-so-much-for-isolated-tabsprocesses/" title="Google Chrome - so much for isolated tabs">a way to crash Google Chrome instantly</a>. Coincidentally, I had spent an hour or so the night before testing the stability of my <a href="http://slicehost.com" title="Slicehost Xen Hosting">Slicehost</a> Xen virtual machine (more info <a href="http://blog.beplacid.net/2008/09/04/tasty-google-chrome-bug-so-much-for-isolated-tabsprocesses/" title="Slicehost migration">here</a>) just out of curiosity. I was using <em>wget</em>, <em>ab</em> (Apache benchmarking tool) and <em>htop</em> to mirror, send concurrent requests and monitor respectively. I&#8217;m going to document my findings here.</p>
<h3>What I&#8217;m Running</h3>
<p>Here&#8217;s a rundown of what sites I&#8217;m running and the software used.</p>
<ul>
<li><a href="http://beplacid.net">beplacid.net</a> &#8211; Apache 2, Django (Python framework), MySQL (one instance)</li>
<li>blog.beplacid.net &#8211; PHP 5, MySQL, Wordpress</li>
<li><a href="http://readingcamra.org.uk">readingcamra.org.uk</a> &#8211; Apache Tomcat 6, Java 5, MySQL</li>
<li><a href="http://readingbeerfestival.org.uk" title="Reading Beer Festival website">readingbeerfestival.org.uk</a> &#8211; As above</li>
</ul>
<h3>Wget &#8211; the Swiss army knife of HTTP command line tools</h3>
<p>Wget&#8217;s one of those tools you really take for granted. It&#8217;s versatile, reliable, simple and most importantly &#8211; it does its job very well. One of its nicest features is the <em>&#8211;mirror</em> option. This allows you to&#8230;mirror a given website. I initially thought of running multiple instances of wget at the same time. I started small at first: one instance running to mirror the entire <a href="http://beplacid.net" title="beplacid.net">site</a>. I ran the following in a shell:</p>
<blockquote><p>alex@prometheus:/tmp$ wget &#8211;mirror beplacid.net/</p></blockquote>
<p>It&#8217;s simple: mirror beplacid.net. Watching the processes and CPU usage on the server, it became apparent that  this wasn&#8217;t going to do much. The CPU usage didn&#8217;t exceed 5% on its first core. I had to rethink. Then <em>ab</em> sprung to mind.</p>
<h3>ab &#8211; Apache benchmarking tool</h3>
<p>This is another useful tool. It&#8217;s simple to use and allows you to quickly and easily hit a given hostname with HTTP requests, all tailored to your specific needs. To do all this, however, you need to be running as root. A noble security measure.</p>
<p>I wanted to generate some traffic that would put the server under some strain, so I started with 50 requests and 5 at a time:</p>
<blockquote><p>prometheus:/root$ ab -n 50 -c 5 beplacid.net/</p></blockquote>
<p>Now things started to get fun. This peaked CPU usage to 94% on one core, the others were between 60 and 80. I was starting to see some real stats. I doubled things &#8211; 100 with 10 per request:</p>
<blockquote><p> prometheus:/root$ ab -n 100 -c 10 beplacid.net/</p></blockquote>
<p>This was a little more representative of a heavy amount of traffic. Perhaps akin to slashdot or a reddit. Put simply, that&#8217;s 100 requests with 10 each sent each time. Still nothing major, so I went all out:</p>
<blockquote><p>Concurrency Level:      10<br />
Complete requests:      1000<br />
Total transferred:      4856792 bytes<br />
HTML transferred:       4687792 bytes<br />
Requests per second:    4.99 [#/sec] (mean)<br />
Time per request:       2002.453 [ms] (mean)<br />
Time per request:       200.245 [ms] (mean, across all concurrent requests)<br />
Transfer rate:          23.69 [Kbytes/sec] received</p></blockquote>
<p>To summarise, the server took 1000 requests with an average of 5 per second, each returning just over 2 seconds. Not bad, considering what I&#8217;m running.</p>
<p>I&#8217;m pleased with my setup. It can take a punch and it&#8217;s still running. My next task is to hit both beplacid.net and the blog, with perhaps some traffic mirroring readingbeerfestival.org.uk too.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.beplacid.net%2F2008%2F09%2F05%2Fserver-benchmarking-tips-debian%2F';
  addthis_title  = 'Server+Benchmarking+Diary+%26%238211%3B+Debian%2C+Apache+2+and+MySQL';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.beplacid.net/2008/09/05/server-benchmarking-tips-debian/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
