SitePoint Sponsor

User Tag List

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

    APC (Alternative PHP Cache) fragmentation. How much is too much?

    I've installed APC with 64MB of memory. These are my current memory stats:
    Free memory: 18.4 MBytes (28.7%)
    Used memory: 45.6 MBytes (71.3%)

    And fragmentation is:
    Fragmentation: 8.49% (1.6 MBytes out of 18.4 MBytes in 134 fragments)

    Is the fragmentation and free/used memory ratio good, bad, normal?

    Surprisingly, I haven't been able to find any documentation or recommendations regarding any of the stats to give an idea of what constitutes good, bad, or average performance.

    Also, for APC users, is there a recommendation about the need to reset the cache? Right now, the TTL (time to live) for old, cached files is 2 hours. Afterwards, old cached files are purged. This helps slightly with fragmentation and memory release, but perhaps it needs to be set to 1 hour?

    Perhaps I need to flush the entire cache nightly by restarting the web server?

  2. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    This is on RAM correct? Fragmentation is not a problem in RAM. It does not function like a mechanical HDD. So that issue you really don't need to worry about. There is no need to restart the server nightly. You need to configure the TTL for how long the data needs to remain, how long you need it to stay there and no longer. This setting is depended on your application needs.

    BTW, are you experiencing performance issues, is that the reason for the inquiry?
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  3. #3
    SitePoint Addict
    Join Date
    Jun 2005
    Posts
    262
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by logic_earth View Post
    This is on RAM correct? Fragmentation is not a problem in RAM. It does not function like a mechanical HDD. So that issue you really don't need to worry about.
    Correct, memory/RAM fragmentation. I'm wondering if 8.49% fragmentation is too high which would result in less optimal cache performance.

  4. #4
    SitePoint Evangelist
    Join Date
    Jun 2006
    Location
    Wigan, Lancashire. UK
    Posts
    523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by champ View Post
    Correct, memory/RAM fragmentation. I'm wondering if 8.49% fragmentation is too high which would result in less optimal cache performance.
    It's less optimal, but not seriously so. You're unlikely to notice any deterioration of performance at all in reading data... but fragmentation can be problematic if you're trying to store several large blocks of data in APC because you need contiguous blocks for storing.
    ---
    Development Projects:
    PHPExcel
    PHPPowerPoint


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
  •