Hi,
I installed XCache a few days ago and it looks like it is configured
properly and it is loaded into PHP too. However when I visit the admin
section, I don't see anything cached. I've compared it to the demo
installation of xcache and mine looks empty. Please see the attached
screenshot.
I've never installed an opcode cacher before so I am not exactly sure if
there is a problem or not. But as I can't see anything cached, I am
slightly worried there is something wrong :)
My configuration is as follows:
--------
[xcache-common]
;; install as zend extension (recommended), normally
"$extension_dir/xcache.so"
zend_extension =
/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/xcache.so
[xcache.admin]
xcache.admin.auth = On
xcache.admin.user = "x"
xcache.admin.pass = "x"
[xcache]
; ini only settings, all the values here is default unless explained
; select low level shm/allocator scheme implemenation
xcache.shm_scheme = "mmap"
; to disable: xcache.size=0
; to enable : xcache.size=64M etc (any size > 0) and your system mmap
allows
xcache.size = 5M
; set to cpu count (cat /proc/cpuinfo |grep -c processor)
xcache.count = 1
; just a hash hints, you can always store count(items) > slots
xcache.slots = 8K
; ttl of the cache item, 0=forever
xcache.ttl = 0
; interval of gc scanning expired items, 0=no scan, other values is in
seconds
xcache.gc_interval = 0
; same as aboves but for variable cache
xcache.var_size = 5M
xcache.var_count = 1
xcache.var_slots = 8K
; default ttl
xcache.var_ttl = 0
xcache.var_maxttl = 0
xcache.var_gc_interval = 300
xcache.test = Off
; N/A for /dev/zero
xcache.readonly_protection = Off
; for *nix, xcache.mmap_path is a file path, not directory.
; Use something like "/tmp/xcache" if you want to turn on
ReadonlyProtection
; 2 group of php won't share the same /tmp/xcache
; for win32, xcache.mmap_path=anonymous map name, not file path
xcache.mmap_path = "/dev/zero"
; leave it blank(disabled) or "/tmp/phpcore/"
; make sure it's writable by php (without checking open_basedir)
xcache.coredump_directory = "/tmp/phpcore/"
; per request settings
xcache.cacher = On
xcache.stat = On
xcache.optimizer = On
[xcache.coverager]
; per request settings
; enable coverage data collecting for xcache.coveragedump_directory and
xcache_coverager_start/stop/get/clean() functions (will hurt executing
performance)
xcache.coverager = Off
; ini only settings
; make sure it's readable (care open_basedir) by coverage viewer script
; requires xcache.coverager=On
xcache.coveragedump_directory = "/tmp/phpcore/"
--------
$ php -v
PHP 5.2.4 (cli) (built: Sep 7 2007 00:29:46)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with XCache v1.2.1, Copyright (c) 2005-2007, by mOo
I specify the same php.ini in the fcgi block too so it should have the
xcache in it too.
Is there a way I can use to test whether the caching works or not?
Thanks.
on 08.09.2007 07:31
on 08.09.2007 07:37
I've attached the output of phpinfo() too, which shows the xcache..
on 11.09.2007 01:38
Willy wrote: > Hi, > > I installed XCache a few days ago and it looks like it is configured > properly and it is loaded into PHP too. However when I visit the admin > section, I don't see anything cached. I've compared it to the demo > installation of xcache and mine looks empty. Please see the attached > screenshot. > > I've never installed an opcode cacher before so I am not exactly sure if > there is a problem or not. But as I can't see anything cached, I am > slightly worried there is something wrong :) > > My configuration is as follows: > > [xcache.admin] > xcache.admin.auth = On > xcache.admin.user = "x" > xcache.admin.pass = "x" i assume you've set these values > $ php -v > PHP 5.2.4 (cli) (built: Sep 7 2007 00:29:46) > Copyright (c) 1997-2007 The PHP Group > Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies > with XCache v1.2.1, Copyright (c) 2005-2007, by mOo > > > I specify the same php.ini in the fcgi block too so it should have the > xcache in it too. > > Is there a way I can use to test whether the caching works or not? just install xcache-src/admin/ to your htdocs dir, and point your browser to it just like opening phpinfo.php. you'll be given a http auth prompt, just input the user/password you set up
on 12.09.2007 03:17
moo XCache wrote: >> >> Is there a way I can use to test whether the caching works or not? > just install xcache-src/admin/ to your htdocs dir, and point your > browser to it just like opening phpinfo.php. you'll be given a http auth > prompt, just input the user/password you set up Hello moo, Yes I have set those fields, and I can access the admin page. I've attached the output of the admin page in my first post too. ( http://forum.lighttpd.net/attachment/128/x.png ) The problem is, if you look at the screenshot, nothing seems to be cached. That is the reason I was asking if there was something missing. Thanks
on 25.11.2007 06:22
Willy wrote: > moo XCache wrote: >>> >>> Is there a way I can use to test whether the caching works or not? >> just install xcache-src/admin/ to your htdocs dir, and point your >> browser to it just like opening phpinfo.php. you'll be given a http auth >> prompt, just input the user/password you set up > > Hello moo, > > Yes I have set those fields, and I can access the admin page. I've > attached the output of the admin page in my first post too. ( > http://forum.lighttpd.net/attachment/128/x.png ) The problem is, if you > look at the screenshot, nothing seems to be cached. That is the reason I > was asking if there was something missing. > > > Thanks I have same problem, only xcache php admin files are cached like I can see in "List PHP" area of xcache admin. I am using the plugin for the vbulletin and wordpres. Any suggestion? Thank you!
on 25.11.2007 10:08
> > I have same problem, only xcache php admin files are cached like I can > see in "List PHP" area of xcache admin. > > I am using the plugin for the vbulletin and wordpres. > > Any suggestion? > > Thank you! cgi? cgi is not supported. try fastcgi or apache2handler/isapi etc
on 26.11.2007 01:37
moo XCache wrote: >> >> I have same problem, only xcache php admin files are cached like I can >> see in "List PHP" area of xcache admin. >> >> I am using the plugin for the vbulletin and wordpres. >> >> Any suggestion? >> >> Thank you! > > cgi? cgi is not supported. try fastcgi or apache2handler/isapi etc Yes, fastcgi. My host is dreamhost. In phpinfo I have this info: PHP Version 5.2.5 Server API CGI/FastCGI This program makes use of the Zend Scripting Language Engine: Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies with XCache v1.2.1, Copyright (c) 2005-2007, by mOo XCache XCache Support enabled Version 1.2.1 Modules Built cacher Readonly Protection N/A Opcode Cache enabled, 33,554,432 bytes, 2 split(s), with 8192 slots each Variable Cache enabled, 4,194,304 bytes, 1 split(s), with 8192 slots each Shared Memory Schemes malloc, mmap Directive Local Value Master Value xcache.admin.enable_auth On On xcache.cacher On On xcache.coredump_directory no value no value xcache.count 2 2 xcache.gc_interval 0 0 xcache.mmap_path /tmp/xcache /tmp/xcache xcache.readonly_protection no value no value xcache.shm_scheme mmap mmap xcache.size 32M 32M xcache.slots 8K 8K xcache.stat On On xcache.test no value no value xcache.ttl 0 0 xcache.var_count 1 1 xcache.var_gc_interval 300 300 xcache.var_maxttl 0 0 xcache.var_size 4M 4M xcache.var_slots 8K 8K xcache.var_ttl 0 0 ------------- Need more info? Thanks, cya.
on 26.11.2007 20:51
moo XCache wrote:
> pstree
$ pstree my_user
Segmentation fault (core dumped)
I don't understand what is wrong.
on 26.11.2007 22:31
testebr wrote: > moo XCache wrote: >> pstree > > $ pstree my_user > Segmentation fault (core dumped) > > I don't understand what is wrong. WORKING NOW!!!!!!!!!!!!!!!!! YEAH I find the problem. Just renaming my php binary to php.fcgi. Thank you for this amazing extension.
on 16.02.2008 04:59
testebr wrote:
> Just renaming my php binary to php.fcgi.
I'm having the same problem -- xcache starts but the admin page doesn't
show anything being cached in either PHP or Data caches. The renaming
fix above didn't work, I assume for distro-specific reasons.
* I am using FastCGI with lighty.
* php -v:
PHP 5.2.3-1ubuntu6.3 (cli) (built: Jan 10 2008 09:38:41)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with XCache v1.2.1, Copyright (c) 2005-2007, by mOo
* pstree:
...
├─lighttpd─┬─14*[lighttpd]
│ └─4*[php-cgi───4*[php-cgi]]
...
I have the feeling I am overlooking something obvious.
on 16.02.2008 16:10
Jacques Chester wrote: > testebr wrote: >> Just renaming my php binary to php.fcgi. > > I'm having the same problem -- xcache starts but the admin page doesn't > show anything being cached in either PHP or Data caches. The renaming > fix above didn't work, I assume for distro-specific reasons. > > * I am using FastCGI with lighty. > > * php -v: > PHP 5.2.3-1ubuntu6.3 (cli) (built: Jan 10 2008 09:38:41) > Copyright (c) 1997-2007 The PHP Group > Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies > with XCache v1.2.1, Copyright (c) 2005-2007, by mOo > > * pstree: > ... > ├─lighttpd─┬─14*[lighttpd] > │ └─4*[php-cgi───4*[php-cgi]] > ... > > I have the feeling I am overlooking something obvious. 4*[php-cgi <- this (the first one) is too many, read lighttpd manual and reduce it to 1 have you set xcache.size to more than zero? show me your php.ini about xcache settings and show me your xcache-admin page
on 17.02.2008 02:41
moo XCache wrote: > 4*[php-cgi <- this (the first one) is too many, read lighttpd manual and > reduce it to 1 Done. Also reduced the caches to 1 apiece. > have you set xcache.size to more than zero? show me your php.ini about > xcache settings and show me your xcache-admin page xcache.ini: # configuration for php Xcache module # extension = xcache.so zend_extension = /usr/lib/php5/20060613/xcache.so [xcache.admin] xcache.admin.auth = On # Configure this to use admin pages xcache.admin.user = "admin" xcache.admin.pass = "<removed>" [xcache] ; ini only settings, all the values here is default unless explained ; select low level shm/allocator scheme implemenation xcache.shm_scheme = "mmap" ; to disable: xcache.size=0 ; to enable : xcache.size=64M etc (any size > 0) and your system mmap allows xcache.size = 64M ; set to cpu count (cat /proc/cpuinfo |grep -c processor) xcache.count = 1 ; just a hash hints, you can always store count(items) > slots xcache.slots = 8K ; ttl of the cache item, 0=forever xcache.ttl = 0 ; interval of gc scanning expired items, 0=no scan, other values is in seconds xcache.gc_interval = 0 ; same as aboves but for variable cache xcache.var_size = 256M xcache.var_count = 1 xcache.var_slots = 32K ; default ttl xcache.var_ttl = 0 xcache.var_maxttl = 0 xcache.var_gc_interval = 300 xcache.test = Off ; N/A for /dev/zero xcache.readonly_protection = Off ; for *nix, xcache.mmap_path is a file path, not directory. ; Use something like "/tmp/xcache" if you want to turn on ReadonlyProtection ; 2 group of php won't share the same /tmp/xcache ; for win32, xcache.mmap_path=anonymous map name, not file path xcache.mmap_path = "/dev/zero" ; leave it blank(disabled) or "/tmp/phpcore/" ; make sure it's writable by php (without checking open_basedir) xcache.coredump_directory = "" ; per request settings xcache.cacher = On xcache.stat = On xcache.optimizer = Off [xcache.coverager] ; per request settings ; enable coverage data collecting for xcache.coveragedump_directory and xcache_coverager_start/stop/get/clean() functions (will hurt executing performance) xcache.coverager = Off ; ini only settings ; make sure it's readable (care open_basedir) by coverage viewer script ; requires xcache.coverager=On xcache.coveragedump_directory = "" admin page -- see attachment. Cheers, JC.
on 17.02.2008 05:08
check your file last modified time and your system clock. or try XCache 1.2.2 i'm running out of ideas unless i check into your server root ssh account is needed, contact me at phpxcache@gmail.com if it's ok for you
on 20.02.2008 14:18
moo XCache wrote: > check your file last modified time and your system clock. or try XCache > 1.2.2 As soon as Ubuntu package 1.2.2 I'll give it a whirl and report back.
on 27.02.2008 19:42
This may not be the cause of your problem, but I found that if the cache size of a file exceed what can fit into a single cache partition, it will not be cached. I have 1 PHP file that is 7.84 MB and 31.55 MB cached. My xcache.size was 64M and xcache.count 2. However, because that file was not referenced right away, both of the cache partitions had less than 31.55 MB available, and because of this that file was never cached. I increased xcache.size and then the file was cached
on 18.03.2008 11:24
Hi guys,
I am having this exact same problem on my Ubuntu 7.10 server.
The only files being cached are the ones from the Xcache administration
section.
I've tried everything mentioned in this thread without any luck. I also
built a 1.2.2 package and installed that with no luck.
Were there any fresh ideas on why this isn't working?
These are my software versions
lighttpd 1.4.18-1ubuntu1.3
php5-xcache 1.2.1-1
php5-cgi 5.2.3-1ubuntu6.3
This is setup with FastCGI.
Here is what I have tried so far
* Reduced number of FastCGI processes to 1
* Reduced number of Lighttpd processes to 1
* Renamed php executable to php.fgci php5.fcgi php-cgi php5-cgi
* Upgraded to 1.2.2
* Increased cache memory to 256mb and higher
* Tweaked other settings in the xcache.ini file
* Confirmed via phpinfo() that the module is loaded
Here is my pstree
init-+-cron
|-lighttpd-+-4*[lighttpd]
| `-2*[php.fcgi---2*[php.fcgi]]
|-mysqld_safe-+-logger
| `-mysqld---12*[{mysqld}]
|-proftpd
|-sshd-+-sshd---sshd---bash---bash---pstree
| `-sshd---sshd---bash
`-syslogd
xcache.ini
# configuration for php Xcache module
extension = xcache.so
[xcache.admin]
xcache.admin.auth = On
# Configure this to use admin pages
xcache.admin.user = "removed"
xcache.admin.pass = "removed"
[xcache]
; ini only settings, all the values here is default unless explained
; select low level shm/allocator scheme implemenation
xcache.shm_scheme = "mmap"
; to disable: xcache.size=0
; to enable : xcache.size=64M etc (any size > 0) and your system mmap
allows
xcache.size = 16M
; set to cpu count (cat /proc/cpuinfo |grep -c processor)
xcache.count = 1
; just a hash hints, you can always store count(items) > slots
xcache.slots = 8K
; ttl of the cache item, 0=forever
xcache.ttl = 0
; interval of gc scanning expired items, 0=no scan, other values is in
seconds
xcache.gc_interval = 0
; same as aboves but for variable cache
xcache.var_size = 16M
xcache.var_count = 1
xcache.var_slots = 8K
; default ttl
xcache.var_ttl = 0
xcache.var_maxttl = 0
xcache.var_gc_interval = 300
xcache.test = Off
; N/A for /dev/zero
xcache.readonly_protection = Off
; for *nix, xcache.mmap_path is a file path, not directory.
; Use something like "/tmp/xcache" if you want to turn on
ReadonlyProtection
; 2 group of php won't share the same /tmp/xcache
; for win32, xcache.mmap_path=anonymous map name, not file path
xcache.mmap_path = "/dev/zero"
; leave it blank(disabled) or "/tmp/phpcore/"
; make sure it's writable by php (without checking open_basedir)
xcache.coredump_directory = ""
; per request settings
xcache.cacher = On
xcache.stat = On
xcache.optimizer = On
[xcache.coverager]
; per request settings
; enable coverage data collecting for xcache.coveragedump_directory and
xcache_coverager_start/stop/get/clean() functions (will hurt executing
performance)
xcache.coverager = Off
; ini only settings
; make sure it's readable (care open_basedir) by coverage viewer script
; requires xcache.coverager=On
xcache.coveragedump_directory = ""
I've run out of ideas so I am hoping someone can help.
on 19.03.2008 07:51
can u pls attach a XCache admin page output? this "2" is not good -> `-2*[php.fcgi---2*[php.fcgi]] u may want external spawn'ed php.fcgi, like "php.fcgi -b 1026", or use spawn-fcgi
on 19.03.2008 08:10
moo XCache wrote: > can u pls attach a XCache admin page output? > > this "2" is not good -> `-2*[php.fcgi---2*[php.fcgi]] > u may want external spawn'ed php.fcgi, like "php.fcgi -b 1026", or use > spawn-fcgi Why is it not good? The default install for lighttpd on ubuntu is the to use 2 processes to spawn 4 fcgi children. Lighttpd still runs as a single process though. ## FastCGI programs have the same functionality as CGI programs, ## but are considerably faster through lower interpreter startup ## time and socketed communication ## ## Documentation: /usr/share/doc/lighttpd-doc/fastcgi.txt.gz ## http://www.lighttpd.net/documentation/fastcgi.html server.modules += ( "mod_fastcgi" ) ## Start an FastCGI server for php (needs the php5-cgi package) fastcgi.server = ( ".php" => (( "bin-path" => "/usr/bin/php-cgi", "socket" => "/tmp/php.socket", "max-procs" => 2, "idle-timeout" => 20, "bin-environment" => ( "PHP_FCGI_CHILDREN" => "4", "PHP_FCGI_MAX_REQUESTS" => "10000" ), "bin-copy-environment" => ( "PATH", "SHELL", "USER" ), "broken-scriptfilename" => "enable" )) ) This results in 8 fastcgi-php instances. Output from XCache admin. XCache 1.2.1 Administration Help ? Statistics List PHP List Var Data Caches: - Slots Size Avail % Clear Compiling Hits Misses Clogs OOMs Protected Cached Deleted GC php#0 8.00 K 16.00 M 15.91 M [Clear] no 0 4 0 0 no 4 0 var#0 8.00 K 16.00 M 15.97 M [Clear] - 0 0 0 0 no 0 0 300 Free Blocks: php#0 size 15.91 M offset 94.75 K var#0 size 15.97 M offset 32.10 K Module Info XCache Support enabled Version 1.2.1 Modules Built cacher Readonly Protection N/A Opcode Cache enabled, 16,777,216 bytes, 1 split(s), with 8192 slots each Variable Cache enabled, 16,777,216 bytes, 1 split(s), with 8192 slots each Shared Memory Schemes malloc, mmap Directive Local Value Master Value xcache.admin.enable_auth On On xcache.cacher On On xcache.coredump_directory no value no value xcache.count 1 1 xcache.gc_interval 0 0 xcache.mmap_path /dev/zero /dev/zero xcache.readonly_protection no value no value xcache.shm_scheme mmap mmap xcache.size 16M 16M xcache.slots 8K 8K
on 19.03.2008 17:50
see lighttpd for why it should be "max-procs" => 1 for php opcode cachers > - Slots Size Avail % Clear Compiling Hits Misses > Clogs OOMs Protected Cached Deleted GC > php#0 8.00 K 16.00 M 15.91 M [Clear] no 0 4 > 0 0 no 4 0 > var#0 8.00 K 16.00 M 15.97 M [Clear] - 0 0 > 0 0 no 0 0 300 > u can see 4 cached already, just retry with "max-procs" => 1. i'm not sure if there's anything else wrong
on 19.03.2008 22:41
moo XCache wrote: > see lighttpd for why it should be "max-procs" => 1 for php opcode > cachers >> - Slots Size Avail % Clear Compiling Hits Misses >> Clogs OOMs Protected Cached Deleted GC >> php#0 8.00 K 16.00 M 15.91 M [Clear] no 0 4 >> 0 0 no 4 0 >> var#0 8.00 K 16.00 M 15.97 M [Clear] - 0 0 >> 0 0 no 0 0 300 >> > u can see 4 cached already, just retry with "max-procs" => 1. i'm not > sure if there's anything else wrong Sorry I should have been more specific, its only caching the admin page for xcache and nothing else. I've already tried dropping the max-procs to 1 and still no luck. I've also tried putting other files in the same location as where the admin pages are just in case its a path issue and it wouldn't cache those either. I've since upgraded lighttpd to 1.4.19 and tried xcache 1.2.2 with no luck. I get the feeling i've simply overlooked something but i'm not sure what.
on 19.03.2008 22:43
The above post was from me, I had not logged in.
on 21.03.2008 06:25
> Sorry I should have been more specific, its only caching the admin page yeah, i guessed so. but no answer come to my mind yet if you think it safe to send root ssh password to phpxcache@gmail.com, i'll check it. > for xcache and nothing else. I've already tried dropping the max-procs > to 1 and still no luck. I've also tried putting other files in the same > location as where the admin pages are just in case its a path issue and > it wouldn't cache those either. > > I've since upgraded lighttpd to 1.4.19 and tried xcache 1.2.2 with no > luck. I get the feeling i've simply overlooked something but i'm not > sure what.
on 16.04.2008 22:21
Hi, I have this problem also.. I might be able to shed some light on this as I have two servers, with almost identical configurations, one is caching correctly the other is broken. Basically, the only difference between the two is that one had some CGI handlers enabled. This was the "10-cgi" config snippet that comes in the Debian packages. Removing it from the running config fixed caching.
on 17.04.2008 10:31
Daniel Palmer wrote: > Hi, > > I have this problem also.. I might be able to shed some light on this as > I have two servers, with almost identical configurations, one is caching > correctly the other is broken. > > Basically, the only difference between the two is that one had some CGI > handlers enabled. This was the "10-cgi" config snippet that comes in the > Debian packages. Removing it from the running config fixed caching. That's it, problem has been fixed. Thank you for the help.
on 29.05.2008 10:23
I have the same problem , only xcache admin page are cached, I use
debian etch, apache2 mpm worker + fastcgi + php5.2.0 + xcache 1.2.2
xcache.count = 1
pstree:
init-+-apache2-+-2*[apache2]
| `-2*[apache2---26*[{apache2}]]
ps fax:
13443 ? Ss 0:00 /usr/sbin/apache2 -k start
13451 ? S 0:00 \_ /usr/sbin/apache2 -k start
13452 ? S 0:00 \_ /usr/sbin/fcgi-pm -k start
13454 ? Sl 0:00 \_ /usr/sbin/apache2 -k start
13509 ? Sl 0:00 \_ /usr/sbin/apache2 -k start
apache2.conf:
StartServers 2
MaxClients 100
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
I tried StartServers 1 but pstree does not change (strange huh?)
Can someone please help me debug it?
Thanks
Paolo
on 29.05.2008 14:41
Paolo Pp wrote: > I have the same problem , only xcache admin page are cached, I use > debian etch, apache2 mpm worker + fastcgi + php5.2.0 + xcache 1.2.2 env "PHP_FCGI_CHILDREN=3" (change 3 to whatever you want) has to be defined for php fastcgi. use "pstree | grep php" instead to check how php process "familar" looks like. if you're using external fastcgi backend, you may want to read the following example php fastcgi backend daemontools startup script (/service/php/run) #!/bin/sh PHP_FCGI_CHILDREN=3 export PHP_FCGI_CHILDREN exec /usr/bin/php-cgi -b 127.0.0.1:1026 -c /etc/php-cgi-fcgi.ini i'm not sure what fastcgi module you're using, may other apache guys help u. thx

