[svlug] Performance and memory
steve
steve at itsage.com
Sat Apr 30 14:47:17 PDT 2005
Thought this might be worth mentioning, given the current thread.
The thing to remember with hard drives is the low number tracks are
'faster'. This is because higher number tracks are closer to the center
of the disk, and require a longer 'seek' time to step the motor in.
The practical result of this, is that typical 'default' installs are
backwards from what you want for performance. For the best performance,
data that change often should be near the outside of the disk (track 0).
For instance, swap should generally be the first thing on the drive,
for fastest access. Relatively static stuff (like '/' - /bin,/sbin,
etc) can go on the inner tracks ( commonly used utils will end up cached
anyway). The 'middle' area of the disk should be used for application
data, again with the most frequently changing near the outside.
One exception to the above rule of thumb is '/boot' - this should be
near the beginning of a drive, even though it changes relatively
infrequently. The reason is some older drives/bios's have problems
booting from 'too large a drive' (does such a thing exist ?? :-P )
Anyway, keep /boot on the first 1-2G of the drive, and you should be fine.
The simplest way to set this all up would be to create partitions in the
following order: 1,2,4,3. This would allow you to create a physical
partition 4 at the end of the disk for / and an extended partition 3
taking up all the sectors in the middle (see below). Unfortunately,
most install programs I've tried won't allow this. You can generally
work around this by creating all partitions 'in order' (from lowest
track to highest) and putting / as the last logical partition on the
drive. This does require you to work out _all_ your required partitions
ahead of time, but is otherwise painless. I generally just create a
couple of 'spare' logical partitions to provide a lil flexiblity in case
disk needs change. MD/LVM can also help with this.
Bearing all this in mind - here's how I generally try to partition
stuff. Note that some of the partitioning tools really fight you (won't
put swap first, won't put an ext. partition in any partition except 4,
etc etc)
Quick Partitioning Cheat Sheet - 2 Drive MD RAID-1 system
---------------------------------------------------------
Part. Drive A Size Drive B Size
----- ------- ---- ------- -----
1 Swap 256M Swap 256M
2 /boot 100M /boot 100M
3 /var/log XX /var/log XX
4 EXTENDED ALL EXTENDED ALL
X /usr/local XX /usr/local XX
.. .. ..
Z / XX / XX
(NOTE: / is physically on the last sectors of the drive...)
More information about the svlug
mailing list