Where is the most efficient place for a Linux swap partition

Using applications, configuring, problems
Post Reply
Message
Author
purple_ghost
Posts: 416
Joined: Thu 10 Nov 2005, 02:18

Where is the most efficient place for a Linux swap partition

#1 Post by purple_ghost »

Usually the swap partition is the last one created. Does this mean it is on the outside part of the platter of the hard drive itself. In fact. If I use the inside of the drive for my Puppy save, or hard drive install. Then the arm must move to the far outside of the platters for a swap file. This hypothetically sounds inefficient.

I tried to create the first partition for the OS, or Puppy save file Then put the Linux Swap partition as the next partition. Remaining partitions are for data. What is the problem with this? Is this really more efficient?.


I was reading in a tech site that partitions that are smaller are more efficient. In their example. To create a small partition on the front of the drive for the Windows OS. Then put all of ones personal data in a second or more later partitions. How does this effect Puppy?

PaulBx1
Posts: 2312
Joined: Sat 17 Jun 2006, 03:11
Location: Wyoming, USA

#2 Post by PaulBx1 »

I am kinda doubtful about the notion you can control physically where things go on a drive any more (like you could in the old days). The drive firmware may remap things anyway. It might work, I don't know. But there are so many unknowns controlling performance it is really hard to be sure of anything any more. If you want performance buy a lot of memory and don't bother with swap!

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#3 Post by Flash »

I agree with Paul that more RAM is the better solution.

I have read, and it makes sense to me, that hard disk controllers always start writing at the outside of the disk and work in. Since the surface speed of the disk is fastest at the outside, the signal to noise will be highest and the sustained read speed will be fastest there. The first sector of the first partition, usually the boot sector in Windows, is located at the outside of the disk.

Having said all that, my guess is that you'd have to look very hard to see any difference in performance no matter where you put a swap partition.

Oddly, the data track on CDs and DVDs is a continuous spiral starting at the at the inner edge of the writable area and moving to the outside of the disk.

Bruce B

#4 Post by Bruce B »

PaulBx1 wrote:I am kinda doubtful about the notion you can control physically where things go on a drive any more (like you could in the old days). The drive firmware may remap things anyway. It might work, I don't know. But there are so many unknowns controlling performance it is really hard to be sure of anything any more. If you want performance buy a lot of memory and don't bother with swap!
Unfortunately, PaulBx1 has a valid point. Suppose at one point in time hda1 was for sure on the outer edge of the hard disk, which it was.

Things have changed so much that you cannot even guarantee that a partition will be a contiguous filesystem.

The upside is that today's drives are very fast compared to the predecessors.

I have 9 partitions on hda, the swap file is #9, the reason why is I have enough memory, it rarely gets used and #9 is easiest to delete or reformat for other purposes.

In answer to your question, I think the best place to put a swap partition is on a very fast second drive, that is, if you really expect extensive usage. It doesn't have to take up the entire drive, so you can use the rest of it for data storage and such.

User avatar
veronicathecow
Posts: 559
Joined: Sat 21 Oct 2006, 09:41

#5 Post by veronicathecow »

Hi, RAM is probably a million times faster than HDD, I always spend the little bit extra and get the RAM.
I love Puppy running in RAM. On a 1200 Athlon I can bring up a browser faster than a mate with 2GB of RMm, Windows XP and a Dual core gaziilion speed proc with RAID SATA blah blah blah! 8-)

Bruce B

#6 Post by Bruce B »

veronicathecow wrote:Hi, RAM is probably a million times faster than HDD, I always spend the little bit extra and get the RAM.
I love Puppy running in RAM. On a 1200 Athlon I can bring up a browser faster than a mate with 2GB of RMm, Windows XP and a Dual core gaziilion speed proc with RAID SATA blah blah blah! 8-)
And all this time I thought it was only 1000 times faster :)

I've got 2.5GB RAM, why so much? Well, I can make RAM drives galore and shmfs filesystems. Convert .wav to .mp3 in record time and visa-versa.

Least I mention compile cds and iso files fast and without the least bit of disk wear or tear.

User avatar
veronicathecow
Posts: 559
Joined: Sat 21 Oct 2006, 09:41

#7 Post by veronicathecow »

Hi Bruce B, well I was working it out roughly. Using some real world figures say 10ms seek time for average HDD. and
DDR-400 at 5 ns access time I make that more like
10ms/5ns = 2 million times faster for inital grabbing of data approx.
(Hopefully my decimals are in the right place (Unlike the Hubble mirror 8-)

If anyone is interested there is an excellent article on Filesystem speeds here but lost it now. Anyway it boils down to EX2 or EX3 are the best.

Cheers

Post Reply