Sunday, 29 July 2018

Memcache PHP extension on windows 10 works intermittently

I have memcache extensions on apache/php windows 10 (details at the end)

Created a simple test:

$memcache = new Memcache;
$memcache->addServer("ext-memcached.e-memcached.xxx.net",11211);
$memcache->addServer("ext-memcached.e-memcached2.xxx.net",11211);
$memcache->addServer("ext-memcached.e-memcached3.xxx.net",11211);

$key='xxx_54921';
$settings = $memcache->get($key);
print_r ($settings);

the memcache servers are on AWS and they work well (production servers). This test code works - it retreives the value from the memcache servers. However if I wait a couple minutes and refresh it will not return value. Then if I refresh again it will return the value.

The same code/config works from another dev computer.

What can cause this?

Config: PHP Version 5.6.34 Windows NT SPECTRE 6.2 build 9200 (Windows 8 Home Premium Edition) i586 Build Date Feb 28 2018 17:45:55 Compiler MSVC11 (Visual C++ 2012) Architecture x86

Memcache extension: ts x86 version from here: https://windows.php.net/downloads/pecl/releases/memcache/3.0.8/

memcache info: memcache support enabled Version 3.0.8 Revision $Revision: 329835 $ Directive Local Value Master Value memcache.allow_failover 1 1 memcache.chunk_size 32768 32768 memcache.compress_threshold 20000 20000 memcache.default_port 11211 11211 memcache.hash_function crc32 crc32 memcache.hash_strategy standard standard memcache.lock_timeout 600 600 memcache.max_failover_attempts 20 20 memcache.protocol ascii ascii memcache.redundancy 1 1 memcache.session_redundancy 2 2



from Memcache PHP extension on windows 10 works intermittently

No comments:

Post a Comment