Disk Partition Percentage

Dave Yearke yearke at eng.buffalo.edu
Sat Nov 6 13:48:20 EST 2004


For swap space (technically more of a paging area these days, but old
names linger on), my personal opinion is to make a good guess as to how
much virtual memory you'll need for your environment; for a desktop
system, factor in the X Window System server, your applications, and any
other overhead ("top" is a quick way to get some idea of this), and for
server systems, the size and number of httpd, nfsd, or whatever other
server processes you're going to have running. Then, add about half
again to that. Disks are cheap enough that there's no point in not
making the swap space as large as necessary, even if you don't need it
all; on the other hand, you don't want to waste lots of space if you
don't have to. It's a balancing act, and if you already have a system
running the same kind of apps you're going to be running on the new
system, you can get some idea of what you'll need from it.

The old rule of thumb, as I remember it, was to make swap space about
two and a half times as big as your physical RAM. That's because early
paging algorithms needed to map physical memory blocks into page area
disk blocks in a one-to-one manner; so, for example, if you had 256 MB
of RAM, and 640 MB of swap space/page area, you still only had 640 MB of
virtual memory, because the first 256 MB of swap space was really just
an echo of your physical memory, and only what was above that (384 MB)
was true virtual memory in the sense we know it today. This is no longer
true, though; as far as I know, almost all modern operating systems use
swap/paging areas in an additive way, so in our above example, you'd
have 896 MB of virtual memory, which is what you'd expect.

The situation is also complicated by the fact that some versions of Unix
make the temporary directory "/tmp" a RAMdisk in virtual memory, because
it can dramatically speed up apps that need to use temporary files.
However, a program that creates lots of temporary files, such as "sort",
can chew through your virtual memory in no time, so that's a
consideration also, if you're doing that (this is the default for the
Solaris operating system; my RHEL3 system does not do this, and I
haven't dug in enough to see if it's an available feature or not).

Finally, as for other partitions, it again depends on what you're doing.
For convenience/laziness, I typically just make one big root partition
for kiosk/lab type systems, where end users log in, do some stuff, and
log out, but don't really generate any new files on the local system.
For server systems, I strongly recommend a separate /var partition,
because web server log files and other types of log files can get huge a
lot faster than one expects, and filling up a root filesystem is almost
never A Good Thing (tm).

I hope this helps, or at the least doesn't confuse things even more.

-- Dave



More information about the nflug mailing list