Skip to content

Strange behaviour when one server is missing #569

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
mokraemer opened this issue Jan 29, 2025 · 0 comments
Open

Strange behaviour when one server is missing #569

mokraemer opened this issue Jan 29, 2025 · 0 comments

Comments

@mokraemer
Copy link

Using php-memcached 3.2.0:

I encounter some strange things, when you add the servers via

$cache = new Memcached(/* $id */);
$cache->setOptions([
	Memcached::OPT_BINARY_PROTOCOL => true,
	Memcached::OPT_PREFIX_KEY => $id . '_',
	Memcached::OPT_COMPRESSION => true,
	Memcached::OPT_CONNECT_TIMEOUT => 30,
	Memcached::OPT_DISTRIBUTION => Memcached::DISTRIBUTION_CONSISTENT,
	Memcached::OPT_SERVER_FAILURE_LIMIT => 2,
	Memcached::OPT_REMOVE_FAILED_SERVERS => true,
	Memcached::OPT_RETRY_TIMEOUT => 60,
]);
$cache->resetServerList();
$cache->addServers([
 ['server1',11212,0],
 ['server2',11212,0]
]
]);

you can call $cache->getStats which works fine and gives you informations.
If you then stop e.g. server2, memcache does not reliably work and if you call $cache->getStats it just returns "false".
I guess this condition, having one server down is not handled correctly and getStats just shows the problem.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant