Why aren't all my files cached using op apc code?

I use APC (3.1.9) and the Zend Framework, however, only a bunch of files are cached (something like 10/400).

Do you have any ideas? I am using factory options to install debian.

EDIT: it looks like the only file that opcached is the one that I manually call with require ''; but those loaded by my autoloader are not. Any ideas?


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 1 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 

here are the screenshots of apc.php apc.php

Files that get opcached php code

And index.php (ZF), where I require files and register the autoloader in Zend_Loader_Autoloader.

opcached files

+6
source share
2 answers

For some reason, apc.cache_by_default was set to OFF, my files did not receive caching correctly, which is logical given this configuration, however, I still do not understand why the ones I manually requested were actually cached.

0
source

Probably one of the biggest drawbacks of autoload is that the op cache does not cache autoload files, as one would hope (something about autoload being runtime or including / requires compilation time. Or not. I do not state that I understand this.). More details here .

While I have never tried, I wonder if manually adding your autoload file to the cache by calling apc_compile_file () in the autoloader can solve this problem?

+1
source

Source: https://habr.com/ru/post/903981/


All Articles