Wednesday, December 21, 2005

Penguin Performance

If you're not that familiar with Linux, I'm going to break silence and let you in on a little secret: all those claims of higher performance are bunk. They ARE true...under certain circumstances, such as you're not running a GUI and you don't run any services and pretty much don't log in. Yeah, I'm exaggerating a little bit, but only a little. :)

Here's the top three responses you'll get if you ask how to tweak the performance on a Linux box so that it's close to the speed of a Windows machine:

1. Disable any unecessary services. Thanks, that's probably the most useless suggestion ever. Here's the deal, if a person doesn't know enough to do this first, they're probably not going to know enough to know which services are unecessary. Hell, I've been working with Linux for 12 years, and when I use a mainstream distro, I sometimes come across things whose purpose is unknown to me.

2. Switch to a "lighter" GUI (or, my favorite: don't use X at all. Neandertals). For those coming from the Windows world, let me explain how GUIs work on the Unix side of the world:

At the most basic level, you have the underlying OS which is made up of the kernel and some supporting utilities. You're going to run into morons who tell you "Linux isn't an OS, it's a kernel". Well, a kernel's pretty useless on its own, so we can glob those necessary things together and make us up an OS. Linux is now known to be the whole OS, not just the kernel. It's called the evolution of language. Evolve or die.

Sorry, I like to rant. Okay, on top of the base OS, you have the X Windows system. The former one used mostly on Linux was XFree86. In recent years, most distros have switched over to X.org's version. Some did it for licensing reasons, others did it because XFree's development team is made up of an arrogant bunch of bastards who'd rather spend more time complaining that no one follows their arbitrary rules than actually producing code. In the Windows world, X doesn't have an immediate twin aside from probably the GDI subsystems. Basically, X is what puts the GUI on your screen. You know how you log into your Windows box, and for half a second you only see a green screen and a mouse cursor? That's the Windows subsystem that corresponds to X.

On top of X, you need a window manager. This is the subsystem that actually draws windows on the screen and all their widgets and stuff. It's responsible for how things LOOK to the end user. X buys the canvas, the wm draws on it. In the Windows world, despite what most *nix people think, there IS a corresponding component: Explorer (not INTERNET Explorer, basic Explorer. The one that shows you where your files are. It's not a 100% equal comparison, but Explorer does handle a very large portion of what a wm does. Like *nix, you can replace your explorer with another (like LiteStep) and change the way your interface works. One of the big problems with Linux is the hugemongous number of wms out there. I think last count had it at just under 200. Yes, I said it's a problem. Too much choice makes decisions impossible.

Finally, in some cases, you have a "desktop environment". These include KDE & Gnome. DEs extend beyond the window manager to include things like: how drag & drop works between programs, how menus are created and maintained, interprogram communications and compatibility and so on. Without a DE, programs work about as well together as most groups of people...sometimes they'll be compatible enough, but most days you'll wonder why you bothered coming in.

It's these DEs that most *nixers have a problem with. Because they've lived without a modern OS for so long, they don't realize what they're missing out on. The console was good enough for their grandfathers, it's good enough for them. Anyone who complains about anything being "bloated" probably drives around in a 1965 Dodge Dart 'cause "all that technology makes the car too complex. Who needs anti-lock brakes, fuel efficiency, safety or FM radios? That's all useless fluff!" So, they'll tell you to at least switch to a lighter wm like Afterstep or WindowMaker or RatPoison. These have low memory footprints, and without the GUI taking up as much RAM, your computer seems to be faster. Kinda like stripping off the outer shell of a car to speed it up. It'll be faster, sure, but not much fun to drive in the rain.

Besides, I want my computer to work at least as well as it does in Windows, so that means I need all of the same kinds of features AND I want it to be as fast! Suggestion #2 is useless in those circumstances. (Keeping in mind that I like to use WindowMaker anyway, but that's not the point).

3. Use hdparm and tweak your harddrive settings. Almost a good suggestion. The problem again comes when you're using a modern distro. The kernel will generally setup your drives and controllers for maximum performance. In the last 3-4 years, I can't remember a single machine I've installed Linux on that "tweaking" with hdparm made any difference. The tweaks are implemented already.

So, that being said, I'm going to give you some real tweaks that should help some and make a difference for you. They'll be found in this article because this one's getting a bit long. :)

No comments:

Post a Comment