apc

delete cache by prefix in apc / memcache / eaccelerator

烈酒焚心 提交于 2019-12-04 09:04:23
Let's assume I have these variables saved in apc, memcached and eaccelerator: article_1_0 article_1_1 article_3_2 article_3_3 article_2_4 How can I delete all cached variables that starts with article_3_ (they can reach up to 10000) ? is there any way to list the cached variables ? Arnaud Le Blanc The slow solution For APC: $iterator = new APCIterator('user', '#^article_3_#', APC_ITER_KEY); foreach($iterator as $entry_name) { apc_delete($entry_name); } For eaccelerator: foreach(eaccelerator_list_keys() as $name => $infos) { if (preg_match('#^article_3_#', $name)) { eaccelerator_rm($name); } }

Install APC on Windows

若如初见. 提交于 2019-12-04 08:23:06
问题 How can I install APC on Windows? I am using PHP 5.3, Windows 7 x64. I used pecl install apc I got C:\PHP>pecl install apc downloading APC-3.0.19.tgz ... Starting to download APC-3.0.19.tgz (115,735 bytes) ............ done: 115,735 bytes 47 source files, building WARNING: php_bin c:\php\php.exe appears to have a suffix \php.exe, but config variable php_suffix does not match running: msdev APC.dsp /MAKE "APC - Release" ERROR: Did not understand the completion status returned from msdev.exe.

Magento how to cache a productCollection

巧了我就是萌 提交于 2019-12-04 08:20:44
问题 Ive noticed my home page is taking a long time to load - over 6 seconds infact according site24x7.com, so ive been switching elements off to try and determine what is the cause, and it is down to 2 product collection files I have made to show new products and best selling products. As soon as i remove these from the home page, the page loads in less than .5 seconds. So, can anyone help with optimising and caching a productCollection? I have APC installed and running on the server, but Im not

Forcing Apache2 to use php56 from Homebrew

孤者浪人 提交于 2019-12-04 05:04:09
问题 So I started with brew reinstall php56 --with-apache This worked fine I then amended httpd.conf to include LoadModule php5_module /usr/local/opt/php56/libexec/apache2/libphp5.so But upon inspection of phpinfo its using PHP 5.6.24 which is wrong, thats the MacOS native version. The brew version is 5.6.26. For some reason my Apache2 config is being ignored - or I have amended the wrong file. The one I changed as in /etc/apche2/httpd.conf This is a follow on from my previous question related to

Symfony / PHP7 APC -> APCu

◇◆丶佛笑我妖孽 提交于 2019-12-04 01:31:35
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? Tobske 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 of confusing... See http://php.net/manual/de/apcu.installation.php for more info. If you are using

PHP and the million array baby

余生长醉 提交于 2019-12-04 01:26:57
Imagine you have the following array of integers: array(1, 2, 1, 0, 0, 1, 2, 4, 3, 2, [...] ); The integers go on up to one million entries; only instead of being hardcoded they've been pre-generated and stored in a JSON formatted file (of approximately 2MB in size). The order of these integers matters, I can't randomly generate it every time because it should be consistent and always have the same values at the same indexes. If this file is read back in PHP afterwards (e.g. using file_get_contents + json_decode ) it takes from 700 to 900ms just to get the array back — "Okay" I thought, "it's

APC is showing 100% fragmentation

我怕爱的太早我们不能终老 提交于 2019-12-03 23:08:15
APC is showing 100% fragmentation. Is this bad? Does it mean that it's not helping at all? What paths do I go down to improve situation? Thanks in advance. In my experience, yes. I had a system where APC was showing 100% fragmentation, and performance was bad. I increased APC's memory limit (to 200 MB in my case -- but we had a lot of code) enough to give it some slack room. Fragmentation dropped to zero, and IIRC, CPU usage on the server dropped by 50%. Also, make sure you're using the apc.php script that comes with APC to monitor fragmentation/utilization. We've even written a nagios check

Basics of PHP opcode cache

偶尔善良 提交于 2019-12-03 20:46:21
Currently on a very large project that I do not plan to re-use for another site, I have the site's name hardcoded into the files everywhere. Now, if I were ever to change the site name it would take a lot of effort to change that everywhere. I know the obvious solution is to just store the name as a variable or a constant, but I guess you could call it my micro-optimizing way of thinking: I always figured it would be one less thing PHP has to parse. I do realize it won't make much difference, but I just wanted to know whether using an opcode cache like APC would mean that PHP wouldn't even

Caching strategies in MVC Framework?

£可爱£侵袭症+ 提交于 2019-12-03 17:31:46
I wrote my own little PHP MVC Framework, and now Im exploring caching strategies in PHP MVC Frameworks. Im thinking about what can be cached, where and how. The framework I have is simple MVC Framework. I have front controller, that boots up application, registers class auto loading, sets up php run time directives... and at the end analyses URL and dispatches request to appropriate controller, method, action controller, how ever you want to call it. From controller, I have access to Domain Objects, and Data Mappers that can persist Domain Objects to some storage, most of the time Relation

What is best PHP Handler for APC [closed]

試著忘記壹切 提交于 2019-12-03 17:21:41
Closed . This question is opinion-based. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it can be answered with facts and citations by editing this post . Closed 6 years ago . I utilize APC for opcode in par with 4-cpu license Litespeed. What is the best PHP handler for this situation in term of performance first, and security later? Is it suphp / dso / fcgi / cgi ? (i read that DSO can leave a hole if one of the script has a bug) ? myusername@mybox [~]# /usr/local/cpanel/bin/rebuild_phpconf --available Available handlers: suphp dso