USB2 Vs FW400 Vs FW800

Posted by Dan Milne Wed, 25 Jun 2008 07:55:00 GMT

Had access to a 1TB WD drive recently. Comes with USB2, FireWire 400 & FireWire 800. Thought I’d check out the performance of the various connection methods. It had two internal 500GB drives arranged in RAID 0 (striped). I tested it by running:

$ time cp Movies/Parallel.avi /Volumes/MYBOOK/

The movie was 525MB and I did each test 3 times. The very first run was slowest – presumably the file (or parts of it) was in the disk cache for subsequent runs. Here’s the times:

FW800:  12.5 seconds
FW400: 16.9 seconds 
USB2:  21.6 seconds

Just to make sure my laptop drive wasn’t affecting the test, I also performed this test (several times for each):

dd if=/dev/zero of=/Volumes/MYBOOK/test.file.fw800 bs=1m count=1024
FW800: 24.8 seconds
FW400: 32.4 seconds 
USB2: 40.9 seconds

For comparison: Local SATA drive: 20.3 seconds

My laptop hard drives results were a bit erratic – peaking up to 27 seconds and down to 20. No doubt due in part to the 21 applications I’m currently running. Stopping iTunes playing helped things ;-)

I was surprised that FireWire 400 was that much faster than USB2 – I’d always assumed they were on par. Anyway, looks like FW800 is clearly the king for connecting external HD.

Migration to Passenger ( mod_rails )

Posted by Dan Milne Sun, 22 Jun 2008 05:49:00 GMT

Ruby On Rails apps are finally easy to install – mod_rails is here. Just installed it for the Blag ( Typo 5.0.1 on Gentoo Unstable ) and it looks to be working quite nicely. Only roadbump I encountered was problems getting static content to be served. Kept getting:

[error] [client 124.168.83.214] client denied by server configuration: /var/www/da.nmilne.com/htdocs/public/javascripts/typo.js

The problem was pretty straight forward – now that mongrel isn’t serving up the static content, I had to make sure that apache was configured to allow access. Added a this stanza:

  <Directory "/var/www/da.nmilne.com/htdocs/public">
        Options FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
  </Directory>

Naturally it feels snappier. Nice.

Frustrating

Posted by Dan Milne Sun, 22 Jun 2008 03:55:00 GMT

I spent several hours yesterday fighting with RubyGems – I’d even written a vitriolic post about it – but I … did something … and bam, like that it was gone. RubyGem is Ruby’s version of Perl’s CPAN. It’s got a very annoying trait – its prodigious use of memory. For each gem ( a gem is a Ruby module – like rails or hpricot for example ) RubyGem would load the spec into memory in order ( I’m guessing after reading a bunch of forum posts ) to build a dependency tree. On a 256MB slice host, this pushes you into swap hell. On a 512MB host it would use up to 68% of memory.

So what can you do but rent a bigger slicehost? Moe Sizlack said it best: “I’m choking on my own rage over here!”

Naturally, it’s been fixed. Today.

If only I’d done something more constructive yesterday. Like played COD.

SSH Tricks 1

Posted by Dan Milne Mon, 16 Jun 2008 10:56:00 GMT

Read this tip here – if you add:

Host *
       ControlMaster auto
       ControlPath /tmp/%r@%h:%p

to your .ssh/config, ssh will reuse your network connections to hosts with already established ssh sessions – saving a bit of time and reducing the number of network sockets you’ve got.

$ man ssh_config

for the details. You learn something new every week eh?

I might be too old for Gentoo Unstable. It could be time for Debian. Or Ubuntu. Or Gentoo stable maybe. :-( 1

Posted by Dan Milne Thu, 12 Jun 2008 10:16:00 GMT

Perhaps my blood sugar is just too low.

Seeing this type of error in Gentoo?

 * ERROR: sys-apps/portage-2.1.5.5 failed.
 * Call stack:
 *               ebuild.sh, line 1792:  Called dyn_unpack
 *               ebuild.sh, line  686:  Called die
 * The specific snippet of code:
 *      touch "${PORTAGE_BUILDDIR}/.unpacked" || die "IO Failure -- Failed 'touch .unpacked' in ${PORTAGE_BUILDDIR}" 
 *  The die message:
 *   IO Failure -- Failed 'touch .unpacked' in /var/tmp/portage/sys-apps/portage-2.1.5.5
 

Apparently touch no longer works in my distro. Can’t build anything.

http://bugs.gentoo.org/show_bug.cgi?id=224483

It appears my kernel (2.6.21-gentoo-r3) is out of date compared with my linux-headers (2.6.25-r3) package and this screws up the latest version of touch which comes with coreutils. Update your kernel. But touch doesn’t work, so you need to go get an old version:

wget http://tinderbox.dev.gentoo.org/default-linux/x86/sys-apps/coreutils-6.10-r2.tbz2
mv coreutils-6.10-r2.tbz2 /usr/portage/distfiles/
emerge -k =sys-apps/coreutils-6.10-r2

Now go update your kernel.

Windows Hatoraide 3

Posted by Dan Milne Wed, 07 May 2008 12:35:00 GMT

Before my current job, my last crack at using MS Windows as a desktop was in 2000. It lasted about 6 months before I decided Linux made a better desktop. Back then I was using Windows 2000. I didn’t have any particular gripe with it – just didn’t really get along with it. I found it to be reasonably stable – at least as stable as a Mac of that era but less stable than Linux. I used Linux until November 2005 when I moved back to Mac. The change was dramatic: when I left, I was running Mac OS 9 and I came back to Mac OS 10.4 – a modern Unix based OS which, after years on Linux, felt like a good mix of Unix and lickable buttons.

At my current job, I don’t have the benefit of choosing the OS of my desktop, and the imagined redtape involved in connecting my laptop to their network means that for the first time in a long time, I’ve got Windows on the desktop. I’ve been using Windows at work for almost 4 months. Windows XP, SP2.

After all this time, I figured Windows would have improved. Surely, I thought, after almost 8 years of development things must be good – after all, consider the improvements in Linux since Red Hat 6. Literally leaps and bounds in all possible measures. Mac OS also went from an OS with no preemptive multitasking ( they used cooperative multitasking) and no memory protection to a modern Unix with all associated goodness.

Windows XP, to me, doesn’t seem to have improved at all since 2000 aside from that annoying dark blue Crayola “theme”. It might be marginally more stable, although that could just me treating it with kid gloves.

When my PC started playing up recently, I called in tech support. They asked when I’d last rebooted it. I said, “Oh a week or two?” – Everyone looked at my like I was King of the Muppet people. I retorted to the laughter with “Seriously? I though that was a joke! It’s 2008!” They laughed, closed the ticket and told me to reboot. It didn’t fix the problem. Next they suggested I’d installed to many applications and that was slowing it down. I’d installed Safari and the related Apple stuff dragged in (iTunes, quicktime, Bonjour, Software Update), Firefox, Wireshark and a couple of Jabber clients to test a jabber server. That’s it.

I agreed to uninstall the stuff I wasn’t using or didn’t really need. The tech support guy opened up the add/remove program control panel and I deleted a few bits of software I’d been playing with (Safari for Windows). After removing software and rebooting again, the problem persisted. So I figured I’d uninstall some more software – but you need admin rights to open the add/remove programs control panel! So, you can install software, but you can’t uninstall software?! Apparently this is all you can do to fix problems. The next step, in the estimation of my Windows support guy, is to rebuilding the box from scratch.

Now, I admit, I’m no Windows administrator, but how can you seriously run websites or email servers or anything with a modicum of importance on this stuff? It’s garbage. No wonder MS are so into clustering – rather than fixing problems on servers, you simply rebuild them. Just take it out of the cluster and nuke it.

It doesn’t stop there. I’ve been documenting the more ridiculous aspects of life on Windows. Windows Explorer, one of the most used apps seems to have stood still. It does not keep the files on the right in alphabetical order. Copying or saving a file from an application into a directory simply adds that item to the end of the list. It seems you have to refresh the folder list to get them in order. Which is odd because the list of files & servers constantly flickers – I guess because of the attached network shares updating in the background. If you’re going to have an annoying, flickering explorer, at least it should be updating the file list to keep them correctly sorted. It’s kind of like an old fluorescent tube with a bad starter. It seems you can hide files beginning with a dot in the right hand side, but but not for folders on the left. Not only that, but Explorer doesn’t seem to be able to create a folder or file beginning with a “.”. To cap it off, the Explorer has no duplicate function, only copy/cut & paste.

Opening documents in Excel, Word or Visio sometimes opens them in separate windows, sometimes in the same parent window. This is some sort of brain dead MDI behaviour. I can’t figure out how to make individual documents consistently open in their own window. To top it off, in both cases there are two buttons in the task bar. Alt-Tab shows you two word icons – naturally they’re different – one probably represents the “Parent”.

Of course, both windows show up in the task bar, and naturally, each window from the same app respond differently to mouse-down / mouse-up. Sometimes you get the window on mouse-down, sometimes you have to wait for mouse-up. Sometimes, it works like you expect. Usually when you call someone over to show them.

Say you have Word open, then you open another word window, then a third. The layering of windows is inconsistent. Click and hold on each of the different windows in the task bar, and you’ll get different responses – sometimes the window jumps straight to the top, sometimes a different windows jumps to the top on mouse-down, only to disappear behind the correct window when you mouse-up.

The number of reboots is funny – like most jokes about Windows, this one is true. Ian just bought a new laptop – the first thing it did, after starting up, was to reboot. And then to reboot. And then one more reboot. Just in case. I think the total was higher than this, but I lost count. You have to reboot when upgrading Acrobat. I try not to use caps lock. Just in case.

Want to look for a file? I tried using the inbuilt search function for the file “services” and initially didn’t return any results. When I open the C:\WINDOWS\system32\drivers\etc directory – so I could see the services file, the next search found it. Naturally this file can exist in C:\WINDOWS\system32\drivers\etc\services or C:\WINNT\system32\drivers\etc\services. For consistency, they’ve capped it at two locations. Brilliant.

Windows Security sucks. You can have your ability to change the desktop image removed – however you can still set the desktop image with an application such as Paint which hasn’t been locked down. You can install applications, but have your access to “Add/Remove Programs” denied so you can’t uninstall them. Security in this sense seems to apply only to the method of doing something, rather than the result. So, instead of locking the desktop image, they lock the ways they know of changing it. Instead of stopping you installing software, they block access to the Add/Remove program.

I have this fond memory of Visio – the excellent drawing program. Doesn’t seem to have changed since I first saw it in 1999. Compared to OmniGraffle, it’s rubbish. Lines are never straight – they often seem to have kinks in them because the snap-to function doesn’t seem to consider a straight line as useful. Nothing seems to be anti-aliased. There’s jagged lines all over the shop. Fonts look especially craptacular – but I’ll accept that I’m just used to seeing them nicely anti-aliased on a Mac, and that you can “get used to it”. They do look better if you turn on the ClearType stuff ( just a simple download, install and reboot for smooth fonts. ) Ctrl-w doesn’t close a window in Visio – it zooms to fill the window with the document. You need good old alt-f4 or alt-f-c. Naturally neither of these are listed as short cuts are documented in the “File->Close” menu option.

It’s this inconsistency that really gets to me. Just when you think you’ve got it sorted, it randomly changes.

I hear tell that Vista may actually be better, but reports are conflicted. For the foreseeable future, Windows for me will be simply a boot loader for Call of Duty 4.

Operations as a competitive advantage

Posted by Dan Milne Sun, 04 Nov 2007 03:38:00 GMT

I love reading articles like these, mostly because they deal with issues that I see almost every day in my day job. Adding a new server to your deployment should be as simple as doing a base install and then pointing your configuration management system at it. The hard work should be done once, defining services, their configuration and their relationships.

The operational efficiencies gained from an automated configuration management system should extend beyond growing your current server farm. The time taken to track down bugs and reproduce problems should fall substantially when you know all your servers have the correct configuration. No more diff’ing the config across multiple servers to figure out why one is behaving different to another. No more checking software version numbers across hosts, because sometimes, a host is missed during an upgrade. No more wondering if apache is supposed to be installed on one of your mail servers.

Once your operational staff are relieved of these tedious tasks, their time can be used more effectively in improving aspects of your service. All those tasks that should be done “one day” such as implementing or improving backups, capacity planning or monitoring and reporting of the service can finally get some love.

As we move towards a virtualisation of hardware, automation of provisioning, building and management of servers will become ever more critical. Businesses with advanced operational practices will gain a competitive edge over those organisations who still manually build, configure and maintain their hosts.

Database migration

Posted by Dan Milne Thu, 11 Oct 2007 11:48:00 GMT

Lots of you have been noticing that “Bookie” craps out pretty frequently – turns out it’s due to SQLite3:

ActiveRecord::StatementInvalid (SQLite3::BusyException: database is locked: SELECT * FROM books WHERE (books.”isbn10” = ‘978-0596005696’) LIMIT 1):

Session data ( stored in the DB ) was a major culprit, but it looks like more than one concurrent user ( It happens! ) can cause this problem. SQLite’s homepage states that write operations lock the whole table, but since this should only take milliseconds, it shouldn’t be a problem.

I’ve migrated over to MySQL and performance feels much snappier. Maybe that’s just because I was hoping it’d be faster. With luck, bookie should be far more stable now.

Top ten unix shell commands

Posted by Dan Milne Wed, 01 Aug 2007 13:14:00 GMT

Saw this meme on Ben’s Blog

My OSX laptop, used at work and home, for business and pleasure:
history |awk '{print $2}'| awk 'BEGIN {FS="|"} {print $1}'| sort|uniq -c | sort -r |head -20
  84 ssh
  71 cd
  64 ls
  23 rsync
  22 openssl
  17 less
  15 stunnel
  14 killall
  12 svn
  12 scp
  11 find
  10 script/console
  10 netstat
   9 vim
   9 rm
   8 rake
   8 ps
   8 mongrel_rails
   7 tail
   7 sqlite3

Interview with author of Puppet

Posted by Dan Milne Wed, 18 Jul 2007 13:03:00 GMT

Great interview with the author of Puppet in Computer World Australia. It’s refreshing to find someone expressing and dealing with issues like this.

The truth is, the state of computing is absolutely pitiful. There are essentially no good tools for sysadmins, and the practice of system administration relies almost entirely on hand-building and hand-maintaining operating systems; those who aren’t doing things by hand are almost exclusively using tools they built themselves and will never publish, including places like Google.

It’s so true, but as with many truths, sometimes it takes someone to say it plainly. We system admins ( at least the ones I work with ) dislike the tedious work – the typing monkey work, but love the challenge of a new problem to solve. When the tedium becomes too strong, we write scripts to do the typing monkey work for us. This can be as enjoyable as solving problems. This is probably the point where non-geeks are scratching their heads saying “Did he just say enjoyable?”.

Some parts of the interview give my sense of humour a wry poke:

sure, you can tell Apache is running, but is it supposed to be running or did someone just start it while testing something six months ago?

Ha. So true. We see this kind of thing all the time – especially with boxes which have been running for a while. ( I was sad to have to update the kernel on some machines a few weeks ago – 522 days of uptime ). “Is apache supposed to be installed on this box??” The more I get to know puppet, the more I think it’s got a place in the toolbox of the sys admin.

How to Install Puppet on Debian Sarge

Posted by Dan Milne Mon, 09 Jul 2007 10:07:00 GMT

I had trouble finding clear instructions on installing Puppet onto Debian Sarge, so I thought I’d document how I did it.

First, install all the Ruby stuff:
aptitude install irb1.8 libreadline-ruby1.8 libruby libruby1.8 rdoc1.8  ruby ruby1.8 ruby1.8-dev  libopenssl-ruby1.8

Then, install RubyGems. The latest version can be found here: http://rubyforge.org/frs/?group_id=126

Set an environment variable for your proxy ( if required ): export http_proxy=”http://user:password@proxy.host.com:8080/” Next, download and install RubyGems:
wget http://rubyforge.org/frs/download.php/20989/rubygems-0.9.4.tgz
tar xzf rubygems-0.9.4.tgz
cd rubygems-0.9.4
ruby setup.rb
Finally, we can install puppet (after updating RubyGems):
gem update
gem install -b puppet

It’s pretty straight forward really. Although it would be easier with aptitude install puppet, but hey, you can’t have everything.

These sites where helpful getting Puppet installed.