How To

The fastest way to back up with Time Machine

I wrote about backing up your Mac and PC in January of 2008, and I said Time Machine was a great way to back up your Mac. A year later, I still think so, though I have some reservations.

There are three ways to back up your Mac with Time Machine. There used to be only two, but thanks to Drobo Apps, we now have three. I’ll list them in descending order, sorted by backup speed. Here they are:

To External Hard Drive (USB, Firewire, eSATA)

This one’s easy, and it’s the fastest way. You get a dedicated external hard drive, you connect it to your Mac, and you let Time Machine do its thing. You can leave it connected all the time, or you can disconnect the hard drive and only back up when you want to. Time Machine won’t complain unless you haven’t backed up for a few days.

This is the backup strategy I’ve come to use, and believe me, it’s the one that gives me the least amount of headaches. I have a 500GB LaCie Mini hard drive that connects over USB. I plug it into my laptop, and within minutes, my backup is done.

Keep in mind that I’m a photographer, and I also shoot short videos every once in a while, so it’s pretty much a given that I’m backing up gigabytes of data every time. When the backup’s done, I eject the drive and put it away. This way I’m not bothered by hourly backups, which I don’t need.

To External Hard Drive via Time Tamer

Time Tamer

Go download Time Tamer, a very handy little app created by the folks that make the Drobo, and you can create an image file on your Drobo that is limited to twice the size of your Mac’s hard drive. This is useful because there is no other way to control the size of the Time Machine backup sets. There’s is no way to set a quota via its System Preferences panel, and so it’ll keep balooning until it fills the backup drive. Obviously, when you have a Drobo or another larger drive, that’s a problem.

I for one don’t want to fill up my Drobo with Time Machine backups — I have other more important uses for it. I did, however, want to limit the amount of external drives that sat on my desk, and thought I could eliminate one of them by using Time Tamer with my Firewire Drobo. Did that for a few months, but I can tell you it’s not optimal, at least not for me. It boils down to the amount of data one has to back up, really.

As it turns out, the throughput when writing to the image file just isn’t fast enough when you work with several hundred megabytes or more. Even though writing to the Drobo is usually a fairly fast operation, somehow writing inside the image file isn’t. From my own experience, it would sometimes take a whole hour to do an hourly backup, which meant that as soon as one backup finished, another would start.

To make things more annoying, the throughput to the Drobo itself, and my Mac’s general peppiness, were also affected negatively during backups. Everything churned at a slower pace. Getting at my photos or other files stored on the Drobo was a pain. If I happened to be playing a movie and a backup started, playback would stutter or stop for a few seconds. It just wasn’t a feasible way for me to work, so I stopped doing this and returned to doing my backups directly to a dedicated external hard drive.

To wireless or networked hard drive (such as Time Capsule)

This will usually be the slowest way to back up your Mac via Time Machine. Think about it: you’re going to be pushing your bits via WiFi, and even though your hardware may be “n” specs instead of “b” or “g”, you’re still not going to get above 50 Mbps at best. Realistically, you’re looking at speeds somewhere between 15-45 Mbps, which is less than Fast Ethernet (100 Mbps) and nowhere near Gigabit Ethernet (1000 Mbps).

For comparison purposes, I have observed transfer speeds which approached USB 2.0 speeds when using a direct, wired, Gigabit Ethernet connection between two Macs (MacBook Pro and iMac G5). If you have a wired Gigabit network at home, this might be the only way to actually get decent backup speeds with Time Machine without needing to use USB or Firewire hard drives. But if you’re using WiFi, your transfer speeds are going to be anywhere between 15-20 times slower than Gigabit speeds, which means you’ll be sitting there a long time waiting for your backups to finish, should your backup set be anything over 100-200 MB.

When Time Capsule came out, I was tempted to buy it, just like I bought the Apple TV, only to regret that later. I’m glad I didn’t end up spending my money on Time Capsule, because it just isn’t suitable for me, or for anyone with larger backup sets. It certainly looks good, but that’s about all it does and all it’ll do until WiFi speeds approach Gigabit speeds.

Takeaway message

When one of my friends shared an article from Louis Gray via Google Reader, where he complains about how slow it is to back up to Time Capsule, was I surprised? Given all I’ve written above, do you see why I wasn’t?

Do the smart thing: if you’re using Time Machine, get a little portable drive like I did and run your backups that way. They’ll be fast, and you’ll be the one deciding when to back up, not Time Machine. I don’t know when Apple will decide to give us more configuration options for Time Machine, but until they do, those who care about their time should back up directly to an external drive.

Standard
How To

Run WordPress by itself or cached?

I’ve been running an experiment for the past three months. I wanted to see how well WordPress would do if I ran it by itself, without any sort of caching. So far, so good.

About four months ago, my web server kept getting pummelled into the ground almost daily, and I couldn’t figure out why it kept happening. After researching the issue, I found the prevailing opinion to side with the need for a caching plugin. People were complaining that it’s just not optimized well, and must be run with the aid of such a plugin, otherwise higher levels of traffic will bring the web server down. Trouble was, I already ran my WP install cached, using WP Super Cache, had been doing so for over a year, and my server still went down. (I should specify it had only recently started to go down.) What was I to do?

I posted a message in the WP forums asking why WordPress doesn’t generate static files. Were there any plans to do so in the future? To my surprise, Matt Mullenweg (WP’s founder) replied to my post, and told me that while there are caching plugins out there, WordPress.com doesn’t run any, and they’re doing just fine hosting millions of blogs. Others chimed in as well, and their replies got me to make the following changes:

  1. Made the switch to a VPS (Virtual Private Server) with SliceHost. Four months later, I’m still very happy about that move.
  2. Doubled the RAM on my web server (to 512MB from 256MB).
  3. Turned off WP Super Cache and started running my site by itself.

Each step followed the other in succession. I wanted to make gradual changes so I could see why my server kept having issues. Switching to a VPS host was good, and it was needed, but for my traffic levels, it wasn’t enough. Doubling the RAM was good and it was needed, and while the new RAM is enough for now, I’d still be having problems if I didn’t also disable my caching plugin.

Here’s where I think the crux of the caching/non-caching issue lies: it has to do with the load placed on the server as cached versions of the pages get created. Normally, that’s a non-issue. But as I monitored my server carefully, I discovered that it went down only as it started to get indexed heavily by search engines. Their bots visited my site in spurts, with traffic peaking, then falling back down. They spawned multiple threads, over ten at times, following links and slurping up the content. It’s when bot traffic peaked that an incredible load was placed on the web server. It kept generating cached versions of pages it hadn’t already cached, RAM and CPU demand increased to unsustainable levels, and it went down.

No amount of tweaking the Apache and MySQL config files helped with this sort of scenario, or at least it didn’t help me. You see, the difference between peak traffic levels with search engines vs. people is that people will go to a single article or a group of articles that are in demand. A caching plugin works great for those sorts of situations. There’s a limited number of pages to worry about caching, and those pages get served up time and time again. The load is acceptable. When a search engine bot starts indexing your site, it’ll call up any and all available pages that it can find. That can place a huge load on the web server as it scrambles to serve up those pages and build static versions for the caching plugin. I believe that it’s too much for most medium-sized servers to handle, and they will usually go down.

In my case, disabling the caching plugin and making sure no traces were left in the .htaccess file were the only things that helped. Now, I might have up to four different search engine bots crawling my site, each spawning multiple threads, and my server will usually not go down. Sure, there are times when the server will get dangerously low on RAM, and will be unresponsive for 5-10 minutes, but that’s an acceptable scenario for me. And if I should all of a sudden get huge amounts of people traffic to a post, it’s possible that the web server will also become unresponsive, at least for a time. But the great thing about running WordPress by itself is that Apache will usually take care of itself. As the requests die down, Apache will kill the extra threads, the available RAM will go back up again, and the server will recover nicely. That wasn’t possible while I ran the caching plugin. When it went down, it stayed down, and that was a problem.

I realize that what works for me may not work for others. I have not tested what happens with WP Super Cache on a larger server, for example one with more RAM. It’s possible that the larger amount of RAM there will offset the greater demand placed on the server as it builds static versions of the pages, although I’m not sure what to say about the CPU usage. That also peaked as the caching plugin went crazy. Not sure how that’ll work on a more powerful server.

WP Super Cache has some options that allow you to cache more pages and keep them cached for longer periods of time. Perhaps fiddling with those options would have allowed me to keep running the plugin, but I wanted to see how things stood from the other side of the fence. Like I said, so far, so good. Caveats aside, running WordPress by itself was the cure for my persistent web server outages.

Standard
How To

A cure for cold sores

I can’t take credit for this cure. A life-long nurse told me about it a few years ago, and it’s worked for us ever since. I’m not sure if she’d be comfortable having her name revealed here, so I won’t do it. But I’ll always be grateful to her for the advice.

In a few words, cold sores are cured and even prevented by Lysine. Any brand should do. Just go to your local supermarket or drug store and pick up some Lysine pills. They’re white, round, medium-sized as pills go, and they’ll do a number on your cold sore.

I, for example, have had these things since my childhood. Whenever I got stressed, or ate too much sugared stuff, or happened to be recovering from a cold or some other illness and my immune system was down, I got a cold sore. I used to be terribly embarrassed about them, and I still am, to some degree. Sometimes I’d get them four or five times a year, and each one took about 2-3 weeks to go away completely.

Now, whenever I feel that tingle in my skin and know that one’s on the way, I take a Lysine pill. You can take up to 3-4 pills a day, just don’t take them all at once. It’s not a sure-fire, 100% kind of thing, but I would say the overwhelming majority of the time, the cold sore doesn’t even show up on the skin. It just goes away. And when it does manage to break out, taking Lysine while you have it will make it go away sooner.

I don’t know why other cures don’t work, particularly the useless brand-name cremes that cost upwards of $20 for a tiny little tube (they only make things worse for me) — but inexpensive Lysine does the job just great. For less than $10, you get a huge pill bottle that will likely last you more years than you’ll remember.

Standard
How To

Cannot change WP theme if Turbo mode is enabled

I’ve been wondering what sort of bug I’ve had in my WP installs for the last few weeks, and only now figured out what’s going on.The Turbo mode for WP is done through Google Gears. There’s a bug in the Turbo mode that will not allow you to change your blog’s theme. It works by not displaying the “x” (Close) or the “Activate …” options in the DHTML layer that opens up when you preview a theme.

Try it out if you want. Enable Turbo mode, then go to Design >> Themes and click on a theme that you’d like to preview and possibly activate. It’ll open as a full page instead of opening in a separate layer above the regular page, and the option to activate it will not display. In essence, you’re locked out of switching themes. You have to hit the Back button to get back to the Admin panel, else you’re stuck in a Live Preview mode.

This has nothing to do with file permissions, as I originally thought, or with corrupt theme files. No, it has everything to do with Turbo/Google Gears and the way WP implemented this. It’s a bug that needs to get fixed. The only way to enable theme-switching for now is to disable Turbo mode. After that, things work just fine.

This bug is present even in the latest WP version, 2.6.3. I hope it gets fixed soon.

Standard
How To

Use a Nokia N95 as a Bluetooth modem on a Mac

One of the reasons I bought a Nokia N95 was the ability to tether it as a Bluetooth modem on my MacBook Pro. I wanted to access the internet via my mobile phone if I’m away from home or from a WiFi spot. While Nokia’s PC Suite of applications includes an option to tether the phone to a Windows machine with just a few clicks of the mouse, it’s not that simple for the Mac.

Fortunately, once you go through a 5-10 minute initial setup process (outlined below), connecting to the net via the N95 becomes a simple matter of two mouse clicks. Keep in mind that this tutorial will help you configure a Nokia N95 phone only for the T-Mobile network; you’re on your own when it comes to other service providers, but the process should be fairly similar.

I’m indebted to this pre-existing tutorial from The Nokia Blog. However, I found the instructions a bit confusing, as the Mac OS X operating system has been updated since and the network preference screens don’t look the same. Consider my post an updated tutorial, with screenshots from the current Mac OS X (10.5.5).

1. Get the 3G modem scripts for Nokia phones from Ross Barkman‘s website.

Look for the section called “Scripts for Nokia 3G (EDGE/UMTS) phones”.

He’s written numerous such scripts and posted them for download on his site. They work fine for countless people, so please, if his script works for you, show your thanks by donating a few dollars to him.

2. Drop the “Nokia 3G” folder containing the modem scripts (yes, the entire folder), in the /Library/Modem Scripts/ directory at the root level of your Mac’s hard drive.

It should look like this once it’s in there:

3. Add your Nokia N95 phone as a paired Bluetooth device.

If you haven’t added your phone as a Bluetooth device yet, click on the plus sign in the lower left corner and go through the wizard to add it. Make sure to check both boxes shown below, and to pair it as well.

If you have already added it as a Bluetooth device, you may want to run through the configuration wizard again, making sure to mark both checkboxes, as seen below. Click on the phone to select it from the list of Bluetooth devices (see screenshot above), then click on the little gear icon in the lower left corner of the dialog box and select “Configure this device”. You will get the following screen. Click on Continue and run through the wizard to the end.

4. Configure the Bluetooth service preferences.

Go to Network preferences. Here’s where you have a choice. If you’re going to want to use multiple mobile phones or Bluetooth devices as modems, you may want to duplicate the existing Bluetooth service and configure each copy separately, naming them accordingly (Nokia N95, iPhone, etc). To do that, select Bluetooth, then click on the little gear in the lower left corner and select “Duplicate Service”.

I’m only going to use the Nokia N95 as a Bluetooth modem, so I chose to work directly with the existing Bluetooth service, as you can see below. To do that, click on the Configuration drop-down menu and choose “Add Configuration”. You’ll be asked for a name. I named it “T-Mobile Internet”. In the Telephone Number field, I put “internet2.voicestream.com”.

Now click on Advanced, and you’ll get a whole series of preference panes. Modem is the first one. Make sure the information matches what you see below.

Now click on DNS. Some say you should pre-fill DNS server addresses, because your mobile service provider may or may not give them to you. Thankfully, T-Mobile will automatically assign you two DNS server addresses when you connect, but just to be on the safe side, grab one or two more DNS addresses from a public DNS server list like this one and add them to the DNS preference pane. If you look below, the two DNS addresses that are grayed out were automatically assigned by T-Mobile after I connected through the phone, and the single address in black was the one I manually added.

Don’t worry about WINS or Proxies, go to PPP, where you’ll have a drop-down menu. The Session options on the PPP preference pane should look like this:

And the Configuration options on the PPP preference pane should look like this:

Some people say you should disable “Send PPP echo packets” and “Use TCP header compression”. I left them enabled, and my connection works just fine. But, if you should have problems connecting and staying on, you may want to disable them. Just uncheck them and hit OK.

5. Apply the changes and click on Connect.

The Bluetooth modem status should change in the menu bar and first say “Connecting…” then “Authorizing…”. After it connects, it should show the time elapsed since the connection started, like this:

There’s one thing I haven’t been able to figure out though, and I would appreciate your help on this. Getting the Mac to connect to the internet reliably through the phone, every single time, is still something that I need to work out.

That first evening after I configured things as outlined above, I was able to connect and disconnect at will. However, the second morning, I got a “Could not authenticate” error. I clicked on the “Set Up Bluetooth Device” (shown above), and re-configured my N95 (as detailed in Step 3). After that, it was okay for the rest of the day, but the same connection issue re-surfaced the next day. I’d read that keeping iSync open while you connect will help, and I tried it, but it didn’t seem to work reliably for me. What has seemed to work is logging in and out of my account on the Mac, and rebooting the phone.

It seems that Nokia would be best equipped here to make things easier and more reliable. I do wish they’d release a tethering app for the Mac, just like they released an iSync plugin that lets the N95 sync with the Address Book and iCal. Until then, you can try any of the following workarounds when you experience connection issues:

  • Re-configure the phone as a Bluetooth device (as outlined in Step 3 above)
  • Disable “Send PPP echo packets” and “Use TCP header compression” in the PPP Configuration preference pane
  • Open iSync before you try to connect to the Internet through the phone
  • Log out of your account on the Mac and reboot the phone

Once the phone is tethered properly, it’s an enjoyable experience. There’s a newfound freedom I feel when I can go online from just about anywhere. There’s something elegant in using my phone as a Bluetooth modem. It can stay in my pocket or on the table next to my laptop, tethered wirelessly, still working fine as a phone while also letting me get on the Internet. Cool stuff indeed.

Standard