Testing on a local machine.

PHP Warning: xcache_get(): xcache.var_size is either 0 or too small to enable var data caching in /var/www/queer/sites/all/modules/cacherouter/engines/xcache.php on line 35
PHP Warning: xcache_get(): xcache.var_size is either 0 or too small to enable var data caching in /var/www/queer/sites/all/modules/cacherouter/engines/xcache.php on line 78
PHP Warning: xcache_set(): xcache.var_size is either 0 or too small to enable var data caching in /var/www/queer/sites/all/modules/cacherouter/engines/xcache.php on line 88
PHP Warning: xcache_set(): xcache.var_size is either 0 or too small to enable var data caching in /var/www/queer/sites/all/modules/cacherouter/engines/xcache.php on line 99

I upped the default xcache.var_size from 4M to 64M in xcache.ini - same warnings.

What am I doing wrong?

Oh, web server = Lighty, if that make a difference. The local machine is running F11. Server=Centos with out-of-box php 5.2.

xcache.ini:

[xcache-common]
zend_extension = /usr/lib/php/modules/xcache.so

[xcache.admin]
xcache.admin.auth = On
xcache.admin.user = "xxxxxxxxx"
; xcache.admin.pass = md5($pwd)
xcache.admin.pass = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

[xcache]
xcache.shm_scheme = "mmap"
xcache.size = 64M
xcache.count = 3
xcache.slots = 1K
xcache.ttl = 3600
xcache.gc_interval = 300

; Same as aboves but for variable cache
; If you don't know for sure that you need this, you probably don't
xcache.var_size = 64M
xcache.var_count = 1
xcache.var_slots = 1K
xcache.var_ttl = 3600
xcache.var_maxttl = 3600
xcache.var_gc_interval = 300

; N/A for /dev/zero
xcache.readonly_protection = Off
xcache.optimizer = On
; 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"

CommentFileSizeAuthor
#18 cacherouter-570264-fix-warnings.patch1.55 KBkenorb
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

eyecon-1’s picture

BTW, just testing this, I am showing hits in list_var_data (which are non-existent without this module). I have no idea to what extent performance is improved.

I assume that the cache path setting with xcache does nothing??

andypost’s picture

Version: 6.x-1.0-rc1 » 6.x-1.x-dev

Looks like this is documentation issue... could you try 6-dev version?
Maube xcache have setting to disable cache for variables like eaccelerator

newmediaist’s picture

I am experiencing this same issue on my site - using the newest DEV build of the module.

andypost’s picture

@newmediaist Provide more info about your xcache version

newmediaist’s picture

Sure - my setup:

XCache v1.3.0
PHP 5.3.2 w/PHP-FPM 0.6
nginx/0.6.39

I should also mention the error isn't thrown via drupal_set_message - I only see it when I run CRON via the command line (via DRUSH or similar)

Anything else I can do to help diagnose the problem, let me know...

andypost’s picture

Oh! I think it's related to command line... not sure how to debug this...

newmediaist’s picture

I think the reason why it isn't push through Drupal's error reporting system is it is reporting as a warning - and because this is my production server warnings are not displayed publically... I don't know if it necessarily is directly correlated to being run from the command line or not.

Is there anywhere else I can check to ensure Cache Router is functioning properly w/ XCache?

andypost’s picture

I googled around this bug and find that all caused by setting xcache.var_size

You should check that it's value is different from 0 at admin/reports/status/php

newmediaist’s picture

xcache.var_size set to 64...

Here are my XCache Settings (direct from admin/reports/status/php )

Directive Local Value Master Value
xcache.admin.enable_auth Off Off
xcache.cacher On On
xcache.coredump_directory no value no value
xcache.count 1 1
xcache.gc_interval 7200 7200
xcache.mmap_path /dev/zero /dev/zero
xcache.readonly_protection no value no value
xcache.shm_scheme mmap mmap
xcache.size 64M 64M
xcache.slots 8K 8K
xcache.stat Off Off
xcache.test no value no value
xcache.ttl 7200 7200
xcache.var_count 1 1
xcache.var_gc_interval 300 300
xcache.var_maxttl 0 0
xcache.var_size 64M 64M
xcache.var_slots 8K 8K
xcache.var_ttl 0 0

newmediaist’s picture

Any update on this issue? Drupal sees the right xcache.var_size, so that doesn't seem to be the problem...

newmediaist’s picture

Here is the answer - Xcache not supported in PHP CLI
http://xcache.lighttpd.net/ticket/228

goldlilys’s picture

Getting similar error

Warning: xcache_get() [function.xcache-get]: xcache.var_size is either 0 or too small to enable var data caching in /sites/all/modules/cacherouter/engines/xcache.php on line 35

Warning: xcache_get() [function.xcache-get]: xcache.var_size is either 0 or too small to enable var data caching in /sites/all/modules/cacherouter/engines/xcache.php on line 78

Warning: xcache_set() [function.xcache-set]: xcache.var_size is either 0 or too small to enable var data caching in /sites/all/modules/cacherouter/engines/xcache.php on line 88

Warning: xcache_set() [function.xcache-set]: xcache.var_size is either 0 or too small to enable var data caching in /sites/all/modules/cacherouter/engines/xcache.php on line 99

Warning: Cannot modify header information - headers already sent by (output started at /sites/all/modules/cacherouter/engines/xcache.php:35) in /includes/bootstrap.inc on line 725

Warning: Cannot modify header information - headers already sent by (output started at /sites/all/modules/cacherouter/engines/xcache.php:35) in /includes/bootstrap.inc on line 726

Warning: Cannot modify header information - headers already sent by (output started at /sites/all/modules/cacherouter/engines/xcache.php:35) in /includes/bootstrap.inc on line 727

Warning: Cannot modify header information - headers already sent by (output started at /sites/all/modules/cacherouter/engines/xcache.php:35) in /includes/bootstrap.inc on line 728

Fatal error: Call to undefined function filter_xss() in /includes/common.inc on line 655

My settings.php looks like:

$conf['cache_inc'] = './sites/all/modules/cacherouter/cacherouter.inc';
$conf['cacherouter'] = array(
'default' => array(
'engine' => 'xcache',
'servers' => array(),
'shared' => TRUE,
'prefix' => 'gallery',
'path' => 'sites//files/filecache',
'static' => FALSE,
'fast_cache' => TRUE,
),
);

xcache settings:

XCache Support enabled
Version 1.3.2
Modules Built cacher
Readonly Protection N/A
Cache Init Time 2011-07-19 03:35:14
Cache Instance Id 5514
Opcode Cache enabled, 536,870,912 bytes, 1 split(s), with 134217728 slots each
Variable Cache enabled, 536,870,912 bytes, 1 split(s), with 8192 slots each
Shared Memory Schemes 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 300 300
xcache.mmap_path /dev/zero /dev/zero
xcache.readonly_protection no value no value
xcache.shm_scheme mmap mmap
xcache.size 512M 512M
xcache.slots 128M 128M
xcache.stat On On
xcache.test 0 0
xcache.ttl 7200 7200
xcache.var_count 1 1
xcache.var_gc_interval 300 300
xcache.var_maxttl 0 0
xcache.var_size 512M 512M
xcache.var_slots 8K 8K
xcache.var_ttl 0 0

And using php CGI, not CLI. But still getting that error.

What am I doing wrong?

goldlilys’s picture

Not sure if this affects things, but i have this enabled:

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
with XCache v1.3.2, Copyright (c) 2005-2011, by mOo
with the ionCube PHP Loader v3.3.20, Copyright (c) 2002-2010, by ionCube Ltd.

kenorb’s picture

The same problem when enabling the module in drush.
My settings:

; same as aboves but for variable cache
xcache.var_size  =            16M
xcache.var_count =             4
xcache.var_slots =            16K

It doesn't happens in the browser and the variables are normally cached.

kenorb’s picture

kenorb’s picture

Priority: Normal » Critical
Status: Active » Closed (won't fix)

As stated here:
http://xcache.lighttpd.net/ticket/228

Changed 4 weeks ago by moo

status changed from reopened to closed
resolution set to wontfix
XCache is useless with CLI. What you wanted is to share between different group of PHP which is unsupported by XCache. memcached come in handy for this case

Changed 20 months ago by moo

status changed from reopened to closed
resolution set to wontfix
error is not printed because most ppl tends to use same single php.ini for all sapi and most ppl don't know if and how they can separate php ini for each sapi

kenorb’s picture

Status: Closed (won't fix) » Active

Actually it can be fixed by checking if the module is run in CLI, then we can ignore executing these functions.

kenorb’s picture

Status: Active » Needs review
FileSize
1.55 KB
kenorb’s picture

Status: Needs review » Closed (outdated)

Version 6.x is no longer supported due to Drupal 6 End of Life.