View Poll Results: CPU versus RAm Usage Scenario

Voters
15. You may not vote on this poll
  • Server Load: 0.05 / Memory Used 35%

    12 80.00%
  • Server Load: 0.30 / Memory Used 20%

    3 20.00%
Results 1 to 18 of 18
  1. #1
    Join Date
    Sep 2005
    Posts
    480

    CPU versus RAM Usage Scenarios

    For a server with Xeon 3060 + 2 Gigs of RAM, which setup result would you choose to run at?

    This is the normal load. At peak times, they would be more like:

    Server Load: 0.07 / Memory Used 50%
    Server Load: 0.40 / Memory Used 30%

    Would a slightly higher CPU load be a better choice than having 50% of RAM used? We can choose either scenario based on installing eAccelerator, a PHP cacher.
    Last edited by mealto; 05-05-2008 at 01:58 PM.

  2. #2
    Join Date
    Mar 2008
    Location
    Miami, FL
    Posts
    40
    From a provider standpoint, Choice A (less server load means more clock cycles for other customers).

    From a customer/user standpoint, B (more RAM to run other stuff).
    <<please see forum rules for signature formatting guidelines>>

  3. #3
    Join Date
    Nov 2001
    Location
    Philadelphia, Pa
    Posts
    949
    If you've got 80% ram free, you're not getting the most out of your resources. Something could be cached with that ram. Whether it's something like memcached to prevent hits on the database, or something like apc to lessen the load on the cpu, or squid to cache frequently used images and prevent disk access, there's better uses of the ram.

  4. #4
    Join Date
    Sep 2005
    Posts
    480
    Thanks for the replies. The unused Ram is reserved for when the server gets peak traffic. It can go as high as 75% when there is a big rush of users coming to the website.

    We noticed that with eaccelerator caching files & scripts, the server uses less Ram but has slightly higher CPU loads. But page load is much faster. Hence the question here.

    Going from Ram 35% to 20% seems like a better setup even though CPU went 0.05 to 0.30. Is that a worthwhile trade off given the amount of CPU increase results in freeing 10-15% of Ram?

    Which scenario would be better for keeping the server functional when a massive spike of users hit the server? Which would you choose?
    Last edited by mealto; 05-05-2008 at 03:59 PM.

  5. #5
    Join Date
    Feb 2004
    Location
    UK
    Posts
    1,429
    I would choose a lower load, for normal Cpanel hosting 2 gig is more than enough, and as your client base gets bigger you could then make the decision to get another server or upgrade RAM.

    Hope that helps.

  6. #6
    Join Date
    Jul 2003
    Location
    Goleta, CA
    Posts
    5,550
    I would go with whichever provides the most responsive and therefore better customer experience, sometimes it may be CPU others it may be RAM.
    Patron: I'd like my free lunch please.
    Cafe Manager: Free lunch? Did you read the fine print stating it was an April Fool's joke.
    Patron: I read the same way I listen, I ignore the parts I don't agree with. I'm suing you for false advertising.
    Cafe Owner: Is our lawyer still working pro bono?

  7. #7
    Join Date
    Sep 2005
    Posts
    480
    So it sounds like even the small increase in CPU load is not as desirable. I would have thought the CPU load going form 0.05 to 0.30 is well worth it given that RAM usage dropped by quite a bit and page load is noticeably faster. Any more thoughts?

  8. #8
    Join Date
    Apr 2002
    Posts
    930
    Quote Originally Posted by mealto View Post
    So it sounds like even the small increase in CPU load is not as desirable. I would have thought the CPU load going form 0.05 to 0.30 is well worth it given that RAM usage dropped by quite a bit and page load is noticeably faster. Any more thoughts?
    I would go with the one that uses less memory. Are you saying that those load averages are during peak usage? If so, there is really just no noticeable difference between a load of 0.07 and 0.40.

    Quote Originally Posted by cywkevin View Post
    I would go with whichever provides the most responsive and therefore better customer experience, sometimes it may be CPU others it may be RAM.
    Load average is put under a lot of scrutiny and it really doesn't amount to all that much. Just because a server has a high load doesn't necessarily mean its performing badly. This doesn't mean that a lower load average isn't desirable, its just that it seems a lot of people put a lot of weight into the load average, when you really just have to look at performance.

    A server that has a load average of 10.13 might load a particular webpage in 4 seconds. A server that has a load average of 0.04 might load that same webpage in 3 seconds. Is there a performance drop off? Yes, but is it really noticeable? Probably not. You would just really have to see which performs better.

    (A server that keeps a 10.13 load average is probably not performing too well, I just used it as an example for a particular period of time. No server is going to have a 0.00 load average -- unless nobody is using it -- so all servers are going to exhibit a load, it just depends on where you feel comfortable with this)

  9. #9
    Join Date
    Sep 2005
    Posts
    480
    Thanks for your thoughts Sparek. That's why I was a little surprised to see a few responses about going with the lower CPU load and all votes (3 so far) choosing to go with this as well. I am leaning towards going with a slightly higher CPU load as it decrease Ram usage significantly and pageloads are faster. In fact, this is a side effect of installing and running eAccelerator.

  10. #10
    Join Date
    Dec 2006
    Posts
    477
    I would go with eaccelerator enabled. Assuming you are using apache 2 and the default prefork MPM, you should also look at switching to the worker MPM. This will reduce the amount by which memory usage increases when the site gets busier.

  11. #11
    Join Date
    Sep 2005
    Posts
    480
    We still have not upgraded to Apache 2 yet. Are there other similar tweaks for pre Apache 2?

  12. #12
    Join Date
    Dec 2006
    Posts
    477
    no, apache 1.3 only has the prefork option, so becomes a memory hog under heavy use.

  13. #13
    Join Date
    Oct 2005
    Posts
    289
    Note that in the long run, it's easier to add memory than to add CPU.
    A load average of less than 1.00 indicates under-utilization of a CPU.
    See http://en.wikipedia.org/wiki/Load_average as well. You might also want to measure what's increasing the load average. In most systems, IO is a very real bottleneck. Check your IO-wait.

  14. #14
    Join Date
    Dec 2000
    Location
    The Woodlands, Tx
    Posts
    5,962
    Kinda goin with cyg here, I noted how the OP was equating 0.05 to 0.30 to 5% and 30%. 1.0 is 1.0% although some would argue that is actually 10%. However, I have seen server loads hit 300+. Theres a lot of disagreement on what the %'s in load averages mean. Personally I just go with 1.0=1.0 simple math.

    If you are doing only .05 to .30 you have nothing to worry about. You cpu is waaay underused.

  15. #15
    Join Date
    Sep 2005
    Posts
    480
    So if CPU is under used (staying under 0.5 except for backups, stats updates, etc...), then going with the higher CPU load and saving some Ram must be the way to go right gang? That will save th Ram for peak usage when Ram can jump to 75% when CPU is still below 1. Does that sound right?

  16. #16
    Join Date
    Jan 2004
    Location
    Oztrayla Mate!
    Posts
    572
    I would be inclined to trade the .25 CPU for the extra 15% RAM.

    The 15% is a decent slice of resources, but i feel the .25 CPU is negliable in the scheme of things.
    Great Host = WiredTree.com Managed VPS Hosting

  17. #17
    Join Date
    Dec 2006
    Posts
    477
    No, I'd still go with the extra RAM use, as neither one of them is approaching critical and installing eaccelerator will give you faster page loads all of the time.

    P.s. Have you tuned the size of the opcode cache you allocating with eacellerator - a larger cache will bring more speed benefit, but a smaller one will still bring some benefit, especially if you don't have many different PHP pages frequently hit on the server, and will reduce the RAM consumed.

  18. #18
    Join Date
    Sep 2005
    Posts
    480
    At the moment, we are running 32 Megs of Ram on eAccelerator and getting faster page loads. The problem is, even our php includes (of static files) is getting cached. That's not such a big issue but I see our forums is getting cached (which is a waste for us since the forum is not that active as compared to other parts of the website). Maybe we should go up to 64 Megs and monitor performance.

    In any case, we are going with the 0.25 higher cpu load and 15% less Ram setup. Reason being, when we get hit hard with users, Ram goes up to 75% while CPU is still relatively low.

    We have set eA to remove scripts if it has not been used for 24 hours but it does not seem to stick. In fact, we can't get the filter to work so we can filter the forums and other less important sections of our site. Any one get this to work?

Posting Permissions

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