web server partitioning best practices

I need to rebuild a web server because usage has massively increased and presently the 12mb php per script limit is using all of the server's memory at times. the new machine is likely to have 8Gb of RAM

any suggestions as to how the partitioning should change?
df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda7             2.0G  561M  1.4G  30% /
/dev/sda3             190M   20M  161M  11% /boot
none                  989M     0  989M   0% /dev/shm
/dev/sda8            1012M   33M  928M   4% /tmp
/dev/sda5             9.7G  4.5G  4.7G  49% /usr
/dev/sda6             9.7G  977M  8.2G  11% /var
/dev/sda2             2.5G  840M  1.6G  36% /home
/dev/sda10            108G   53G   51G  51% /usr2
/usr2/design          108G   53G   51G  51% /home/design/disk2
                      108G   53G   51G  51% /home/changelife/changelife

Open in new window

Who is Participating?
You have just pointed out two very different issues:

1) Your running out of ram
2) You need help with partitioning, which unless your talking about your swap space isn't going to help with your memory problem...

As you are talking about a dedicated webserver without users the simplest and easiest way to partition a server like this is with 4 partitions.

Partition 1: / = 20Gb - The vast majority of the install will be on here.
Partition 2: /var/log = 50Gb+ - Allows you to keep virtually unlimited logs, increase if your generating lots and lots of logs, and consider a seperate disk if you are generating bucket loads of logs.
Partition 3: /var/www (substitute for the location of your web server files) = As big as you need, easily just allocated the rest of the free space.
Partition 4: Swap = 8Gb - This shouldn't be double the amount of ram any more, anything over 2Gb of ram for memory should just be 1:1, according to redhat anyway...

Give me more information if you want more indepth information or recommendations.
Michael WorshamInfrastructure / Solutions ArchitectCommented:
I recommend using LVM whenever and whereever at all possible. From a system administration perspective, it just makes it easier to extend logical volume mounts as needed. It also prevents runaway processing from taking down your system if the root filesystem filles up.

All of my systems have the following layout (created via kickstarting):

/dev/sda2              4061572    773784   3078140  21% /
/dev/mapper/vg00-home  1015704    220600    742676  23% /home
/dev/mapper/vg00-tmp   1015704     34108    929168   4% /tmp
/dev/mapper/vg00-usr   4062912   1761360   2091840  46% /usr
/dev/mapper/vg00-opt    507748     19588    461946   5% /opt
/dev/mapper/vg00-var   2031440    346344   1580240  18% /var
/dev/mapper/vg00-web   6192704    177256   5700940   4% /web
/dev/sda1               194442     24676    159727  14% /boot
tmpfs                   513408         0    513408   0% /dev/shm

Open in new window

cjl7freelance for hireCommented:
This is really old-school, normally you wouldn't need that many partitions...

I'd settle for a '/' '/var' and a '/web' and as pointed out leave some space so that you can extend the volumes that need it. (Using LVM is assumed)

Also separating the web-service from the database is a good thing, both are IO-Intense and can easily clobber up a system.

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

for space utilization, I recommend LVM so you could increse the space whenever need. But if you wanna performance and redundency, then go for Raid 5.

Best Luck.
gddl630Author Commented:
thanks WizRd-Linux

the existing machine is also running a very old RHEL version, why is also why we decided to build a new one.

the machine is a web server running the following on Cent OS: Apache / SSL / PHP / MYSQL / FreeTDS - MySQL is barely used the sites are using FreeTDS to access MSSQL server for an in-house built app.

the new machine will be a VM running on ESXv4 so I guess we are relaxed for space, but what is better?
- allocate more space from now and not use LVM;
- or use LVM and expand as needed?
cjl7freelance for hireCommented:
use LVM (all days of the week)!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.