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

PHP SDK takes ages to establish connection to Couchbase

3 replies [Last post]
  • Login or register to post comments
Fri, 03/15/2013 - 10:46
nekkid
Offline
Joined: 02/15/2013
Groups: None

Hi everybody,

I'm having issue using the SDK for PHP.

If I try to estabilish a connection it takes ages...

Here some code:

$old = microtime (true);
$db = new Couchbase(...);
echo microtime (true)-$old."
";
$old = microtime (true);
$db->get(...);
echo microtime (true)-$old;

The output is this:
2.2835459709167 (couchbase establishing)
0.0011978149414062 (get command)

Why does the connection to couchbase take so long time?

Top
  • Login or register to post comments
Fri, 03/22/2013 - 01:39
tgrall
Offline
Joined: 09/05/2012
Groups: None

Hello,

Which version of PHP, SDK and OS are you using?

Thanks

__________________

Tug
@tgrall

Top
  • Login or register to post comments
Fri, 03/22/2013 - 05:06
trond
trond's picture
Offline
Joined: 03/15/2010
Groups: None

The initial connect to Couchbase use the REST protocol connecting to the administration port to request the full layout of the cluster. This is unfortunately a relatively slow operation, but the good news is that you don't have to do that all of the times. If you use "persistent connections" (the last parameter to the constructor, and enabled by default in the upcoming release of the connector) it will cache these instances and reuse them (given that you provide the same arguments in the constructor).

Top
  • Login or register to post comments
Fri, 03/22/2013 - 09:04
nekkid
Offline
Joined: 02/15/2013
Groups: None

that's is haven't seen this flag at the end of the Couchbase object...

Thx alot!

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