duanhe6718 2015-02-19 11:31
浏览 562
已采纳

使用mongodb的Golang数据库连接池

In the past few days I have been making some tests scenarios on a performance test project, where I have a combination of golang + mongodb and the results where really impressive, however, when you send a multiple request, the performance drops dramatically and I guess the problem because there is no connection pooling(maybe?), I am a java developer and the mongodb java driver for mongodb has implicitly a connection pool.

So is there a connection pooling or I have ti create one on my own ?

Thanks

  • 写回答

1条回答 默认 最新

  • dongzai2952 2015-02-19 12:34
    关注

    the performance drops dramatically and I guess the problem because there is no connection pooling (maybe?)

    Profile and ye shall succeed. Wild guesses will only waste your time.

    Read also: Connections pool in Go mgo package

    If you're using the amazing mgo driver, then you have auto-managed connection pooling built-in.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

    报告相同问题?

    悬赏问题

    • ¥15 求一个智能家居控制的代码
    • ¥15 ad软件 pcb布线pcb规则约束编辑器where the object matpcb布线pcb规则约束编辑器where the object matchs怎么没有+15v只有no net
    • ¥15 虚拟机vmnet8 nat模式可以ping通主机,主机也能ping通虚拟机,但是vmnet8一直未识别怎么解决,其次诊断结果就是默认网关不可用
    • ¥20 求各位能用我能理解的话回答超级简单的一些问题
    • ¥15 yolov5双目识别输出坐标代码报错
    • ¥15 这个代码有什么语法错误
    • ¥15 给予STM32按键中断与串口通信
    • ¥15 使用QT实现can通信
    • ¥15 关于sp验证的一些东西,求告知如何解决,
    • ¥35 关于#javascript#的问题:但是我写的只能接码数字和字符,帮我写一个解码JS问题