Note that there are some explanatory texts on larger screens.

plurals
  1. POAPC File Cache not working but user cache is fine
    primarykey
    data
    text
    <p><strong>Summary:</strong> I have PHP(5.3.8) installed as an Apache Module, and installed APC via PECL. The User cache is working fine but the File Cache is not working ( I do have apc.cache_by_default set to 1 so that's not the issue)</p> <p><strong>Detail:</strong> I have just got a VPS (with cPanel/WHM) to test what gains i could get in my application with using apc file cache AND user cache. </p> <p>So I got the PHP 5.3 compiled in as a DSO (apache module).</p> <p>Then installed APC via PECL through SSH. (First I tried with WHM Module installer, it also had the same problem, so I tried it via ssh)</p> <p>All seemed fine and phpinfo showed apc loaded and enabled.</p> <p>Then I checked with apc.php. All seemed OK</p> <p>But as I started testing my php application, the stats in apc for File Cache Information state:</p> <pre><code>Cached Files 0 ( 0.0 Bytes) Hits 1 Misses 0 Request Rate (hits, misses) 0.00 cache requests/second Hit Rate 0.00 cache requests/second Miss Rate 0.00 cache requests/second Insert Rate 0.00 cache requests/second Cache full count 0 </code></pre> <p>Which meant no PHP files were being cached, even though I had browsed through over 10 PHP files having multiple includes. So there must have been some Cached Files.</p> <p>But the user cache is functioning fine. </p> <pre><code>User Cache Information Cached Variables 0 ( 0.0 Bytes) Hits 1000 Misses 1000 Request Rate (hits, misses) 0.84 cache requests/second Hit Rate 0.42 cache requests/second Miss Rate 0.42 cache requests/second Insert Rate 0.84 cache requests/second Cache full count 0 </code></pre> <p>The above user cache output is from an APC caching test script which tries to retrieve and store 1000 entries and gives me the times. A sort of simple benchmark.</p> <p>Can anyone help me here.<br> Even though apc.cache_by_default = 1, no php files are being cached.</p> <p>This is <strong>my apc config</strong> </p> <pre><code>Runtime Settings apc.cache_by_default 1 apc.canonicalize 1 apc.coredump_unmap 0 apc.enable_cli 0 apc.enabled 1 apc.file_md5 0 apc.file_update_protection 2 apc.filters apc.gc_ttl 3600 apc.include_once_override 0 apc.lazy_classes 0 apc.lazy_functions 0 apc.max_file_size 1M apc.mmap_file_mask apc.num_files_hint 1000 apc.preload_path apc.report_autofilter 0 apc.rfc1867 0 apc.rfc1867_freq 0 apc.rfc1867_name APC_UPLOAD_PROGRESS apc.rfc1867_prefix upload_ apc.rfc1867_ttl 3600 apc.serializer default apc.shm_segments 1 apc.shm_size 32M apc.slam_defense 1 apc.stat 1 apc.stat_ctime 0 apc.ttl 0 apc.use_request_time 1 apc.user_entries_hint 4096 apc.user_ttl 0 apc.write_lock 1 </code></pre> <p>Also most php files are under 20KB, thus, apc.max_file_size = 1M is not the cause.</p> <p>I've tried following things with no luck.</p> <ol> <li>Using 'apc_compile_file ' to force some files into opcode cache with no luck. </li> <li>re-installed APC with Debugging enabled, but nothing shows in the error_log </li> <li>setting mmap_file_mask to /dev/zero and /tmp/apc.xxxxxx, i have also set /tmp permissions to 777 to no avail </li> <li>set apc.enable_cli = 1 AND run a script from cli </li> <li>Set apc.max_file_size = 5M (just in case) </li> <li>switched php handler from dso to FastCGI in WHM (then switched it back to dso as it did not solve the problem) </li> <li>Even tried restarting the container </li> </ol> <p>Any clue anyone.</p> <p><strong>Note:</strong> I had posted the question on serverfault.com but did not get much views or an answer so I'm posting here (as stackoverflow seems to be more active and I have only got 1 month to test my VPS and see if it is of any use over shared)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload