PHP-FPM & large number of connections to the couchbase cluster


#1

We’re currently facing some performance issues with our application and Couchbase is the culprit. One area we are looking at is the shear number of connections our application servers have with the couchbase cluster. My understanding is that each PHP-FPM process will create n+1 connections to the couchbase cluster where n is the number of nodes in the cluster. Since our application servers are configured to create 600 PHP-FPM processes that amounts to approximately 8000 connections for our 13 node cluster. Thankfully, in production, we only see it reach around 6000 connections.

How are others addressing this issue? We do have persistent connections turned on.


#2

You should pool your connections to increase speed and reduce the number of port 8091 calls.

This post talks about it. http://www.couchbase.com/forums/thread/php-sdk-connection-pooling

Also I would recommend you do a shuffle command to your cb_array so not all connections go to the same server for the vbucket map.

EX.
$cb_array = array(‘1.1.1.1:8091’,‘2.2.2.2:8091’,‘3.3.3.3;8091’);
shuffle($cb_array):
$cb = new couchbase($cb_array,’’,‘password’,‘bucket_name’,true);


#3

Hi There,

This was quite a common problem for people using Couchbase with FPM & NGINX.

I wrote a blog addressing the issue and giving you the solution here:

http://blog.couchbase.com/using-nginx-php-fpm-couchbase-–-how-and-why

Hope this helps!

Robin.


#4

I saw this article. The config cache is a good idea unfortunately we’re not ready to upgrade php-ext-couchbase yet. Thanks for the response.


#5

Do you have experience using the Moxi component (I haven’t researched it yet)? I was just curious if it would require code changes.


#6

As you define great functions with php as couchbase which is very important for programmers and other students learning programing. Now get writing custom i was reading this and bring professionalism in your documents. You can get these services for preparing your assignments.


#7

PHP is considered very comprehensive language for developing web based programs. It is very important to understand the functions and properties of this language and scripts mentioned by you is easy to understand as well as apply it with freedom. For writing assistance write my paper for me is making it easy to prepare any assignment on time.