warning: MemcachePool::getextendedstats()

andreiashu - January 29, 2009 - 15:43
Project:Memcache API and Integration
Version:6.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:jaydub
Status:closed
Description

Hi, I really don't now what I'm doing wrong here. Fresh D6.9 install, memcache 6.x-1.x-dev (2009-Jan-27), memcached 1.2.6 (on a ubuntu server), php 5.2.6, and memcache pecl library 3.0.2.
Everything works great (btw many thanks to the developers :) ) but when i go to 'admin/reports/memcache' i receive this warning and no stats:

warning: MemcachePool::getextendedstats() [memcachepool.getextendedstats]: Invalid stats type in /var/www/pemobil/sites/all/modules/memcache/dmemcache.inc on line 127.

Any ideas ?

#1

bacchus101 - April 17, 2009 - 16:15

I get the same thing (except it is line 113.)

Subscribing.

#2

andreiashu - April 17, 2009 - 18:36

Hi bacchus101,
Can you provide more detailed information, like Drupal, memcache module, memcache PECL library, memcached versions and also PHP version ?
I'm thinking that maybe we (or someone else) can find out something common to our installations that could help replicate and then solve this issue.

Thanks,
andreiashu

#3

bacchus101 - April 19, 2009 - 00:03

Drupal Version: 6.10
Memcache API and Integration: 6.x-1.2
PHP: 5.2.9-0
Lighttpd server (on Ubuntu 8.10 x_64)
Memcached: 1.2.2
memcache pecl library: 2.2.5

Everything seems to be working except the stats.

#4

asb - June 4, 2009 - 10:41

Hi,

similar error here:

warning: MemcachePool::getextendedstats() [memcachepool.getextendedstats]: Invalid stats type in /usr/local/www/drupal/sites/all/modules/memcache/dmemcache.inc on line 113.
No available statistics for this bin.

OS: FreeBSD 7.1-RELEASE-p4
Drupal Version: 6.12
Memcache API and Integration: 6.x-1.2
PHP: 5.2.8 with Suhosin-Patch 0.9.6.3
Lighttpd: 1.4.22 <-- someone having this problem with Apache?
Memcached: 1.2.8
memcache pecl library: 3.0.4
MySQLi 5.0.75

Greetings, -asb

#5

2440media2 - June 4, 2009 - 13:04
Version:6.x-1.x-dev» 6.x-1.2

I'm getting this also. I have current versions of everything, running LAMP on centos.

Here is my config...

$conf = array(
              'cache_inc' => './sites/all/modules/memcache/memcache.db.inc',
              'memcache_servers' => array(
                        'localhost:11211' => 'default',
                        'localhost:11212' => 'filter',
                        'localhost:11213' => 'menu',
                        'localhost:11214' => 'page',

              ),
              'memcache_bins' => array(
                        'cache' => 'default',
                        'cache_filter' => 'filter',
                        'cache_menu' => 'menu',
                        'cache_page' => 'page',

              ),
....

#6

2440media2 - June 8, 2009 - 14:20

Also, our server is 64-bit so we thought that might be something that could be different between our servers. Not sure how that would affect memcache but thought it might be a helpful clue in some way.

#7

bacchus101 - June 8, 2009 - 16:16

@2440media2

I recently moved over to a 32 bit server from a 64 bit server and I am still having the same issue.

#8

2440media2 - June 9, 2009 - 17:24

@bacchus101 - I can confirm that memcache is running using this tool (http://livebookmark.net/journal/2008/05/21/memcachephp-stats-like-apcphp/) - though I'm getting more misses than hits - how about you?

#9

bacchus101 - June 10, 2009 - 00:30

Actually, memcache is running "fine" for me and I am using the same tool (80% default, 80% page and 91% filter hit rate.)

That is why this statistic error is more of an inconvenience than an actual problem (although it would be nice if it worked.)

#10

printing - June 23, 2009 - 21:52

Subscribing

#11

printing - June 25, 2009 - 13:37

This appears to be working for me now. Turns out that we were on a 3.x version of the PECL Memcache so the solution was to downgrade to 2.2.5 and flush the cache. We're getting more hits than misses now. The only one that is off is the filter which has almost no hits...still working on that one.

#12

Fleshgrinder - July 5, 2009 - 19:14

Subscribing, same error. My system:

OS: Debian 5 (Lenny)
Drupal: 6.13 (more or less fresh)
Memcache API: 6.x-1.2
PHP: 5.2.6-1 with Suhosin-Patch 0.9.6.2
Apache: 2.2
Memcached: 1.2.8
memcache PECL lib: 3.0.1
MySQLi: 5.0.51a

#13

2440media2 - July 8, 2009 - 20:19

check your version of memcache PECL lib - 3.x seemed to be the problem

#14

neclimdul - July 22, 2009 - 19:10

Agreed, rolled back to pecl-memcache 2.2.5 and it fixed the problem. Seems to be the solution. Too bad

According to the memcached protocol spec these additional arguments "are subject to change for the convenience of memcache developers".

makes it sound like there might not be an elegant solution for the Drupal module to handle the difference.

#15

jaydub - August 3, 2009 - 09:00

This is a result of changes in the PHP PECL Memcache extension starting with version 3.0. A look through the source code for the PHP Memcache extension yields this function in memcache.c:

static int mmc_stats_checktype(const char *type) { /* {{{ */
return type == NULL ||
!strcmp(type, "reset") ||
!strcmp(type, "malloc") ||
!strcmp(type, "slabs") ||
!strcmp(type, "cachedump") ||
!strcmp(type, "items") ||
!strcmp(type, "sizes");
}

The mmc_stats_checktype function is called when the PHP memcache functions memcache_get_stats() or memcache_get_extended_stats() are called and if the mmc_stats_checktype() function returns TRUE then you get the 'Invalid stats type' error reported above.

From the types checklist above you can see that 'maps' is not listed which means that the 'maps' type which works in the PHP PECL memcache 2.x release will not work here. Likewise there does not seem to be a default stats type (an empty string is passed in the Drupal memcache module dmemcache_stats() function in dmemcache.inc when a stats type is not specified).

So it would seem that there's not way to get the basic server stats.

#16

jaydub - August 3, 2009 - 09:35
Version:6.x-1.2» 6.x-1.x-dev
Assigned to:Anonymous» jaydub
Status:active» needs review

The attached patch works around the stats 'checktype' in the new Memcache extension and results in the basic Memcache stats data successfully displaying. The 'maps' stats type still throws an error because that stats type is no longer available in the 3.x version of the Memcache extension.

This was tested and works for both the 5.x and 6.x memcache modules. If someone who is running the PHP PECL Memcache 2.x version of the extension to verify that the stats still work then I think the main stats problem will be solved across the 2.x and 3.x versions of the Memcache extension.

AttachmentSize
dmemcache.inc_.d6.patch 1.14 KB
dmemcache.inc_.d5.patch 1.12 KB

#17

meba - August 29, 2009 - 17:23

I can confirm this fixed the problem on PECL 3.x

#18

Jeremy - September 15, 2009 - 17:52
Status:needs review» fixed

Thanks for the patch, fix committed. (Sorry, I meant to commit it separately crediting you for the patch, but it slipped into my last commit):
http://drupal.org/cvs?commit=263340

#19

System Message - September 29, 2009 - 18:00
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.