Results 1 to 1 of 1

Thread: Changes required on "Installing Alternative PHP Cache (APC)"

  1. #1
    Join Date
    Jul 2011

    Changes required on "Installing Alternative PHP Cache (APC)"

    I installed APC cache using this help :

    It recomend to use APC with these parameters :

    Using 128M is very low, especially with a TTL of 7200. After some minutes you'll get error :
    Warning: require_once() [function.require-once]: Unable to allocate memory for pool. in /path/to/file

    If TTL is set to 0 this error don't show, but APC won't be efficient as it will flush the whole cache when it run out of memory.

    32Mb was ok for old style websites with simple php scripts, but nowadays CMS are huge php solutions with hundred files and complex code. A single installation of Wordpress require more than 20MB of cache, Magento more than 50MB.
    On my server with ~30 Wordpress, 2 Joomla and 6 Magento, APC is using 1.2GB out of 2Gb allocated (just code cache, no user cache is used)

    APC is about using memory to save CPU cycles. Most servers with APC have low amount of memory dedicated to APC so it have to flush it's cache every minutes. It's worse than not having APC at all.

    I think this should be added :
    To find the amount of memory required on your server, download extract apc.php, host it on your server and watch it. There you have a nice diagram how your cache usage look like. You should allow enough memory to APC so it has 10%-20% free after few hours running (so all pages have been cached). Opcode is times bigger than PHP source code, APC could require GBs of ram on shared servers.

    APC could use either SHM or MMAP memory. Both are set with the apc.shm_size option.
    Size of Shared segments (SHM) is limited by the OS if you can't increase it, increase the number of segment with apc.shm_segments.

    Big scripts like Magento require to increase the max file size to 20MB (apc.max_file_size=20M)
    Last edited by bokan; 08-29-2012 at 02:14 AM.

Similar Threads

  1. Replies: 7
    Last Post: 08-23-2019, 03:19 AM
  2. FR: Show "account suspended" on login in stead of "failed username/password"
    By myH2Oservers in forum Feedback & Feature Requests
    Replies: 3
    Last Post: 10-20-2010, 12:46 PM
  3. Get "Cannot assign requested address" when installing
    By WetWired in forum Installation / System Requirements
    Replies: 1
    Last Post: 08-29-2005, 05:25 PM
  4. "domain user" - "user" - "reseller" - "admin"
    By mmerlin in forum DirectAdmin General Discussion
    Replies: 1
    Last Post: 10-22-2004, 12:05 PM
  5. Problem after installing "Hermes" skin
    By 113345 in forum DirectAdmin General Discussion
    Replies: 4
    Last Post: 05-31-2004, 04:50 AM

Tags for this Thread

Posting Permissions

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