CentOS Webserver Harddrives

I am setting up a new web server and have a relative small budget.
The server comes with a 500GB SATA and a 64GB SSD.
Originally, I thought to use the SSD only for MySQL but the host suggested to actually install the OS on it too.

My question would be what you opinion is on this.
Will the OS fit and will it really be a benefit, since the websites are way bigger than the 64GB space so the public websites as well as the Webmail would be mapped to the SATA drives because of their size.
So is it still very beneficial to have the base Cent OS 64bit LAMP installation on the SSD and map selected directories that are not accessed to often to the SATA. I currently have SAS 15k drives and because of budget scale down to SATA 7.5k so I am exploring the options to keep performance up as much as possible.

I would love to hear some opinions and also if the OS over time might get to big.
Also what files and directories should really be on the SSD. Maybe it is better to do it the other way around to install the OS on the SATA and only map certain directories to the SSD.

I do not have anyone with me to discuss this and the host obviously is advising me into whatever makes more money for them. So a neutral opinion from a expert in web sever set-up would be what I need.

Thank you for your opinions.

Best wishes,
Who is Participating?

Improve company productivity with a Business Account.Sign Up

GhostInTheMacheenConnect With a Mentor Commented:
Both your database (/var/lib/mysql) and Apache's content directory (/var/www) benefit from high read speeds. You can accomplish those read speeds either via the SSD or by utilizing ramdisks.

While I generally agree with arnold's concepts above for a non-SSD server, you may run into TRIM / wear leveling issues if you try to bring the SSD into a RAID1 with the SATA drives.

I'd use mdadm to mirror the SATA drives with /boot, /, /usr, /var, and /var/log -- though I think I would give / at least 2GB as your CentOS install is going to have a fair amount of binary and lib data for even a minimal install and it's good to leave /opt room for future utilities.

Then you can create an additional LVM partition on the SATA RAID for /var/www and an LVM partition on the SSD for /var/lib/mysql. If you use a lot of log-based reporting it might be a good idea to use an LVM partition for /var/log as well.

LVM will allow you to expand those logical volumes with additional partitioned space of need be, and provides a snapshot mechanism for regular backups of your MySQL DB (and optionally your server logs).

I agree with arnold that you should add a swap partition to each of the SATA drives 1xRAM in size.

While Apache has a basic built in caching mechanism, if you want to decrease Apache's response time you can create a ramdisk mount (tmpfs or ramfs) and copy all static web content into it before starting Apache. That'll decrease response time dramatically, but if you really have over 64GB of content you'll probably only want to use the ramdisk for the HTML/CSS/JavaScript content files and leave the images on disk.

Alternately, if you don't have the RAM to spare, you could always move the static text content over to the SSD for faster response times.
Neither.  100% of drives fail.  See if you can exchange the SSD for the SATA drive, and use host-based software RAID via the md driver.

You'll get read load balancing, and protection against bad blocks and HDD failures.
Dlethe who's very knowedgeable covered the why redundancy is better than a single device that is claimed to have a long life.

The installation of the OS would fit on a  a few GB.
Have not tried it recently so I might be off.
Build your data science skills into a career

Are you ready to take your data science career to the next step, or break into data science? With Springboard’s Data Science Career Track, you’ll master data science topics, have personalized career guidance, weekly calls with a data science expert, and a job guarantee.

ThomasPartnerAuthor Commented:
Hi and Thank you for taking the time to respond,

I think I forgot to mention some details.
The set-up of the server would be 2x 500GB RAID 1 SATA plus 1x 64GB SSD
I guess I could create a 64G partition on the SATA and simply do a backup or sync of some kind.

My worries are more in terms of performance. Does an OS install really take advantage of an SSD drive when we speak about a Apache Web Server, PHP, Postfix, etc. or is it more the Dadabases that would benefit.

So the question is to install the OS on the SSD or on the SATA and if this would be a worth wile performance change either way.

Best wishes,
arnoldConnect With a Mentor Commented:
OS on the SSD would mean a faster startup.
Depending on your partitioning setup
Ssd, and both sata drives (hot spare)  in raid groups
/boot 500mb
/ 1GB
/usr 5GB
/var 5GB
/var/log 2GB
The remaining space on the sata drives depending on how big your site and database going to be. Each will be its own raid group.  (Provides flexibility to adding additional/alternate drives when and as needed)

/var/lib/mysql  <max size of DBS>

Swap space should be individual partition on each sata.

The raid devices with the exclusion of /boot should use LVM overlay.
Note: I recommended mdadm (software RAID) specifically to avoid dropping out of AHCI mode in your BIOS, which should remain enabled to keep up the SSD's speed.

If you have a hardware RAID controller (not FakeRAID) for the SATAs that's an option as well. Basically that translates to "avoid dmraid".
DavidConnect With a Mentor PresidentCommented:
You can at least increase data integrity and risk of data loss if you use mdadm to mirror two equally sized partitions within the SATA drive.  You have 100X higher odds of unreadable blocks rather than catastrophic drive failure, so mirroring the disk with itself is worthwhile.

(Or you could even mirror the SSD with the HDD, and use the free space left on the SATA drive)

But still, considering the cost and aggravation of downtime and data loss, it is difficult IMO to rationalize not mirroring data by buying another HDD.
After some retrospection (and a small DB hiccup of my own) this morning, it occurred to me that, if I only had one server to work with, I would rather my site go down than risk losing any customer data.

Assuming you don't have a standby database mirroring your primary, you'd probably be better off moving /var/lib/www onto the SATA RAID in the configuration I posted above. The RAID1 setup ought to provide you sufficient read speeds and provides coverage in case of disk failure. Stick with an LVM partitioned logical volume for it, though, so you can take live backups (RAID is not a backup).

That leaves you an empty 64GB SSD to use for /var/www, or at least part of it, which will retain great response times (albeit slightly slower than ramdisks).

I can't imagine your web content is actually greater than 64GB unless you're either hosting hundreds of sites or storing user-uploaded files. If the latter is the case, keep the user files on the SATA array, along with a mirror / fallback of the web content and mount /var/www to the SSD. If the SSD fails you can just switch the mount over to the SATA array until you get the drive replaced.
But still, considering the cost and aggravation of downtime and data loss, it is difficult IMO to rationalize not mirroring data by buying another HDD.

I couldn't agree more, but assuming a hard-set financial limitation (and as long as the server itself doesn't have a hardware failure) I think a viable short-to-mid-term solution can be built with the provided hardware specs.

If it were my build-out, I'd probably scrap the SSD in favor of doubling the RAM and adding another SATA or two in there -- use ramdisks for the commonly accessed content, and mirror the rest... but it's not my built-out =)
Note: I meant to say move /var/lib/mysql to the SATA RAID two comments up ;)
ThomasPartnerAuthor Commented:
Thank you all for the info, it was very help full.
I not negotiated a RAID1 SSD 125GB plus a RAID1 250GB SATA set. So I will install all on the SSD and use the SATA for mailboxes and non essential files.
In addition I added another singe 500GB drive to backup the whole thing. Unfortunately the provider does not offer an off site backup but I will see to download the whole thing to my local pc and set-up differentials.

Thank you all for the effort, especially GhostInTheMacheen for the helpful details
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.