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.
So firstly I got the PHP 5.3 compiled in as a DSO (apache module).
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)
All seemed fine and phpinfo showed apc loaded and enabled.
Then I checked with apc.php. All seemed OK
But as I started testing my php application, the stats in apc for File Cache Information state:
Cached Files 0 ( 0.0 Bytes)
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
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.
But the user cache is functioning fine.
User Cache Information
Cached Variables 0 ( 0.0 Bytes)
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
Its actually from an APC caching test script which tries to retrieve and store 1000 entries and gives me the times. A sort of simple benchmark.
Can anyone help me here.
Even though apc.cache_by_default = 1, no php files are being cached.
This is my apc config
apc.rfc1867 0 apc.rfc1867_freq 0
Also most php files are under 20KB, thus, apc.max_file_size = 1M is not the cause.
I have also tried using 'apc_compile_file ' to force some files into opcode cache with no luck. I have also re-installed APC with Debugging enabled, but nothing shows in the error_log
I have also tried setting mmap_file_mask to /dev/zero and /tmp/apc.xxxxxx, i have also set /tmp permissions to 777 to no avail
Any clue anyone.
Update: I have tried following things and none cause APC file cache to populate
1. set apc.enable_cli = 1 AND run a script from cli
2. Set apc.max_file_size = 5M (just in case)
3. switched php handler from dso to FastCGI in WHM (then switched it back to dso as it did not solve the problem)
4. Even tried restarting the container