Ubuntu Lucid Lynx and the Wallowing Walrus

I have a fairly old computer that I use as a sort-of server at home.  P4, 3GHz, 1GB RAM, 120GB HDD.  I have Ubuntu installed, and just upgraded to 10.04 LTS.

I installed VMWare Server 2.02 a year ago, to allow a Windows XP instance to run a copy of Pastel Accounting, used by my wife’s company.  Unfortunately VMWare has to be manually patched to install in Ubuntu, and it’s been like that for a long time.  And after each kernel update, it has to be recompiled.  That is, however, not the biggest problem.  It’s the swapping of memory.

1GB of RAM is not really enough for a Gnome desktop and Windows XP.  A 1.6GB swap partition was in order, but strangely enough, the system has become less and responsive.  On inspection it seems that the swapping is slowing things down to a crawl at times.

I tried moving the swap partition a new USB flash drive.  Initially it work really well.  The flash drive is substantially faster than the hard drive, so performance must have increased 10 fold.  Then the flash drive get corrupted and things fell apart completely.

So I investigated swapd.  I figured since the swap partition was at the end of the drive, the head movement across the disk was slowing thing down too much. Put the info is pretty vague and I haven’t taken the time to figure out if it would be worthwhile tweaking Ubuntu to only use swapd and not have a dedicated swap partition. Furthermore, there is no guarantee that VM-Ware will use it correctly, so I opted for another approach.

Somewhere it was suggested that in a one hard drive setup, the best place for the swapfile should be in the middle of the disk. So I made three partitions with the swap partition being the second or middle one. The logic is that the head moves over that part of the disk frequently between the data (part 3) and the system partition (part 1), so having swap there, makes it accessible in the fastest manner.

So far so good. The machine does not imitate the Wallowing Walrus any more.

From experiences in the database world I know that having data spread over many spindles allows increased concurrent access and speeds things up tremendously, so here, without extra hard disk spindles, is a way to speed up access by placing the data where the disk head on average needs to travel the least distance to write or read swapped memory.

… and one day, hopefully sooner than later, I’ll replace the machine with a new AMD 6 core Phenom or Intel I5 or i7 based system with lots of RAM and a few hard disks!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s