The Guru College
Crisis Averted
A few days ago, my wife complained to me that streaming video files from our home file server to her laptop stuttered and paused a lot. My first panicked thought was that that my switch from mirrored pairs in my ZFS configuration had degraded performance enough to cause problems.
Thinking about it a little more, I knew that couldn’t be the case – my streaming read and write speeds from the pool are usually around 22MiB/second. This was far faster than anything the video should need.
Last night, I figured it out. I was cooking dinner and listening to music streamed via AirTunes, which was having sudden and abrupt problems. The music was dropping out and skipping a lot – but the speakers attached to my computer kept on playing without a hitch. After a few minutes of poking about, I realized that my wife’s laptop backs itself up to a USB drive attached to our Airport Extreme, and it was in the middle of a backup. As soon as it finished, the music problems stopped as well.
So this leaves me with a new problem: when I get the television hooked into my home network I’m going to have to deal with quality of service issues to make sure the television gets enough bandwidth to play seamlessly. Either I’ll have to cache all the files on the media playback device , or I’ll have to set up a second wireless network, as there is no way to run ethernet cables out to the TV cabinet.
Meet The Command Line
For all you OSX geeks out there who don’t yet use Terminal: Meet The Command Line
Home Network – Backups
While my wife and I both use Time Machine to back up our Macs, my backup strategy is a little more complicated than that. I have a Mac and a Redhat machine at work which I need to backup, and being paranoid, I keep multiple copies of my backups, just to make sure I don’t lose data.
Dropbox: The majority of my day to day backups run through Dropbox, which I’ve mentioned in the past. I have it installed on the Mac Pro and my black MacBook at home, as well as the linux box and the G5 in my office. I also have Firefox, Mail.app and Safari all set to download attachments into folders in the Dropbox. This way, I have a reasonably synced home folder between all my machines, and most of my ‘hot files’ that I’m actively working on live in 3 places. If one machine dies, there is very little chance of data outage.
Backup Script: I also have a backup script that runs on my two work machines, set to exclude the obvious folders – Dropbox, Music and Photos. It also has file type exemptions for stray Nikon Raw (NEF) files, VM disk images, and the like. The output of file names is dumped to a text file in the backup directory. Once the tarball is ready, the script gzips the tarball and the file list, and then calculates the MD5 hashes of each file. All of these files are moved into Dropbox, which is then synced back to my home machines.
Every month, I copy off the backup files to two sets of DVD-R’s. One gets left at home, and one gets left in the office. This is the über-paranoid backup in case of total system failure of all my computers and Dropbox.
Rsync: I have a periodic rsync that runs to backup the Dropbox to an ZFS backed NFS share. Using the –inplace flag for rsync and ZFS snapshots, only the block differences get saved. It’s a poor man’s de-dupe. IMHO, this should be what Apple does for TimeMachine – not hard linked directories. I’m really looking forward to the ZFS team adding de-dupe into the filesystem directly. I can then expand my backed-up files from the office into an NFS share, and not waste much space.
I also have my music library from my computer backed up into an NFS share that mt-daapd reads from. This was, as I add music to my library, anyone on the network in the house can listen to it – even when my machine is asleep.
Aperture Vault: I also have my Aperture library backing itself up to a sparse disk image I copied over to a CIFS share. It’s much slower than using an directly attached disk, but it works, and with my ZFS fileservers, it’s easy to make volumes bigger. My Aperture library is already 350+GB of data, so I need the flexibility that ZFS offers
The rubber band effect
I hate the rubber band effect of video games. The phrase was coined in relation to racing games – in some games, no matter how well you do the other cars are always 2 seconds behind you. You could drive a perfect race, easily passing everyone else only screw up at the very end, and watch as the rest of the cars all pass you perfectly. It’s almost like they are attached to your car with a rubber band, and it sucks.
The effect also applies to other games where the game is made artificially hard be changing the chance of success outside of the players skill. Instead of developing a better AI for the opposing forces, which makes you play smarter and harder, the game takes shortcuts. Giving an enemy a one-shot-kills weapon is a perfect example of this. It doesn’t matter how much health you have – if you linger just a little too long, you die. It doesn’t reward the skill of the gamer, it just makes it a matter of luck if you get through.
My most recent encounter with this is Lux Touch, a Risk-style game for the iPhone/iPod Touch. It’s a quick diversion while waiting for the bus, or to fire up when Qais is sleeping in my lap. My frustration comes in that I will often have 10 or 15 armies attacking a country with 2 or 3. I wind up with nothing, and the defender has 1 or 2 left – which they use the next round to invade me. It seems that instead of making the AI harder, the developers just skewed the statistics against the player.
It’s maddening, frustrating, and makes me want to stop playing the game.
Home Network – Logical Layout
I’ve talked enough about my home network in the abstract. Today, I’m going to walk through the diagram of how things are setup, and where I want to go next. Part of the motivation of this is to setup NagVis, so I can have a slightly prettier picture of my devices and their dependancies than Nagios gives me by default.
So, here’s the network layout map I’ve worked up quickly:

So, the walk through. I’ve got my Airport Extreme hooked up to the cable modem. It’s bridged with an Airport Express, so we’ve got solid network coverage throughout the whole house. It also allows me to attach the Vonage modem directly to the Airport Express in the home office – where it’s easier to use. Additionally, not shown, I’ve got a set of cheap desktop speakers connected to the Airport Express, so we can play music throughout the whole house.
The HP Photosmart is also hooked up to the Airport Extreme, which allows anyone on the network to use the printer. I’ve also got a Seagate FreeAgent drive hooked up, for quick file sharing and the backups of my wife’s laptop. This way, her network use doesn’t rely on my desktops being awake.
My primary workstation, Godzilla, is hooked up to the unmanaged GigE switch, along with the fileserver (vault) and the time machine backup server (thor). This way, my backups and media manipulation don’t show up on the network statistic graphs. Also, I didn’t have enough ports free on the Airport Extreme to put everything on one device.
You may notice right that I don’t have the Xbox hooked up to the network yet. I need to get a second Airport Express to do this, or move the Vonage modem into the entertainment unit. I considered getting the network adapter for the XBox, but it’s damn close to $100, which is the same price as the Airport – and with the Airport, I can hook up a second set of speakers to the AirTunes network, as well as a switch, so if I decide to wire a computer to the television, I’ve got multiple network ports to play with. All network related purchases are put off, though, as there’s other things I want to buy before I extend the network. Another other option, of course, is just getting an AppleTV, as the point of networking the XBox is that I can play media from my computer back on the television.
Addictions
This has certainly been an interesting week. Today is Monday, and a week ago today was the last time I drank any caffeine, in the form of sweet tea at lunch, and last Friday was the last time I had any coffee. It’s strange to have had this gone through so easily. I’ve tried in the past to just cut down on coffee, and it’s never worked. I’ve always wound up miserable and angry at everything around me. This time through, though, it’s almost like I never drank coffee before. According to Wikipedia, withdrawal symptoms last about a week.
Well, it’s been a week now, and this has been the easiest addiction to break, ever. Quite literally, I forgot to have my coffee last Saturday morning. Smoking took weeks and weeks of feeling angry, out of sorts, and unable to concentrate. It was a constant battle with my desires was really hard to get through.
Home Network – Firefly Media Server
Part of my quest to simplify my electronic life at home has been to shift all media other than photos off of my primary desktop and on to an external file server. This means that at my house, one doesn’t have to use my desktop to listen to music, watch TV shows we’ve ripped from purchased DVDs or movies we’ve done likewise with. The failing of this, of course, is that it’s not user friendly to pull up a music collection on a shared file server, and then try to reference the files in iTunes. You almost always get duplicates or missed tracks, and the delay between playing a song and hearing the music start can be maddening.
There, of course, is a solution to this. The FireFly Media Server, formerly known as mt-daapd. It uses mDNS broadcasting to show up in any copy of iTunes that’s running on the network, allowing anyone to easily play from the library stored on the file server in a native interface. It has the added benefit that when you leave the network, there are no traces of the music left on your computer – which makes my wife happy. The only downside is that you can’t make playlists from within iTunes – you have to go to a web interface to set those up. Happily, you can make smart playlists.
Sadly, I lost my build notes. I do, however, have links to other people who have gotten it working. It’s worth it, trust me. Especially when you hook up the speakers in the home office to an Airport Express, and anyone can stream music to it.
- http://www.barchard.net/files/firefly_on_solaris.html
- http://forums.fireflymediaserver.org/viewtopic.php?f=3&t=7245