php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58547 Multiple servers do not work
Submitted: 2009-02-10 10:49 UTC Modified: 2009-02-10 18:17 UTC
From: philipp dot feigl at gmail dot com Assigned:
Status: Not a bug Package: memcached (PECL)
PHP Version: 5.2.5 OS: CentOS5
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: philipp dot feigl at gmail dot com
New email:
PHP Version: OS:

 

 [2009-02-10 10:49 UTC] philipp dot feigl at gmail dot com
Description:
------------
I have a setup with 2 memcached servers. Both listening to differnt ports (11223 and 11224 in my case).

As long as both are running, everything seems to work as expected and gets cached against the first server.

If I just shutdown the first memcached, nothing gets cached at all. While the script does not indicate any failures, no cache requests arrive and the second server.

I've also installed the (old) memcache pecl extension on the client machine and when using the same code just with the Memcache object instead of the Memcached object, everything works as expected.

Something to know is, that I'm not using memcache but repcached. However the interfaces (and even the core code) is the very same, so this should not have any impace on the scenario.

It simply looks like Memcached is not trying to connect to the 2nd server after the connection to the first one fails

Reproduce code:
---------------
<?php
$c = new Memcached();
$c->addServer('192.168.122.3', 11223);
$c->addServer('192.168.122.2', 11224);

$c->set('a', 'abc12');
?>

Expected result:
----------------
<11 new client connection
<11 set a 0 0 5
>11 STORED
<11 quit
<11 connection closed.


Actual result:
--------------
no connection is established at all onto the 2nd server

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-02-10 16:01 UTC] andrei@php.net
Thank you for taking the time to write to us, but this is not
a bug.

libmemcached does not support failover. If a key maps to a server that is down, it simply will not get stored, which is what you're seeing.
 [2009-02-10 18:14 UTC] philipp dot feigl at gmail dot com
What is the addServer functionality thought for than, when there is no failover for multiple servers?

I thought having multiple servers only makes sense, when others in the list are used, when of them is not available
 [2009-02-10 18:17 UTC] andrei@php.net
Multiple servers make sense when your data set won't fit in a single server.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 01:01:28 2024 UTC