The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
TypeErrorNone

求助! go mysql 创建的连接数超出设置的最大值

  •  
  •   TypeErrorNone · Feb 17, 2020 · 2500 views
    This topic created in 2306 days ago, the information mentioned may be changed or developed.

    3iA8RH.png

    创建了 5000 个协程通过一个对象去操作数据库。 已经设置了最大连接数是 50,通过 show processlist,发现创建的连接数远远大于设置的,请问这是为什么?

    Supplement 1  ·  Mar 14, 2020
    求助求助,有人知道吗
    3 replies    2020-02-20 18:15:36 +08:00
    Mitt
        1
    Mitt  
       Feb 18, 2020
    连接池了解一下
    TypeErrorNone
        2
    TypeErrorNone  
    OP
       Feb 18, 2020 via iPhone
    用了链接迟,上面设置的最大链接数就是针对链接池的
    lance6716
        3
    lance6716  
       Feb 20, 2020
    用了连接池 maxOpenConns 也是 50 的吧。是不是代码里没用同一个连接池
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3044 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 54ms · UTC 14:23 · PVG 22:23 · LAX 07:23 · JFK 10:23
    ♥ Do have faith in what you're doing.