Hi

I am getting the following error message when I enable Performance Logging module:

Performance logging APC memory size 32
APC has been configured for 32, which is less than the recommended 48 MB of memory.

How does one set the APC memory size?

Thanks

Comments

yelvington’s picture

Read the APC documentation and set the proper values in php.ini.

mattgilbert’s picture

I have this problem too, but php.ini actually had 64MB as the limit. There isn't a file on my system with a name like php.ini and "30" as the max memory size. I suspect somewhere it's being confusing with max_execution_time, which is set to "30" (no MB, same as the error report)

Edit:
Actually, found the solution here:
http://forum.webedition.de/phpBB/viewtopic.php?f=2&t=6972

Apparently you have to add this line:
apc.shm_size="64"

highermath’s picture

In most PHP installations there should be a php.d directory containing the file apc.ini. That's where you should make the change. If you simply add the directive to php.ini, and the apc.ini exists, you may get odd results.

freephile’s picture

on Ubuntu, you should see a file called /etc/php5/conf.d/apc.in
# become root
sudo su -
# append to the config file
echo 'apc.shm_size="64"' >> /etc/php5/conf.d/apc.ini
# reload apache's configuration files
apache2ctl reload

Reload your status page to check it.
http://example.com/drupal/admin/reports/status

gr33nman’s picture

Assuming you've already installed PECL uploadprogress.so using these directions,
http://drupal.org/node/456686#comment-2369292
but with ~/usr/local instead of ~/gnu,

Assuming these directories and files already exist:

~/usr/
~/usr/local
~/usr/local/bin
~/usr/local/bin/uploadprogress.so
~/usr/src
~/domain.com/cgi-bin
~/yourdomain.com/cgi-bin/php.ini
~/yourdomain.com/cgi-bin/php-wrapper.cgi

and that php-wrapper.cgi and php.ini are already set as shown here:
http://wiki.dreamhost.com/PHP.ini

Assuming .htaccess at yourdomain.com has the following lines:

#
# Custom PHP install
#
Options +ExecCGI
AddHandler php5-cgi .php
Action php-cgi /cgi-bin/php-wrapper.cgi
Action php5-cgi /cgi-bin/php-wrapper.cgi

Begin:
cd ~/usr/src
wget http://pecl.php.net/get/APC-3.0.19.tgz 

(or whatever is currently stable at http://pecl.php.net/package/APC)

tar -xzvf APC-3.0.19.tgz
cd APC-3.0.19
export PHP_PREFIX=/usr/local/php5/bin
$PHP_PREFIX/phpize
./configure -prefix=$HOME/usr/local -with-php-config=$PHP_PREFIX/php-config
make
cd modules
cp apc.so ~/usr/local/bin

cd ~/yourdomain.com/cgi-bin/

nano -w php.ini

scroll down to:

;extension_dir = "./"

add extension="apc.so" to the bottom of the extension list thus:

;extension_dir = "./"
extension_dir = /home/<user name here>/usr/local/bin
extension="uploadprogress.so"
extension="apc.so"

; limit for apc memory
apc.shm_size="64"

Save the file. Refresh your browser for the drupal status report and the apc memory message should be gone.

mkinnan’s picture

This helped me get everything squared away:

Scroll down to section 3:
http://www.howtoforge.com/apc-php5-apache2-fedora8

It tells you that you have to create your own apc.ini file at /etc/php.d/apc.ini and provides you with the necessary information.

pimok3000’s picture

simply add the recommended 64M to your php.ini file:
sudo echo 'apc.shm_size="64"' >> /etc/php5/apache2/php.ini
and reload apache.

shaiss’s picture

no matter where I set the apc.shm_size in php.ini I run apc.php and it always returns apc.shm_size=32M. I tried with and without the M. Tried creating an apc.ini and no luck.

Seems like something's overriding it. any ideas where else this setting could be configured?
sudo grep -rnw / -e "apc.shm_size" > ~/apcsize.txt just returns results from within the drupal profile php files.

mpark’s picture

use opcache instead :-)