apc

How big of an impact does including PHP files have on performance?

百般思念 提交于 2019-12-13 13:31:07
问题 Question pretty much states it all, I am working on a large project where most calls to php include() between 100 and 150 files. On average the time php takes is between 150 and 300 ms. I'm wondering how much of this is due to including PHP scripts? I've been thinking about running a script that checks most accessed files for particular calls and merge them into one file to speed things up, but for all I know this has zero impact. I should note that I use APC, I'm not fully aware of what APC

Caching strategies in MVC Framework?

僤鯓⒐⒋嵵緔 提交于 2019-12-13 11:51:25
问题 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

php-apcu (CGI/FastCGI) apc_fetch always return false

我是研究僧i 提交于 2019-12-13 07:24:28
问题 When using the php-apcu (https://github.com/krakjoe/apcu) extension (not apc) in a php CGI environment the stored data from apc_store are empty. Anyone has experiences on how to solve this issue? Example PHP File: test-apc.php <?php $k = 'test'; if(isset($_GET['get'])) { $result = apc_fetch($k); echo "Read entry '$k': $result"; } else if(isset($_GET['clear'])) { echo "Clear entry '$k'"; apc_clear_cache('user'); } else { apc_store($k, "HelloWord"); echo "Write entry '$k' set"; } print_r(apc

APC OpCode not working with PHP-FPM

旧城冷巷雨未停 提交于 2019-12-13 06:53:22
问题 I'm trying to get APC OpCode Cache working along with: PHP 5.4.30, APC 3.1.15-dev, and PHP-FPM PHP 5.4.30 (fpm-fcgi) However my "System Cache Entries" on my apc_stats.php is ALWAYS EMPTY I have the following configuration: * On /etc/httpd/conf.d/fastcgi.conf User apache Group apache LoadModule fastcgi_module modules/mod_fastcgi.so FastCgiWrapper Off <IfModule mod_fastcgi.c> DirectoryIndex index.html index.shtml index.cgi index.php AddHandler php5-fcgi .php Action php5-fcgi /php5-fcgi Alias

APC Uptime is very low

让人想犯罪 __ 提交于 2019-12-13 04:58:39
问题 Here is my server information : APC Version : 3.1.9 PHP Version : 5.2.17 Server : LiteSpeed PHP : DSO. cPanel : Yes. WHM : Yes. I rarely open my apc.php , i usually open it on my peak traffic, about 3-6 times a day. Most of the time i open it, uptime is low, ranged from 20 minutes to 5 hours. However i've never received any error e-mail such as when my Litespeed restarts by itself. APC memory usage is low, 10-25%. Fragmentation is low too, < 1%. Here is my APC settings. apc.cache_by_default 1

When useing PHP CLI - APC crashes apache - apc_fcntl_lock failed errno:6

梦想的初衷 提交于 2019-12-13 03:18:37
问题 I've already solved the problem, but I'll post it here for future reference and maybe it will help someone :) The Problem: After running PHP from command line with custom php.ini Apache crashes and throws this error apc_fcntl_lock failed errno:6 . My configuration: I've got easyPHP with PHP 5.3.8 and APC installed. APC works fine for my applications run by easyPHP (Apache server). I am useing Symfony2 framework and it comes out with nice code generators run from command line, for example: php

Nginx + PHP-FPM Randomly Gives 502

有些话、适合烂在心里 提交于 2019-12-13 00:56:28
问题 My site is working fine with Nginx + PHP-FPM but randomly it gives 502 error. Environment Details OS - CetnOS 6 Nginx PHP-FPM (php 5.4) APC (Code Cache APC 3.1.13 beta) Memcache (data cache) In php-fpm pm.max_children = 200 pm.start_servers = 40 pm.min_spare_servers = 30 pm.max_spare_servers = 50 pm.max_requests = 500 Also i am using TCP connection not socket. If any body has any input please update me. Thanks 回答1: Firstly reduce pm.max_children = 200 to pm.max_children = 50 . You will have

APC opcode caching on different file versions

旧时模样 提交于 2019-12-13 00:41:28
问题 We have a single server with several DIFFERENT versions of the SAME web application deployed on it. For instance : www.myserver.com rc.myserver.com alpha.myserver.com We fear that there might be collisions between versions of the same PHP Class. Do APC correctly handle this? If not, how to workaround this? Thanks for your help. 回答1: APC caches based on the path to the class, not just the class name. So as long as each of your versions have their own copy of the class you shouldn't have any

Cannot redeclare class sfconfig

我们两清 提交于 2019-12-12 16:46:09
问题 I am running Symfony (1.2.9) with PHP Version 5.2.11 on Windows XP. I have APC installed (Version 3.0.19) I can run PHP script to prove that apc is working correctly (works). However, when I try to use APC calls in a symfony action, I get this error (in the apache error.log file): [apc-error] Cannot redeclare class sfconfig Which promptly crashes Apache. I tried using the Symfony sfAPCCache wrapper, and then directly calling the apc_* functions - the result is the same. Does anyone know why

Why PHP APC cache miss in increasing all the time

◇◆丶佛笑我妖孽 提交于 2019-12-12 16:27:59
问题 I am using apc.php to check the PHP APC's stats (http://svn.php.net/viewvc/pecl/apc/trunk/apc.php) I have the following stats on a fairly busy server Cached Files 317 ( 26.3 MBytes) Hits 51483 Misses 6814 The problem is the Misses is always increasing (given a limited number of files), are there any way to check which files are missed? Another question is: The Cached Files is total consuming 26.3MBytes, does it mean every Apache child process is using 26.3MBytes? 回答1: You do know what apc