apc

APC cache fragmentation problem

依然范特西╮ 提交于 2019-12-05 16:00:47
I'm running APC (php cache) on a medium website (13 000 visits a day) on a CentOS server 5 running php 5.3.3 with APC 3.1.4 with 4Gb of RAM. In the last weeks I'm experiencing many " unable to allocate memory for pool " errors in logs, and often the site goes down. I think the problem is in APC. From the stats I see that the cache is full after an hour or two, and the fragmentation always jumps to 100%. This are my config settings of apc.ini: apc.cache_by_default 1 apc.canonicalize 0 apc.coredump_unmap 0 apc.enable_cli 0 apc.enabled 1 apc.file_md5 0 apc.file_update_protection 2 apc.filters apc

Symfony / PHP7 APC -> APCu

这一生的挚爱 提交于 2019-12-05 15:18:41
问题 I have issue with PHP7 and APCu. After installation I got this error: Fatal error: Call to undefined function Doctrine\Common\Cache\apc_fetch() APCu is 100% enabled, I see it in the phpinfo(); And when I try apcu_fetch() it works. How to use APCu in Symfony 2.8? 回答1: This answer is obsolet. The correct answer is the one from François Breton. In PHP 7 you have to add an additional module to your PHP setup: apc.so This is a module that enables backward compability to apc for apcu. This is kind

APC doesn't cache files, but caches user data

点点圈 提交于 2019-12-05 12:17:10
Apc doesn't cache files, it only caches user data . When I tested on localhost, APC cached all files I used. But it doesn't work on my shared hosting. Is this a configuration issue? These are the stats from my apc.php (APC 3.0.19): On the above picture, APC doesn't use any memory. This is what phpinfo() gives me: On localhost, i only access http://localhost/test.php . Apc will cache localhost/test.php ( type file ) imediately. but on shared host, i don't see it cache file ( it can cache variable, if i store but don't with file ); apc_add('APC TEST', '123'); echo apc_fetch('APC TEST'); //-- it

APC Hits/Misses and configuration

戏子无情 提交于 2019-12-05 09:04:21
What are "Hits & Misses" in reference to APC opcode caching? I've installed APC and it's running great, but I've got "some" misses and I'm wondering if that's "bad". Also, I am running Openx and, as such, am filling up the "Cache full count(s)" pretty quickly. What do I need to change in the configuration to minimize that? Any recommended configurations? Justin Some misses are to be expected. Hits = things are in cache Miss = things not (yet) in cache. New or less-used things will always be a miss, so you'll always expect some. You may need to tune how much memory you're dedicating to APC -

APC File Cache not working but user cache is fine

纵饮孤独 提交于 2019-12-05 02:22:06
问题 Summary: I have PHP(5.3.8) installed as an Apache Module, and installed APC via PECL. The User cache is working fine but the File Cache is not working ( I do have apc.cache_by_default set to 1 so that's not the issue) Detail: I have just got a VPS (with cPanel/WHM) to test what gains i could get in my application with using apc file cache AND user cache. So I got the PHP 5.3 compiled in as a DSO (apache module). Then installed APC via PECL through SSH. (First I tried with WHM Module installer

sudo pecl install apc error on os x lion

一曲冷凌霜 提交于 2019-12-05 00:02:30
I tried installing APC with pecl on OS X Lion ( sudo pecl install apc ) and it complained about a missing pcre.h file: In file included from /private/tmp/pear/temp/APC/apc.c:44: /usr/include/php/ext/pcre/php_pcre.h:29:10: fatal error: 'pcre.h' file not found #include "pcre.h" So I used MacPorts to install the pcre package ( sudo port install pcre ) but it still complains. How can I fix this? I think this is because MacPorts installs the header files in a different location from where pecl expects them. To fix this error, I symlinked pcre.h to /usr/include : sudo ln -s /opt/local/include/pcre.h

apc.filters by path?

不羁岁月 提交于 2019-12-04 21:53:15
问题 How would I use the apc.filters parameter in APC opcode caching to not cache certain paths? For example, I want caching to be active for anything under the path: "/var/www/vhosts" and exclude paths like "/usr/share/psa-horde/" I tried using apc.cache_by_default = 0 apc.filters = "+/var/www/vhosts" and apc.cache_by_default = 1 apc.filters = "-/usr/share/psa-horde/" But neither worked as I expected. http://www.php.net/manual/en/apc.configuration.php#ini.apc.filters Should the filter be

How install apcu as php7 extension on debian

一世执手 提交于 2019-12-04 16:43:18
问题 I have seen this tutorial for ubuntu. http://thereluctantdeveloper.com/2015/12/quick-and-dirty-php-70-set-up-on-ubuntu-1404-with-apcu It's not clear for me after step(git clone). I need apcu extension for my app to perform faster. Please guide to install apcu extension for php 7 on debian. 回答1: First, I'm assuming you installed PHP7 using the DotDeb APT Repository. If not, this is how you should install it. Once PHP7 is installed and working properly, and assuming there are no other versions

Cannot instantiate abstract class … in appDevDebugProjectContainer.php - Symfony2

柔情痞子 提交于 2019-12-04 16:23:28
I have just installed yesterday apc and I am now getting this error: FatalErrorException: Error: Cannot instantiate abstract class ACME\WebBundle\Menu\MenuBuilder in /var/www/app/cache/dev/appDevDebugProjectContainer.php line 743 and in that line there is: protected function getEposMain_MenuBuilderService() { return $this->services['epos_main.menu_builder'] = new \ACME\WebBundle\Menu\MenuBuilder($this->get('knp_menu.factory')); } Does any one know what does it mean and what I can do with it? services.yml services: epos_main.menu_builder: class: ACME\WebBundle\Menu\MenuBuilder arguments: ["@knp

Can APC improve the speed of CLI scripts when used with pcntl_fork()?

给你一囗甜甜゛ 提交于 2019-12-04 14:14:43
问题 APC works by storing the opcodes from PHP files in shared memory. When PHP is used with a web server (eg Apache) then the shared memory has a long life. When called from the commandline, then the APC cache is created and destroyed for each process. APC is disabled on the commadnline by default, probably due to this. I have a theory that there will be benefits from using APC if a PHP process is forked (with pcntl_fork() as presumably the same opcode cache can be used. This may only apply to