We are using php-fpm with Nginx. Every request to the server is opening a new bucket. The couchbase documentation says not to do this. How can I open a bucket once and then reuse that bucket across all pages?
The trick to reusing server connections is to pass an identical connection string to your new CouchbaseCluster() each time. As long as you are passing an identical connection string and you have php-fpm configured to reuse php instances then your connections will be cached and reused. Note that cacheing your Couchbase object anywhere will not behave as you expect as there are native resources that are needed to back those objects.