Google Cloud Bigtable客户端连接池 [英] Google Cloud Bigtable Client Connection Pooling

查看:94
本文介绍了Google Cloud Bigtable客户端连接池的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过制作一个虚拟的Web应用程序对Google Cloud Bigtable进行了负载测试,该应用程序可以处理向Bigtable写入数据和从Bigtable读取数据的请求.刚开始时,我只使用一个Bigtable连接作为一个单例,并在所有线程(请求)中重用它.当我增加请求数量时,我注意到性能越来越慢.不知何故,我没有增加节点数,而是想到了建立多个Bigtable连接,然后将它们随机分配给任何线程,从而提高了性能.

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.

客户端上的Google Cloud Bigtable连接池是否必要?例如.喜欢在应用启动时建立多个连接?那很常见吗?这样安全吗?如果可以,那么Google Cloud Bigtable是否有任何连接池实现?

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?

谢谢!

推荐答案

我建议使用单个Connection.它应作为单例使用.请在 https://github.com/googleapis/cloud-bigtable-client 中创建错误a>包含有关您的用例的更多详细信息,以便我们修正您的用例的性能.

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.

这篇关于Google Cloud Bigtable客户端连接池的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆