atc » htop http://blog.alexcollins.org Musings of technology, sport, life et al Thu, 10 Jun 2010 10:24:24 +0000 en hourly 1 http://wordpress.org/?v=3.0.5 Why does htop display an exclamation mark next to uptime? http://blog.alexcollins.org/2009/01/14/why-does-htop-display-an-exclamation-mark-next-to-uptime/ http://blog.alexcollins.org/2009/01/14/why-does-htop-display-an-exclamation-mark-next-to-uptime/#comments Wed, 14 Jan 2009 11:02:27 +0000 atc http://blog.beplacid.net/?p=62 I keep getting the exclamation mark in htop next to the uptime and always wondered why it’s there. According to this mailing list post it’s a little easter egg in UptimeMeter.c:

35 char daysbuf[15];
36 if (days > 100) {
37 sprintf(daysbuf, "%d days(!), ", days);
38 } else if (days > 1) {
39 sprintf(daysbuf, "%d days, ", days);
40 } else if (days == 1) {
41 sprintf(daysbuf, "1 day, ");
42 } else {
43 daysbuf[0] = '\0';
44 }

]]>
http://blog.alexcollins.org/2009/01/14/why-does-htop-display-an-exclamation-mark-next-to-uptime/feed/ 2
Server Benchmarking Diary – Debian, Apache 2 and MySQL http://blog.alexcollins.org/2008/09/05/server-benchmarking-tips-debian/ http://blog.alexcollins.org/2008/09/05/server-benchmarking-tips-debian/#comments Fri, 05 Sep 2008 20:32:16 +0000 atc http://blog.beplacid.net/2008/09/05/server-benchmarking-tips-debian/ This blog took nearly 7 thousand hits yesterday. At its peak, it took 1.8 thousand an hour. That’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 the stability of my Slicehost Xen virtual machine (more info here) just out of curiosity. I was using wget, ab (Apache benchmarking tool) and htop to mirror, send concurrent requests and monitor respectively. I’m going to document my findings here.

What I’m Running

Here’s a rundown of what sites I’m running and the software used.

Wget – the Swiss army knife of HTTP command line tools

Wget’s one of those tools you really take for granted. It’s versatile, reliable, simple and most importantly – it does its job very well. One of its nicest features is the –mirror option. This allows you to…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 site. I ran the following in a shell:

alex@prometheus:/tmp$ wget –mirror beplacid.net/

It’s simple: mirror beplacid.net. Watching the processes and CPU usage on the server, it became apparent that  this wasn’t going to do much. The CPU usage didn’t exceed 5% on its first core. I had to rethink. Then ab sprung to mind.

ab – Apache benchmarking tool

This is another useful tool. It’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.

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:

prometheus:/root$ ab -n 50 -c 5 beplacid.net/

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 – 100 with 10 per request:

 prometheus:/root$ ab -n 100 -c 10 beplacid.net/

This was a little more representative of a heavy amount of traffic. Perhaps akin to slashdot or a reddit. Put simply, that’s 100 requests with 10 each sent each time. Still nothing major, so I went all out:

Concurrency Level:      10
Complete requests: 1000
Total transferred:      4856792 bytes
HTML transferred:       4687792 bytes
Requests per second:    4.99 [#/sec] (mean)
Time per request:       2002.453 [ms] (mean)
Time per request:       200.245 [ms] (mean, across all concurrent requests)
Transfer rate:          23.69 [Kbytes/sec] received

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’m running.

I’m pleased with my setup. It can take a punch and it’s still running. My next task is to hit both beplacid.net and the blog, with perhaps some traffic mirroring readingbeerfestival.org.uk too.

]]>
http://blog.alexcollins.org/2008/09/05/server-benchmarking-tips-debian/feed/ 4