Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

APC Cache use only 32M memory

Here my config

extension = apc.so

apc.enabled = 1
apc.shm_size = 128M
apc.shm_segments = 1
apc.gc_ttl = 7200
apc.ttl = 0
apc.num_files_hint = 1024
apc.file_update_protection = 2
apc.max_file_size = 5M
apc.stat_ctime = 1
apc.mmap_file_mask=/tmp/apc.XXXXXX

apc.filter="-/usr/share/phpMyAdmin/.*"

APC INFO: APC Version 3.1.3p1 PHP Version 5.3.3 APC Host .._._ (mysite.com) (127.0.0.1) Server Software Apache/2.2.15 (CentOS) Shared Memory 1 Segment(s) with 30.0 MBytes (mmap memory, pthread mutex locking)

Runtime Settings apc.shm_size 128M

[[email protected] ~]# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.tcp_syncookies = 1
kernel.shmmax = 134217728

What i must do to increase APC memory?

like image 417
tarlyun Avatar asked Dec 28 '11 08:12

tarlyun


3 Answers

Have a look at the manual: https://www.php.net/manual/en/apcu.configuration.php, furthermore, note the difference between size and maximum size.

like image 168
The Nail Avatar answered Sep 22 '22 08:09

The Nail


It seems , at least in my case , that for this to work I have to add it to apcu.ini found in mods-available php folder(depending on version used) like this :

extension=apcu.so
apc.shm_size = "64M"
like image 40
jirarium Avatar answered Sep 23 '22 08:09

jirarium


I'll repeat the solution here (because it was listed as a comment of the accepted solution):

You might need to remove the "M" from the apc.shm_size configuration value. The number is expected to be in megabytes, and some php versions will fail to parse the value and revert to the default (30 or 32 MB) if the given value is not a number.

like image 1
T0xicCode Avatar answered Sep 24 '22 08:09

T0xicCode