Results 1 to 5 of 5
  1. #1

    One server or two? Apache, or lighttpd/nginx?

    I'm deploying a smartphone messaging app, which is served by an architecture that involves an email server, PHP requests, and a MySQL DB. Here are the characteristics of the server architecture:

    -Small MySQL database, using InnoDB. Entire database will fit into RAM in a 1GB buffer pool. Simple queries, mostly single table, sometimes 2-table joins. Lots of small SELECTs/INSERTs/DELETEs.
    -Data in/out of the database will be small. Each INSERT/SELECT will insert/return just a bit of text.
    -Emails in/out will all be fairly small, just a bit of text, sometimes with a <100k image.
    -PHP forms only serve to query the database, so they're fairly simple. The web service (Apache/lighttpd/nginx) will only be serving PHP forms; no other web content.

    Basically, the DB and email server will see lots of small I/O, spread more or less equally throughout the day.

    My setup is the following (LiquidWeb Smart Servers):

    Server 1 (already configured)

    -Hardware: 2x AMD Opteron 6128 (16 cores total); 16GB RAM; 4x SATA RAID10, total ~1TB
    -Software: Exim, with the mail spool on a RAM disk to maximize performance; Dovecot; ASSP Deluxe for antispam; cPanel

    Server 2 (haven't purchased/configured yet; there are a couple of options)

    -Hardware: 4x AMD Opteron 6128 (16 cores total); 64GB RAM, or 96GB RAM; 2x Crucial RealSSD 256GB in RAID1, or 8x SAS 15K RPM in RAID10, total ~1TB
    -Software: Apache, Lighttpd, or Nginx; FastCGI for PHP; MySQL 5.5+; possibly cPanel, or not

    Goal is to be able to handle 100+ queries/second, 100+ PHP requests per second, 100K+ emails per day in/out (200K+ total).

    Now that I've laid all that background....questions are these:

    1) For these needs, is it going to make much of a performance difference to run Lighttpd or Nginx in place of Apache? Replacing Apache with anything else on cPanel sounds like a pain, so if I went this route, I'd probably just not use cPanel at all. Considering all of the above, is it worth ditching Apache and cPanel to get the performance increase of a lightweight web server?

    2) On the email server, I'm running Exim with the mail spool on a RAM disk, so it should run very fast. ASSP is not resource intensive at all (much lower usage than SpamAssassin), and Dovecot is also low profile. Am I gaining much by having it on a separate server, or would I be just fine ditching it and putting everything on the more powerful server #2?

    I had thought about splitting everything into smaller servers, but I want to keep MySQL and the web service on the same box. The nature of the app means I'll have lots of quick connects/disconnects to the MySQL DB, and I want to keep them localhost in order to be as fast as possible. This leaves me with the email server and the web/DB server, but it looks like server #2 might be fast enough to just handle everything.

    Sorry for the wall of text. Any input would be greatly appreciated. Thanks!

  2. #2
    Join Date
    Apr 2009
    Do you already need that type of processing power for a new app?

  3. #3
    Lighttpd will give you a massive performance gain over Apache when serving static files. Several hundred percent, from my personal experience (running a busy entertainment website on a cluster of 5 lighttpd servers).
    For PHP, not so much. It should be a bit faster and handle more requests if you configure it right. You should have no problems serving 100+ php req/s if your lighttpd server is well configured, mysql server and queries are well optimized. I had no problems serving 200+ request/s on a medium end machine. Just make sure you set up everything right, especially config variables such as PHP_FCGI_MAX_REQUESTS, PHP_FCGI_CHILDREN, server.max-connections, server.max-fds and so on. Some early benchmarking (apache benchmark should do the job) will help you set everything right.
    Last edited by NuPagady; 04-16-2011 at 06:49 PM.

  4. #4
    Quote Originally Posted by chasebug View Post
    Do you already need that type of processing power for a new app?
    I'll also be running a considerable ad campaign, which will push downloads quite a bit (possibly 20,000 new users in a day).

    Quote Originally Posted by NuPagady
    Won't be serving any static files, so would it be worth it to run lighttpd? Could I tune Apache to give me the sort of performance that lighty can offer?

    Edit: Just saw where you mentioned I can probably handle more requests with a nicely configured lighttpd. I think I'll go that route.

    Would there be any benefit to running cPanel, since I'm ditching Apache?

    Also, would I see any benefit from going with the dual RAID1 SSDs, as opposed to the 8x RAID10 SAD array? I really shouldn't need to hit the disk much at all, at least not for the database and email queue. And the SSD setup would definitely cost me more...

    And much thanks for the info!
    Last edited by null_skills; 04-16-2011 at 06:59 PM.

  5. #5
    Quote Originally Posted by null_skills View Post
    I'll also be running a considerable ad campaign, which will push downloads quite a bit (possibly 20,000 new users in a day).
    The other major contender is Litespeed, which is a commercial product. Excellent reputation though I've only played with it a little. At those levels of concurrency, you'd need the Enterprise version.

    NGINX is designed to deal with high traffic without killing the server. I love Apache and it is a swiss army knife, but if you're serving PHP content, I personally would recommend NGINX.

    It really wouldn't be hard to benchmark. Have both servers setup and ready to go - turn Apache on and see if it works. If you run into server load issues, turn it off and try NGINX.

    I haven't used lighttpd so I can't comment.

Similar Threads

  1. nginx OR Lighttpd for cpanel shared hosting server ?
    By ttgt in forum Hosting Security and Technology
    Replies: 19
    Last Post: 03-05-2011, 11:24 PM
  2. Apache -vs- nginx -vs- lighttpd?
    By TheVisitors in forum Hosting Security and Technology
    Replies: 8
    Last Post: 02-21-2011, 12:29 AM
  3. i have ask about lighttpd or Nginx
    By islam mohamed in forum Web Hosting
    Replies: 10
    Last Post: 11-07-2010, 11:48 AM
  4. Apache vs lighttpd vs nginx
    By ryan14 in forum Hosting Security and Technology
    Replies: 18
    Last Post: 08-27-2009, 10:33 PM
  5. Requires Lighttpd expertise: Apache Rewrite Rules to Lighttpd format
    By realrena in forum Employment / Job Offers
    Replies: 2
    Last Post: 01-16-2008, 08:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts