Solved

CentOS Webserver Harddrives

Posted on 2013-05-15
11
464 Views
Last Modified: 2013-05-17
Hi,
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,
Tom
0
Comment
Question by:Thomanji
  • 5
  • 2
  • 2
  • +1
11 Comments
 
LVL 47

Expert Comment

by:dlethe
Comment Utility
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.
0
 
LVL 76

Expert Comment

by:arnold
Comment Utility
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.
0
 

Author Comment

by:Thomanji
Comment Utility
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,
Tom
0
 
LVL 76

Assisted Solution

by:arnold
arnold earned 100 total points
Comment Utility
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>
/var/www

Swap space should be individual partition on each sata.
1xRAM.

The raid devices with the exclusion of /boot should use LVM overlay.
0
 
LVL 3

Accepted Solution

by:
GhostInTheMacheen earned 350 total points
Comment Utility
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.
0
Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

 
LVL 3

Expert Comment

by:GhostInTheMacheen
Comment Utility
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".
0
 
LVL 47

Assisted Solution

by:dlethe
dlethe earned 50 total points
Comment Utility
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.
0
 
LVL 3

Expert Comment

by:GhostInTheMacheen
Comment Utility
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.
0
 
LVL 3

Expert Comment

by:GhostInTheMacheen
Comment Utility
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 =)
0
 
LVL 3

Expert Comment

by:GhostInTheMacheen
Comment Utility
Note: I meant to say move /var/lib/mysql to the SATA RAID two comments up ;)
0
 

Author Closing Comment

by:Thomanji
Comment Utility
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
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now