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

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.

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

This post talks about it.

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.

$cb_array = array(‘’,‘’,‘;8091’);
$cb = new couchbase($cb_array,’’,‘password’,‘bucket_name’,true);

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:–-how-and-why

Hope this helps!


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.

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

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.

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.