I want to use APC in a shared environment, but the main problem is of course, opcode sharing.
To overcome this, I've thought about using different apc.mmap_file_mask for each user (they're chrooted through php-fpm), so the "file" created by APC would not be shared, but would be personal to the user.
Of course, I've noticed I'm wrong for serveral reasons... and the biggest one is about "What does really do apc.mmap_file_mask?": I've thought it was like a pointer to the memory region used by APC, but i'm not that sure about it.
And, of course, there is no file in the path I've used (/tmp/apc.XXXXXX): no file on the machine's /tmp, and no file in the chrooted environment's (/home/vhosts/0001/tmp).
So, what does really do apc.mmap_file_mask?
My actual configuration is:
apc.mmap_file_mask = /tmp/apc.XXXXXX apc.num_files_hint = 2048 apc.max_file_size = 10M apc.ttl = 7200
I've already checked what happens with phpinfo(), and it doesn't translate the value: it still gives me
/tmp/apc.XXXXXX (but apc.php says the cache was hit and I have better timing values... thus it is working).