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.
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:
Hope this helps!
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.
$cb_array = array('126.96.36.199:8091','188.8.131.52:8091','184.108.40.206;8091');
$cb = new couchbase($cb_array,'','password','bucket_name',true);