|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-07-22 11:57 UTC] kurtubba at gmail dot com
Description:
------------
using APC with Lighttpd and fcgi; APC is creating more segments so that changing entries on APC user cache would result having different values for every process, I couldn't discover that on my development server but on a high loaded server it creates over 5 different values
Reproduce code:
---------------
#####lighttpd config
fastcgi.server = ( ".php" => ((
"socket" => "/tmp/php.socket-1",
"bin-path" => var.phppath,
"idle-timeout" => 5,
"min-procs" => 1,
"max-procs" => 15,
))
)
#####APC config
extension_dir = /usr/local/lib/
extension = apc.so
apc.shm_segments = 1
apc.shm_size = 1000
apc.ttl = 7200
apc.user_ttl = 7200
apc.num_files_hint = 3000
apc.max_file_size = 2M
apc.stat = 0
apc.include_once_override = 1
apc.mmap_file_mask = /tmp/apc.XXXXXX
####APC store example
if( $apc_var=apc_fetch('var') ){
apc_store('var',array($apc_var[0],$apc_var[0]+1));
}else{
apc_store('var',array(time(),$value));
}
print_r(apc_fetch('var'));
Expected result:
----------------
array (
0 => 1184998359,
1 => 33189,
)
Actual result:
--------------
array (
0 => 1184998359,
1 => 33189,
)
###and
array (
0 => 1184998404,
1 => 9858,
)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 11:00:01 2025 UTC |
I have this problem. Whats happening is you have multiple php processes (with children) running. Each seems to have its own shared memory area. They are not linked in any way. This is causing me 2 problems, Firstly, say i allow 30mb of ram to be mapped, its multiplied by the number of fast-cgi processes running, so this is basically multiplied by 4 for my configuration. This is my pstree for lighttpd init-+-cron |-lighttpd(www-data)-+-2*[php5-cgi---php5-cgi] | `-php5-cgi---php5-cgi---pstree and that uses 120mb ram, with a 30mb segment size.