问题
I've done a load test against Google Cloud Bigtable by making a dummy web app that handle requests for writing and reading data to and from Bigtable. At the beginning, I was only using a single Bigtable connection as a singleton and reusing it across all threads (requests). When I increased the number of requests, I noticed that the performance was getting slower. Somehow, instead of increasing the number of nodes, I got the idea of making multiple Bigtable connections and just randomly assigning them to any thread and I got an increase in performance.
Is connection pooling for Google Cloud Bigtable on the client side necessary? E.g. like making several connections on app startup? Is that common? Is that safe? If it is okay, is there any connection pool implementation for Google Cloud Bigtable?
Thanks!
回答1:
I would suggest using a single Connection. It's meant to be used as a singleton. Please create a bug in https://github.com/googleapis/cloud-bigtable-client with more details about your use case so that we can fix the performance for your use case.
来源:https://stackoverflow.com/questions/45184510/google-cloud-bigtable-client-connection-pooling