Problem/Motivation
Drupal uses function_exists('apc_fetch') to detect the APCu backend.
There're two problems with that:
- The detection doesn't verify the ini settings like apc.enabled. In some environments this leads to an usage of APCu even if it's disabled which might lead to any kind of problems. => critical
- Unfortunately this also uses APC on a pure APC backend, which has a track record of not working well, because the user cache is combined with the opcode cache and such leads to strong fragmentation.
There is two things to discuss here:- Pro - enabling also for APC itself (non APCu)
- apc_fetch is still faster than the DB
- The chained fast backend can be used
- Contra
- Strong fragmentation influences the opcode cache
- That can lead to reduced file and especially class loading times
- Pro - enabling also for APC itself (non APCu)
Proposed resolution
- Use extension_loaded('apcu') to detect the APC backend only for APCu. (Likely need a helper for this somewhere, which can be configured or overridden.)
- Verify the ini settings (see comment #15)
Remaining tasks
User interface changes
API changes
Original report
Follow up to #2395143: YAML parsing is very slow, cache it with FileCache