Couchbase PHP Client Library not compatible with PHP Memcache?
I'm setting vars in couchbase server: one using php-mecache, second - using PHP couchbase, both have value "1282".
Checking by direct connect to couchbase server using telnet on memcache port:
get var_by_perc_memcache
VALUE var_by_perc_memcache 768 4
1282
END
get var_by_couchbase
VALUE var_by_couchbase 1 4
1282
END
Trying to get couchbase var using memcache lib and got:
Notice: MemcachePool::get(): Failed to unserialize data in ...
bool(false)
Trying to get memcache var using couchbase lib and got:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 842543666 bytes) in ...
Very funny.
Hi trurl,
we released a new version of the PHP SDK last week. Can you test if your problem persists? If it does, can you share full scripts to reproduce this?
Cheers
Jan
--
I'll try, but now i'm busy with shamanism around couchbase-server to make it frendly to System-D and make cluster stable under heavy load (500/50 request read/writes per second). Last time one of servers (from 2 identical) have eated out all local memory (including swap) and after it was no possibility to rebalance cluster. Helps only rebuild cluster from clear state.
Now bit better:
<?php // test $memcache_obj = new Memcache; $memcache_obj->addServer("10.9.8.16", 11211); $memcache_obj->set("test_11","test data"); $cb = new Couchbase("10.9.8.16:8091", "someuser", "somepass", "default"); echo "server version: ".$cb->getVersion().""; $cb->set("test_12","another test data"); $x11_1=$memcache_obj->get("test_11"); $x12_1=$memcache_obj->get("test_12"); $x11_2=$cb->get("test_11"); $x12_2=$cb->get("test_12"); echo "\nx11="; var_dump($x11_1); echo " = "; var_dump($x11_2); echo "\nx2="; var_dump($x12_1); echo " = "; var_dump($x12_2);
output:
server version: 1.0.0 Notice: MemcachePool::get(): Failed to uncompress data in /root/111.php on line 14 x11=string(9) "test data" = int(0) x2=bool(false) = string(17) "another test data"
with numeric data:
server version: 1.0.0 Notice: MemcachePool::get(): Failed to unserialize data in /root/111.php on line 14 Warning: Couchbase::get(): could not decompress value, no decompressor found in /root/111.php on line 15 Warning: Couchbase::get(): Faild to get a value from server: Generic error in /root/111.php on line 15 x11=int(1011) = NULL x2=bool(false) = int(1012)
I believe it is compatible with the php extension "memcached" (note the "d" on the end) -- this one is based on libmemcached. What I'm seeing in your results there are different flags, probably to indicate compression or something similar.