Answer the question
In order to leave comments, you need to log in
Where does opcache store the cache?
Tell me please, where is the cached data stored with the default scheme (mmap)?
The fact is that the amount of memory consumed by apache processes does not change in any way, even when there are already more than 500 MB of data in the cache.
With shm it is clear, you can view the segments and their fullness yourself, but with mmap it is not clear.
PS php works as an apache module.
Answer the question
In order to leave comments, you need to log in
mmap - something like a file in RAM (memory-mapped files) here are the sources
In RAM.
Memory is allocated in one big chunk when php starts. You have 500MB used from the available space.
In programming, alas, not strong.
Those. yet apache processes should keep this cache if PHP is a module?
The master (the one from root) eats 33 MB of physical memory at startup, all workers (spare) from www-data are about 17 MB.
A process that is launched directly when a script is executed consumes memory in proportion to the heaviness of the script itself, and hit in the cache is counted (i.e. the data is taken from somewhere).
Actually, how can you still see this cache at the system level without using shm?
I looked at the processes using pmap, there is one segment, equal in size to the size of the cache.
On the master:
Kbytes RSS Dirty Mode Mapping
524288 6012 6012 rw-s- zero
On the workers, it's completely empty:
524288 0 0 rw-s- zero
In opcache statistics it shows that all 512 MB are occupied.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question