[support] Problem with Drupals built in cache

Jamie Holly hovercrafter at earthlink.net
Thu Jan 20 14:03:29 UTC 2011


Then I would check phpinfo to make sure that the memcache extension is 
loading into PHP (you can do this from admin -> reports -> status and 
then clicking on your PHP version number).

If that's showing up ok, you can run a command from the terminal to make 
sure things are being written/read from memcache:

echo stats | nc {memcache address} {memcache port}

Your main things to look at are the hits, misses, bytes and connections.

There are also some versions of memcache + the PHP extension that don't 
work well together. This can be a hit and miss thing finding them. I 
know there was a combination in the CentOS repos a year or so ago that 
caused problems. Getting the latest version of the PHP extension and 
building it from source would fix that.

Jamie Holly
http://www.intoxination.net
http://www.hollyit.net


On 1/20/2011 8:43 AM, Margusja wrote:
> Thx for a replay. I checked again my memcache and I think it works fine.
>
> [15:40:16 root at arendus ~]# telnet localhost 11211
> Trying 127.0.0.1...
> Connected to localhost.
> Escape character is '^]'.
> stats
> STAT pid 30211
> STAT uptime 19724
> STAT time 1295530831
> STAT version 1.2.8
> STAT pointer_size 32
> STAT rusage_user 0.094985
> STAT rusage_system 0.230964
> STAT curr_items 67
> STAT total_items 1089
> STAT bytes 168012
> STAT curr_connections 11
> STAT total_connections 188
> STAT connection_structures 14
> STAT cmd_flush 0
> STAT cmd_get 6580
> STAT cmd_set 1089
> STAT get_hits 711
> STAT get_misses 5869
> STAT evictions 0
> STAT bytes_read 9254362
> STAT bytes_written 5742821
> STAT limit_maxbytes 67108864
> STAT threads 5
> STAT accepting_conns 1
> STAT listen_disabled_num 0
> END
>
> rows from settings.php
> if(extension_loaded('memcache')){
>           $conf['cache_inc'] = './sites/all/modules/memcache/memcache.inc';
>           $conf['memcache_key_prefix'] = 'xxx';
> }
>
> Tervitades, Margus (Margusja) Roo
> +372 51 48 780
> http://margus.roo.ee
> msn: margusja at kodila.ee
> skype: margusja
>
>
> On 1/20/11 2:45 PM, Jamie Holly wrote:
> >  Drupal is still going to check the access table to see if you have any
> >  blocks in there for the current user, even if the table is empty.
> >
> >  The semaphore you are seeing is to prevent a cache stampede. You said
> >  that once you disabled memcache, everything worked fine. It looks like
> >  you have a problem with either your memcache server, the PHP memcache
> >  extension or your settings in Drupal for memcache. I would check the
> >  server first, since that's the easier. You can just do a telnet to check
> >  that out. From shell:
> >
> >  telnet (server address) (server port)
> >
> >  See if it connects OK.
> >
> >  As far as Pressflow+Memcache, yeah they work great together. I run that
> >  combination for a couple of clients, including one that has seen over
> >  150,000 page an hour, and never had a problem.
> >
> >  Jamie Holly
> >  http://www.intoxination.net
> >  http://www.hollyit.net
> >
> >
> >  On 1/20/2011 4:12 AM, Margusja wrote:
> >>  If I disable memcache support in PHP then in the problematic server I
> >>  see that there no problem anymore. So can memcache and pressflow cache
> >>  work parallel ?
> >>
> >>  Tervitades, Margus (Margusja) Roo
> >>  +372 51 48 780
> >>  http://margus.roo.ee
> >>  msn: margusja at kodila.ee
> >>  skype: margusja
> >>
> >>
> >>  On 1/20/11 10:09 AM, Margusja wrote:
> >>>    Hi
> >>>
> >>>    I have two separate Drupal instances (Pressflow 6.19) In first one the
> >>>    local cache works fine. Sql log:
> >>>                326 Query       SET NAMES "utf8"
> >>>                326 Query       SELECT 1 FROM access WHERE type = 'host' AND
> >>>    '195.50.208.170' LIKE mask AND status = 0 LIMIT 0, 1
> >>>                326 Query       SELECT data, created, headers, expire,
> >>>    serialized FROM cache WHERE cid = 'variables'
> >>>                326 Query       SELECT data, created, headers, expire,
> >>>    serialized FROM cache_page WHERE cid = 'http://IP/path/to/node'
> >>>                326 Query       SELECT name, filename, throttle FROM system
> >>>    WHERE type = 'module' AND status = 1 AND bootstrap = 1 ORDER BY weight
> >>>    ASC, filename ASC
> >>>                326 Query       SELECT name, filename, throttle FROM system
> >>>    WHERE type = 'module' AND status = 1 AND bootstrap = 1 ORDER BY weight
> >>>    ASC, filename ASC
> >>>                326 Quit
> >>>
> >>>    But If I request the same node in the second machine. The code is same,
> >>>    then the Sql log is:
> >>>                  122 Quit
> >>>                  123 Query       SET NAMES "utf8"
> >>>                  123 Query       SELECT 1 FROM access WHERE type = 'host'
> >>>    AND 'IP' LIKE mask AND status = 0 LIMIT 0, 1
> >>>                  123 Query       INSERT INTO semaphore (name, value, expire)
> >>>    VALUES ('variable_cache_regenerate',
> >>>    '17865562914d37e5d81acd80.47344784', 1295508982.1098)
> >>>                  123 Query       SELECT * FROM variable
> >>>                  123 Query       DELETE FROM semaphore WHERE name =
> >>>    'variable_cache_regenerate' AND value = '17865562914d37e5d81acd80.47344784'
> >>>                  123 Query       SELECT name, filename, throttle FROM system
> >>>    WHERE type = 'module' AND status = 1 AND bootstrap = 1 ORDER BY weight
> >>>    ASC, filename ASC
> >>>                  123 Query       SELECT * FROM languages ORDER BY weight
> >>>    ASC, name ASC
> >>>                  123 Query       SELECT dst FROM url_alias LIMIT 0, 1
> >>>                  123 Query       SELECT src FROM url_alias WHERE dst =
> >>>    'hoiused-ja-investeerimine' AND language IN('et', '') ORDER BY language
> >>>    DESC, pid DESC
> >>>                  123 Query       SELECT name, filename, throttle FROM system
> >>>    WHERE type = 'module' AND status = 1 ORDER BY weight ASC, filename ASC
> >>>                  123 Query       INSERT INTO semaphore (name, value, expire)
> >>>    VALUES ('locale_cache_et', '17865562914d37e5d81acd80.47344784',
> >>>    1295508982.4035)
> >>>                  123 Query       SELECT s.source, t.translation, t.language
> >>>    FROM locales_source s LEFT JOIN locales_target t ON s.lid = t.lid AND
> >>>    t.language = 'et' WHERE s.textgroup = 'default' AND s.version = '6.19'
> >>>    AND LENGTH(s.source)<     75
> >>>                  123 Query       DELETE FROM semaphore WHERE name =
> >>>    'locale_cache_et' AND value = '17865562914d37e5d81acd80.47344784'
> >>>                  123 Query       SELECT s.lid, t.translation, s.version FROM
> >>>    locales_source s LEFT JOIN locales_target t ON s.lid = t.lid AND
> >>>    t.language = 'et' WHERE s.source = 'Stores details about batches
> >>>    (processes that run in multiple HTTP requests).' AND s.textgroup =
> >>>    'default'
> >>>    ....
> >>>    ....
> >>>    loads of SQLs
> >>>
> >>>    The main question why does the last one ask something from semaphore? In
> >>>    both servers access table is empty. At first I thought the condition
> >>>    came from that SQL: SELECT 1 FROM access WHERE type = 'host' AND 'IP'
> >>>    LIKE mask AND status = 0 LIMIT 0, 1 but as I said in both servers access
> >>>    table is empty.
> >>>
> >>>    In both solutions caches are enabled.
> >>>
> >>>    Any hints?
> >>>


More information about the support mailing list