Solved Issue getting APC Cache to use TMPFS

I'm having an issue getting APC Cache to read/write to tmpfs.

My configuration is as follows:
Code:
/etc/fstab :

# store apc cache in a 128mb ram disk
tmpfs  /tmp/apc  tmpfs  rw,size=136000000  0  0


/usr/local/etc/php.ini :

apc.mmap_file_mask=/tmp/apc/apc.XXXXXX


Filesystem  Size  Used  Avail Capacity  Mounted on
tmpfs  130M  4.0K  130M  0%  /tmp/apc

/tmp/apc directory is set to www:www (what apache runs as).

When I restart apache, I don't receive any errors but the 'Used' column never climbs up - even after viewing my wordpress blog. However, if I manually move a file in to the folder, the 'Used' column does climb up - which tells me I am doing something wrong.

Any ideas?
 
Solved: Failed to read the docs.

apc.mmap_file_mask

If compiled with MMAP support by using --enable-mmap this is the mktemp-style file_mask to pass to the mmap module for determining whether your mmap'ed memory region is going to be file-backed or shared memory backed. For straight file-backed mmap, set it to something like /tmp/apc.XXXXXX (exactly 6 Xs). To use POSIX-style shm_open/mmap put a .shm somewhere in your mask. e.g. /apc.shm.XXXXXX You can also set it to /dev/zero to use your kernel's /dev/zero interface to anonymous mmap'ed memory. Leaving it undefined will force an anonymous mmap.
 
Back
Top