6

If I put /var as first partition, then /home and /, will the partition for /var have better performance than if I put other partitions close to head of the disk? Will the disk sector position matter?

I heard some people saying that I should put swap closer to the head of a partition to get higher performance.

1
  • 1
    Increasing usage of LVM and RAID might render this question moot.
    – jw013
    Jul 18, 2012 at 14:53

3 Answers 3

6

Yes, it is true.

The platters in a disk rotate at a fixed speed (7200 RPM in the common case). As such when the head is over the outer portion of the platter more surface area passes under the head per rotation than on the inside track. Thus more IO per rotation is possible.
(The 'beginning' of the drive is the outside tracks of the platters)

Now whether this is going to be at all noticeable, especially for swap which you shouldnt be using extensively anyway, is debatable.

5

That was very true a decade ago, when drive IO speeds were the major bottleneck. In fact, it was recommended placing your swap on a separate drive, to keep it off your primary's BUS.

IO speeds have improved since then, partition placement for performance tweaks are negligible now.

To add, and assuming placing swap closer would improve performance, it would indicate that you would be using a lot of swap to begin with. That is exactly what you should avoid, if anything, to gain performance. Swap is a pinhole bottleneck compared to your RAM throughput, and should only get used with heavy loads, like during virtualization, or large dataset processing.

/var on the other hand, does get used more often, but I have yet to see benchmarks indicating this trick to improve it's performance. I'd be very interested if this were true :-)

update: found this interesting performance tuning guide that indicates placing /tmp or /var on the outer region of the platters, improves speed. This makes sense, bear in mind to see the difference you may need to reach loads like those of a ftp/web server.

1

2019 update:

Solid state drives have gone up in performance and down in price to the point where the original question simply doesn't have any useful meaning anymore. If performance is of any concern whatsoever, you put the operating system on an SSD and get equal performance across the entire drive.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .