Thread: What is better?

    #1
  1. No Profile Picture
    ExPulse
    Guest
    Devshed Newbie (0 - 499 posts)
    We are upgrading our servers and I am wondering what is better, two servers (PII 300 196M RAM and 64M RAM 8+ Gig IDE Drive, 10/100Mbs Ethernet Card) one running MySQL and the other Apache and PHP3 or just one more powerful server (PII 350, 256M SDRAM, 2 8+ Gig SCSI HDs, 10/100Mbs Nic Card)
    running MySQL, Apache and PHP3? The MySQL server get 1400 000 questions/day and crashes around 5 time/day... Cost doesn't matter I just wan't to know which of these two configurations will be faster and more efficient...
    Any other tips would be helpful. Thanks in advanced
  2. #2
  3. No Profile Picture
    jpenix
    Guest
    Devshed Newbie (0 - 499 posts)
    In your situation, I'd go for the two slightly less powerful servers and split the workload. One dedicated to MySQL and the other Apache/PHP. A number of advantages:

    If MySQL is chewing all processor cycles, at least your web site's static pages will still seem snappy.

    If MySQL does crash its server, your site isn't entirely down - just the backend. Well, unless you're serving all pages out of MySQL then it wouldn't matter.

    If you have a number of queries inside PHP loops, PHP will chew up memory tracking the result id's until the script is done. (This is resolved in PHP4). If you have separate servers, PHP won't be taking memory away from MySQL.

    In the case of hardware failure, you could have the servers configured to take over each other's duty if necessary (tho' at a hobbled pace).

    In your listed configurations, the memory pool of the two servers combined is greater than the single server. This gives all processes more room to breathe.

    As far as I'm concerned, for mission critical duties, it's best to have as few processes as possible running on each server. Keeps possible conflicts/buggy code from being an issue.

    I'd also recommend watching 'top' or some other Unix resource reporting utility to get an idea of what's happening when MySQL brings the whole server down. See if you're running out of swap space, or if a particular process is pegging the server utilization, etc.

    Good luck! Let us know what you decide...
  4. #3
  5. No Profile Picture
    ExPulse
    Guest
    Devshed Newbie (0 - 499 posts)
    Thanks for the reply jpenix.

    99% of our pages are out of MySQL but aleast I will be able to display and error page if MySQL goes down.

    I just checked 'TOP' and here is what I got...

    12:56am up 2 days, 4:48, 3 users, load average: 1.89, 1.90, 1.79
    154 processes: 150 sleeping, 4 running, 0 zombie, 0 stopped
    CPU states: 37.6% user, 24.5% system, 47.0% nice, 39.3% idle
    Mem: 192424K av, 182656K used, 9768K free, 101024K shrd, 63260K buff
    Swap: 128484K av, 36K used, 128448K free 63956K cached

    NOTE: This is not close to peak time...
    I should also say that MySQL does not crash the server it just stops responding for 10 - 15 x 5times a day...
  6. #4
  7. No Profile Picture
    jpenix
    Guest
    Devshed Newbie (0 - 499 posts)
    Wow, I've never heard of MySQL going off into La La Land for 10-15 min at a time...

    Your TOP printout looks pretty normal. Swap space doesn't appear to be a problem, tho' I'd keep an eye on that statistic as peak time approaches and see what happens to it.

    Also when MySQL does decide to take a vacation, take a look at the list of processes that prints out below the headers you posted and see which processes are sucking up the resources.

    TOP doesn't take much in the way of resources to keep running - I'd recommend leaving it open in a terminal session. Then when something goes awry, run over and look at it. After doing this a few times, as well as periodically checking it throughout the day, you should get a pretty good picture of what's causing your troubles.
  8. #5
  9. No Profile Picture
    newmediaarts
    Guest
    Devshed Newbie (0 - 499 posts)
    I'm working on a similar situation, serving a mysql database that recieves in the neighborhood of 500,000 to 750,000 queries daily. The project required massive amounts of expansion capabilities, which may or may not be like your situation, we choose to go with a dual PIII Xeon 500mhz, with 512mb RAM, (4) 10,000RPM UW2 SCSI drives, and a RAID solution from Mylex, and a 50/100gig tape drive.

    With the server fully configured (using linux) it has been benchmarked as being capable of serving 1,600,000 queries daily with 32% processor usage (you never want to go above 50% as an average).

    The RAID also allows us to minimize the servers drive wait times (the drives duplicate data to create the effect of a multi-spindle drive -- 3ms seek times) if we lose a single drive the others kick in to take over and no data is lost. Simply replace the bad harddrive and the system redistributes the data
    I would really recommend going with the bigger single server as most of your processes will be in MySQL anyway, and it seems to be a waste of a server just running apache on the first system.

    Just my thoughts...

    ------------------
    Luke Bowerman
    new media arts
    www.judebowerman.com/nma


    [This message has been edited by newmediaarts (edited 07-27-99).]

IMN logo majestic logo threadwatch logo seochat tools logo