Caching - am I missing something?

Thalagyrt

Member
Any idea why this isn't working? Occasionally throws an unexpected error without dumping anything into logs, and the cache shows zero attempts/hits. The memcached module is compiled/enabled on both web servers and working just fine in other applications...

Code:
$config['cache']['enabled'] = true;
$config['cache']['frontend'] = 'Core';
$config['cache']['frontendOptions'] = array('caching'  =>  true,
  'automatic_serialization' => true,
  'lifetime'    => 1800,
  'cache_id_prefix' => 'xffe_',
);
$config['cache']['backend'] = 'Memcached';
$config['cache']['backendOptions'] = array(
    'backendOptions'=>array(
            'servers' =>array(
                            array(
                                'host' => '<snip server1>',
                                'port' => 11211
                            ),
                            array(
                                'host' => '<snip server2>',
                                'port' => 11211
                            ),
                            array(
                                'host' => '<snip server3>',
                                'port' => 11211
                            ),
                            array(
                                'host' => '<snip server4>',
                                'port' => 11211
                            ),
                        ),
            'compression' => false
    )
);
 
Update: Forgot to check XF error log - I'm used to looking in the webserver logs themselves. Seeing this there:

MemcachePool::get(): Server 127.0.0.1 (tcp 11211, udp 0) failed with: Connection timed out (110)

Nowhere at all is localhost/127.0.0.1 directly configured as a memcached server. It's all by FQDN. Even then, localhost should reply just fine, as the app servers each are part of the memcached cluster...
 
Make sure Memcached is listening on the IP address you specify in your config. Sometimes it is configured to listen on the UDP port, and you need to manually specify the -l 127.0.0.1 option.
-l IP on memcached config or xenforo config ?

Thanks for your reply
 
@MattW

I am facing the exact same issue, can you help

ErrorException: MemcachePool::get(): Server localhost (tcp 11211, udp 0) failed with: Connection refused (111) - library/Zend/Cache/Backend/Memcached.php:180
 
Top Bottom