"Call to undefined method" after apache reload using apc opcode cache
Asked Answered
S

0

1

we are using php5.4, apc 3.1.13 with apache2 and mod_php and have every now and then the problem that apc opcode cache seems to forget cached data after a apache reload (for example after a logrotate). This results sometimes in fatal errors with "Call to undefined method". We do not change the files in any way before the error occurs, and after an apache restart the problem is gone.

When we release a new version of our code, we have the next and the current version of our application in the filesystem and switch them via unlink the current and symlink the new version. I think this way apc adds the new opcodes (from a different location in the filesystem) to the cache and does not remove the old ones.

After some tests on a testsystem I can see that apc clears the cache after both an apache reload and apache restart. The "Call to undefined method" problems somehow sound like a fragmentation error but I really don't understand this because the cache should be empty because of the reload. I found some infos about a bug in an older apc version that should be fixed since years.

It's really hard for me to guess after how many apache reloads and applucation releases the apc ends with such a corrupt cache because I don't see a pattern. But it has definitely something to do with the apache reload.

Here is our apc.ini:

apc.enabled=1
apc.shm_size=512M
apc.num_files_hint=10000
apc.user_entries_hint=10000
apc.max_file_size=5M
apc.stat=1
apc.optimization=0
apc.shm_segments=1
apc.enable_cli=0
apc.cache_by_default=1
apc.include_once_override=0

I can see that the systems (debian) shared memory max is set to 32mb.

Stickpin answered 24/11, 2014 at 12:38 Comment(1)
hi ! Look at my issue it seems it's exactly the same one: #30781261 Glad to see I am not the only one, did you managed to resolve this issue ?Aspect

© 2022 - 2024 — McMap. All rights reserved.