Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | SDKs | SDKs

Couchbase PHP Client Library not compatible with PHP Memcache?

4 replies [Last post]
  • Login or register to post comments
Tue, 02/21/2012 - 11:08
trurl
Offline
Joined: 02/21/2012
Groups: None

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.

Top
  • Login or register to post comments
Fri, 02/24/2012 - 09:33
chadkouse
Offline
Joined: 10/13/2010
Groups: None

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.

Top
  • Login or register to post comments
Mon, 03/05/2012 - 10:13
jan
Offline
Joined: 02/15/2011
Groups: None

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
--

Top
  • Login or register to post comments
Mon, 03/05/2012 - 13:04
trurl
Offline
Joined: 02/21/2012
Groups: None

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.

Top
  • Login or register to post comments
Wed, 03/07/2012 - 21:26
trurl
Offline
Joined: 02/21/2012
Groups: None

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)

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker