Solving Ubuntu Performance Issues
As a long time Linux user, I was disheartened to find getting a reasonable level of performance would be so much work. And would defy the old saw that Linux runs great in less memory than Windows.
This is a q&e summary of my experiences with Ubuntu 9.04 (Jaunty Jackalope) Desktop, and the various performance related issues that have dogged me to this day. Actually, some of these problems date back to 8.04, and were radically more pronounced on 8.10 which was almost unusable for me. Ubuntu Desktop 8.10 sucked OUT LOUD. At least from a Desktop performance perspective.
Update 2009-12-30: I have belatedly upgraded to 9.10, and my first, early impressions are that it is much improved. Probably due to improvements in the Intel video code.
Update 2010-02-12: Bit the bullet and upgraded to 4G RAM and nVidia graphics. Life is good now. The lesson seems to be that 1G is not enough for full time Ubuntu usage.
Synopsis: Ubuntu Jaunty 9.04 is problematic for various hardware profiles. Intel video chipsets are especially a prickly path to travel. The bar has been raised for system memory as well. 9.04 may run in less than 1G, but the performance will be poor in anything less than 2G. Power users go for 4G. Hey, RAM is cheap these days.
My Hardware
I have two systems to compare, my home desktop and my work desktop. These both run the same version of Ubuntu (and have since 7.04). Both started with 1G RAM. My home system is 3Ghz Celeron with onboard Intel video. My work system is a dual core Intel processor with Nvidia video. Both have Intel motherboards, and are similar in many other respects. My work system was new in Sept 2007, my home system is a little older. Both had also been very similarly configured and tended to run the same mix of apps. I am a command junky, so I tend to do a lot with terminals. Its not unusual for me to have multiple terminal windows opened all the time. And always a few Firefox windows (I work as a web developer).
I have not done any benchmarking or formal comparisons of the two systems. The following is just my attempts at getting a decent level of performance out of both systems.
Both performed admirably up to and including Ubuntu 8.04 with little noticeable difference.
Nose Dive
Upon upgrading my home system to 8.10, performance went into the toilet. Into some real deep doo-doo. My home system was for all intents and purposes unusable, it was so painfully slow. Had this been my first Linux experience, I would have run, not walked, back to whence I came.
Every task was excruciatingly slow — opening windows, changing desktops, scrolling in Firefox. Ouch. Ouch. Ouch. My work system also suffered but not nearly to this degree. Conclusion here: Intel chipset blues (see various online articles related to this).
To ameliorate this, I reconfigured X, changed to a lesser resolution, and switched from Gnome to xfce. All these helped a little. And I started being careful of how many programs I had opened. As a long time Linux user (since 1998), this was the first time, I had to worry about this kind of BS.
As the 9.04 release was just around the corner, I waited for that, and by now finding out that there were acknowledged Intel chipset problems.
Upgrading to 9.04 did help, but still I had a dog system. It was often decent for a few days, then performance went through the floor. Opening any application was painfully slow. Scrolling a simple Firefox page was painfully slow (and top would show the CPU was pegged at 100%). Typing in a Firefox input field was similarly slow. Restarting X every few days, would help, but I HATE doing stupid stuff like that. That’s a Bill Gates legacy issue. Our goal, and repeat after me: never reboot, never take stupid steps to help performance issues.
My work system was noticeably better. But instead of a few days, I’d start feeling the need to restart X maybe once a week or so.
For a goodly time I was convinced of a configuration related issue. Then someone clued me into /proc/meminfo, specifically the Commit* lines:
$ grep Commit /proc/meminfo
CommitLimit: 3512248 kB
Committed_AS: 2100996 kB
The Commited_AS line tells me how much memory my currently running programs have requested. That right now is about 2G. That includes the Window Manager (xfce), several terminal windows, one web browser (chrome) with 5 tabs, several instances of the editor gvim. That’s pretty much it. Not a lot going on really. That’s about where the sweet spot is for me.
The rule of thumb here is you want that Committed_AS to be less than 2 times physical memory. When it goes beyond that, you will get excessive swapping, and eventually things start to crawl. When you hit 3 times physical memory, it starts to feel painful. That’s where I was initially, and have altered my usage habits to try to stay under the 2G threshold.
Here are some previous stats on the same system. Remember 1G physical RAM:
Logged out of X (which restarts the X server), sitting at GDM login:
Committed_AS: 452512 kB
Log back in / GNOME (including nautilus,etc, but no user apps and no effects):
Committed_AS: 789400 kB
Reboot Now and at GDM login:
Committed_AS: 482064 kB
Start XFCE new session w/compiz:
Committed_AS: 660792 kB
Log out and start GNOME new session w/o compiz:
Committed_AS: 878332 kB
Reboot and start XFCE w/compiz and 1 konsole window after reboot, no user opened apps:
Committed_AS: 709192 kB
XFCE w/typical app mix including FF, Chrome, multiple Konsole windows and a few vims.
Committed_AS: 1577520 kB
This is where I cut my teeth. The other system, my work system, I was able to upgrade to 4G RAM. It runs like a sports car now
No slow downs, no temptation to reboot or restart X.
In the course of all this, I also learned that the Intel video chipsets have developed serious shortcomings as part of an overhaul of the code. So in the long run, this is probably a good thing, but in the short run, there are a number of issues. The one that got me was performance related. I tried various configuration changes to help ease the pain, but nothing has really seemed to help. *sigh*
Conclusions
There are two major issues:
You can’t run Ubuntu 9.04 Desktop comfortably with 1G of RAM. Forget it. Unless you reboot frequently or don’t run things like web browsers. Ubuntu desktop is a hungry beast. Feed it or suffer the consequences. 2G minimum, 4G recommended.
Intel video sucks the big one on 8.10 and 9.04. This is possibly short term pain for long term gain, but in the meantime, avoid Intel onboard video. Its painful.
Other tweaks discovered and worth noting:
xfce is significantly lighter weight than gnome. Recommended for anyone with performance related issues.
Google chrome browser performs significantly better for me than Firefox. It opens faster, it loads pages faster, and it actually scrolls without taking all CPU.
The Abode flash plugin (sadly) solves some problems with sound that can come out the open source plugins.
And lastly, close those unused programs. They eat memory. This was never an issue with me on older Linuxes, but definitely is a factor with limited memory resources with newer Ubuntu desktops.
So where am I now? Still an Ubuntu guy. Hoping the future gets a little brighter. Or the ol’ pocketbook can afford a new/improved system.
Good news! I’d be curious though if that means you can run 2 browsers simultaneously for a week or two. I have been able to do that kind of thing effortlessly for many years. Starting with Ubuntu 8.10 (and then 9.04) I can do this, but it starts getting very painful as things start slowing down radically. I think the Intel chipset problem does some funny memory related stuff too, like maybe it reserves more than it needs and the rest of the system suffers. That’s just a theory based on comparing my home and work systems (which was better but still not great after a week or so).
Yea, I am totally happy in the Ubuntu camp. Up through 8.04 was great performance. But since then …. well. I think a good part of my problem is the Intel chipset issues. I sure hope 9.10 fixes that!