SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict
    Join Date
    Jun 2005
    Posts
    262
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    XCache and/or APC: what's the best free to used memory ratio

    I've used xcache and APC. This question isn't about which is better.

    I'm wondering if there's an optimum ratio of free to used memory. For instance, let's say I set the total memory available to 160MB, but XCache ends up using 155MB with 5MB free. Is this good, bad or neither? Should I make available enough memory so there will always be a healthy buffer of free memory? And if so, is there a free to used ratio I should hit, or an absolute number of free MB I should always try to make sure is available?

    Thanks.

  2. #2
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,094
    Mentioned
    153 Post(s)
    Tagged
    2 Thread(s)
    I would say that if the cache is constantly around 99% saturated you could do with increasing it, if it's constantly below say 70% you could do with decreasing it. Otherwise just leave it as is. Having more free space doesn't make cache faster, it just means it's hogging RAM for no reason whatsoever. RAM that could possibly be better spent on other processes.
    Rémon - Hosting Advisor

    SitePoint forums will switch to Discourse soon! Make sure you're ready for it!

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  3. #3
    SitePoint Addict
    Join Date
    Jun 2005
    Posts
    262
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi ScallioXTX,

    Thanks for your advice. I was at 160MB, and the available memory stayed around 15MB for weeks, then it steadily crept towards 4MB available memory in the past few days. I've never actually zeroed out wit OOM (out of memory) errors, but it's gotten awfully close. I was curious if there's a threshold where xcache becomes less effective the closer it is towards running out of memory.

  4. #4
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,094
    Mentioned
    153 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by champ View Post
    Hi ScallioXTX,

    Thanks for your advice. I was at 160MB, and the available memory stayed around 15MB for weeks, then it steadily crept towards 4MB available memory in the past few days. I've never actually zeroed out wit OOM (out of memory) errors, but it's gotten awfully close. I was curious if there's a threshold where xcache becomes less effective the closer it is towards running out of memory.
    It only becomes less effective when it's completely ran out of memory, because then you might get the situation where every new entry causes and old entry to be removed, and if there are enough new entries inserted and never re-requested the cache is only getting MISSes, no HITs.
    Sounds to me though like your 160MB is fine, I wouldn't touch that setting. Not for now at least.
    Rémon - Hosting Advisor

    SitePoint forums will switch to Discourse soon! Make sure you're ready for it!

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  5. #5
    SitePoint Addict
    Join Date
    Jun 2005
    Posts
    262
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ScallioXTX View Post
    It only becomes less effective when it's completely ran out of memory
    Thanks ScallioXTX. That really clears things up.


Bookmarks

Posting Permissions

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