[KLUG Members] Disk partition
Jamie McCarthy
members@kalamazoolinux.org
Sat, 29 Dec 2001 19:35:19 -0500
awilliam@whitemice.org (Adam Williams) writes:
> >I have a 20Gb drive that I run Linux on. Is there a performance
> >reason to carve the disk up into
> >/
> >/home
> >/usr
> >/var
> >/tmp
> >/...
I have a server that's just / and swap cause it's simpler. I have
a laptop with a zillion partitions because I want to minimize my
chances of file damage if it locks up or the battery gets yanked
at the wrong time.
Right around now I'm wishing I'd put the server's /home on a
separate partition because it would save a lot of time changing to a
new distro (I'm sick of Red Hat, Debian rulez! :)
> >Is it acceptable to have just a swap partition and a "/"
> >partition?
>
> Yes. For regular "desktop power user" this works just fine. It
> can hurt alot if you'll be hosting multiple simultaneous users.
Agreed...
> >And on the subject of swap space, is the general rule to create a swap space
> >1.5 times the amount of RAM in the machine?
>
> There is no general rule.
At this point I go with 1x, because all my machines have tons of
RAM. It's silly to build a machine of any decent quality these days,
with less than a gigabyte of RAM (under $100). The 1x, 2x, 3x rules
are from the days when machines had 8 or 16 MB RAM and you paid $500
for it. They're just rules of thumb and they're outdated -- because
RAM and disk got 1000x cheaper, but only 5x faster.
The problem with having a gigabyte of swap is that any machine can
swap out about 50 MB, maybe even 100 MB of stuff, without any harmful
effects. But if your machine is *doing* anything, once you get about
100 MB of *active* RAM swapped out, it'll just lock up.
It's best to cram a ton of RAM in and then set it up so it won't
ever run out. But if some process does suck more RAM than you have,
you need to ask yourself, what would you prefer the system do? If
you have too little swap, the kernel will kill some processes for
you, which isn't great. But if you have too much swap, the machine
will just completely lock up and you won't even be able to ssh in;
you may end up having to hit the power switch.
> If you want to edit hires photos in GIMP on a regular basis, edit
> CAD drawings, play with SQL databases go with 2x.
If your SQL server is loaded enough to go deeply into swap, then
unless its load goes down by itself, it's never coming back, and
probably in a matter of minutes you'll hit one of the two scenarios
I just described...
My personal rule of thumb is:
under 64 MB RAM: 2x or 3x RAM
under 128 MB RAM: 2x RAM
under 512 MB RAM: 1x RAM, minimum 128 MB
over 512 MB RAM: 512 MB
...because even if you have 16 GB of physical RAM, if your machine
is working hard enough to go 512 MB into swap, it's in deep trouble.
--
Jamie McCarthy
jamie@mccarthy.vg