Hosting Partners  |  About Us  |  Blog  |  Legal  |  Portal Login

The Planet Blog

 

Kevin LandrethWith Web2.0 upon us, some customers have difficulty deciding when the time is right to make a new server purchase, particularly amidst a sea of buzz words like AJAX, Ruby, and Content Delivery Network. Which server is best for you? Should you get the Celeron or the Dual Clovertown? How can you choose between them without being bitten by over- or under-purchasing? How many times have you purchased a server with your boss looking over your shoulder? Hopefully, I can share a little of my professional experience to make your next server-buying experience a little easier … maybe when your boss is hounding you about how much you are spending on your next server, you can point to this definitive guide from someone who has done a few tours of duty in the industry.

What’s Your Server’s Application?

It’s a simple and straightforward question: What is your server’s application? I’m not talking about whether you are using apache, fastcgi, php, python, lighttpd, IIS6/7, asp or .NET. I am interested in how your server is configured and its purpose: Is it a Combo (http+db), a Workhorse (http or appserver), a File Server (http, ftp, rsync), or a Media Server (http site + files)?

While I boiled down the general “web servers” category into only those few types, I can almost guarantee that your web server will fall into one of them, and each type has its own needs.

The Combo (http+db)

While this is one of the most inefficient configurations, it happens to be the most common. Combo boxes rely heavily on CPU and RAM because they not only process the web request, but also handle the database queries. Databases queries eat up RAM and so do most web-scripting languages. The server’s CPU and hard disk access will probably be the most limiting factors in this type of application. I wouldn’t recommend spending a lot of money on RAID configurations or extra disks in a Combo machine since you would be better suited to run two purpose-customized non-RAID machines — with money to spare on backup space — for about the same price.

When you are able to break your Combo server down into separate dedicated http and database machines, you will be able to better tune and customize each server’s configuration for most efficient disk patterns, VM subsystem pressure and RAM usage. It may sound a little confusing, but I’ll explain a bit more about the different types of servers’ needs in my next post.

The WorkHorse (http or appserver)

When you don’t have a database on your http or appserver, you are looking at more of a workhorse-style server application. This configuration typically needs a focus on RAM and CPU without much demand for disk access. Typically, you will see servers like this bundled with Tomcat or ColdFusion. Most PHP applications suggest this setup because the ever-growing intensity of database queries and the amount of post processing in the scripting languages can put a strain on a box serving both the http and database requests. As a note, when you’ve set up your dedicated http or appserver box, you’ll have to decide whether to use mysql_connect() or mysql_pconnect() for your web application. A word to the wise: pconnect() is great if used in the right circumstances so don’t write it off if you don’t know how to use it or because it crashed your server last summer while you were on vacation. *wink*

The File Server (http, ftp, rsync)

File servers are the easiest beasts to set up. RAID and RAM!! RAM is for the file cache (which prevents direct disk-read requests), and RAID configurations accommodate multiple spindle heads. You will need 4 or 5 disks to make up for the RAID5 “write penalty.” I’d advise you not to get duped by reading about RAID1’s performance in reading from multiple disks. While it may be “smart” by definition, most hardware RAID controllers do not run “smart” RAID1. Don’t neglect the CPU on these toys since CPU plays an important role in bus transfers between the RAM, your disk controller and network connections. Dual processor or dual core machines would be ideal here.

The Media Server

These are the same as file servers but need a lot more CPU power and probably a separate database server (for the same reason explained in the “Workhorse” explanation). More spindles here = more better. :-)

Do I Need to Upgrade?

Don’t rush into a server upgrade “just because” … look at your current utilization patterns — install sysstat so you can at least use SAR and make RTG’s, and estimate your usage. Is your server running at 25% or 75%? If you are at 75%, you might need to split your web and database servers. If you are at 75% and already have made that split, you may need a much better box with application-level caching and threads. I’d recommend against over-shooting your needs since the monthly cost can eat away at you in the end. If you are speculating a 10-15% increase in usage, just double up on the most important server resources go increase them by about one-and-a-half times if you already have a beast of a machine.

Don’t get caught up with RAID configurations if you would be better served with two machines with more RAM and CPU. In the end, it’s not about uptime or how much you are paying for a server each month; it’s about the most efficient way to use what you have so you can spend your money where it is needed.

Making the Move

Most of the forum posts I’ve read were about people who hate migrating from server to server or about how horrible the process is for their customers typically don’t have much experience in the process. The more you do it, the better you become at it (not really a novel idea, I know). My experienced advice: you need at least two weeks to get it done and done right. Why two weeks? Everyone knows DNS is a pain and so are custom-installed perl/pear modules … remember in ’04 when you installed Compress::LZO for that one customer?

I hope this helps!

-Kevin Landreth, RHCE
Technology Architect

  • StumbleUpon
  • Twitter
  • DZone
  • Digg
  • del.icio.us
  • Technorati

8 Responses to “Choosing Your Server: Web Servers”

  1. Minotauro Says:

    Hello Kevin, please a quick question, what RAID (1 or 5) do you recommend to use with cPanel servers? I thinking use HD 250GB SATAII.

  2. Kevin Landreth, Technology Says:

    Do you have any other existing cPanel servers that you can profile from? Using sysstat (sar,iostat,etc) you can see if you are a heavy disk hitter. If you aren’t, then RAID1 would be perfect. The advantage you gain from RAID5 over RAID1 is not throughput speed, but spindle speed (aka seek times and IO/s). If you aren’t or don’t expect to ever be using the disks too much after the initial FS cache, then don’t shell out for RAID5.

    It might be worth your sanity if you have a few extra ms of latency for the reduced complexity of raid5. Even if you are only quoted a marginal differences in price, not adding in the extra risk of RAID5 could mean easier recovery. Though, if you hit the disk a lot, then dive in and get RAID5 as it is really worth the risk.

  3. Upgraded: The Planet’s HQ2 » The Planet Blog Says:

    [...] Choosing Your Server: Web Servers [...]

  4. Mills Says:

    Kevin,
    We’ve experienced more down time with Powweb over the last 6 months and need to explore new web hosting providers. I’m trying to educate myself on what type of web hosting (viritual hosting, dedicated servers, etc) will help us support our website traffic growth. For background, we’ll need enough horsepower to present our web pages, database activity from our admin web interface, and we plan to add video, more pictures, etc. I would appreciate your recommendation on the type of hosting solution we should consider for our next step.
    Thanks in advance,
    Mills

  5. Kevin Landreth, Technology Says:

    In all honesty it depends on a few factors. How database intensive is your application? Is your web application CPU intensive?

    Looking at your site, it seems to be fairly light weight from database activity as well as in media. In your case, since it isn’t a Web 2.0 style site (heavy interactivity), but more of an online brochure (mild search features, etc), a single machine would probably suit all your needs. With a dedicated machine it gives you a little room (adding videos, etc) to grow your traffic while not sharing any resources (other than aggregate bandwidth) with others.

    Moving to a Virtual environment would be an exercise in futility because you’ll just end up migrating to a real server in the end as you grow your site and business.

    Hope that helps!

  6. creativeon Hosting Says:

    About the question asked above.
    “please a quick question, what RAID (1 or 5) do you recommend to use with cPanel servers? I thinking use HD 250GB SATAII.”

    With the price structure of planet, and benefits of RAID-1 over RAID-5 (especially for SATA-II) i will not go for RAID-5. Here is my comparision.

    Price: (Both are same)
    for a 500GB of RAID volume, compare 2drive Raid-1 with 3 drive Raid-5 in both cases price is almost same when you go with TP. (consider a 500GB raid volume: cost of RAID-1 and RAID-5 controllers are equal, and you can go for 2 x 500 GB drives instead of 3 x 250 drives for almost same price)

    Data Reliance: (Both are same)
    A 2drive Raid-1 will retain data even if 1 drives, while Raid-5 will do lose data if 2 drives fail.

    Speed: (Raid-1 is better)
    Raid-5 volume will slow in read and writes considering parity overheads.

    Drive Failure: (Raid-1 is better)
    Raid-5 will perform horrible if one drive goes down, it can take even days to build up the lost drive if big volume. Where as in case of Raid-1 there will be NO performance impact if 1 drives is down, and buildup is also very very fast.

    My two cents :)

  7. Escolha seu servidor | CFGIGOLÔ Says:

    [...] básico de como configurar seu(s) servidor(es): Choosing Your Server: Web Servers. Vale a pena para aqueles que estão pensando em sair de uma hospedagem compartilhada e partir para [...]

  8. Erik Rodriguez Says:

    I’d go with RAID1 as well. If you really need the storage space, attach a NAS, SAN, or iSCSI device. Local storage is dead these days.

Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

 
 

Dedicated Servers

Managed Hosting

Colocation

Business Solutions

Why The Planet?

Contact Us