Beego: 没有释放prepare

Created on 3 Sep 2019  ·  11Comments  ·  Source: astaxie/beego

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go and beego are you using (bee version)?
    最新版本
  2. What operating system and processor architecture are you using (go env)?
    go version go1.12.6 darwin/amd64

  3. What did you do?
    If possible, provide a recipe for reproducing the error.
    A complete runnable program is good.

  4. What did you expect to see?

在每一次重启服务的时候发现mysql的Com_stmt_prepare一直累加,但是Com_stmt_close却很少。
当两个差集太大的时候,就会导致数据库连接不上,最终报错
”Error 1461: Can't create more than max_prepared_stmt_count statements (current value: 16382)“
我的数据库的sql是show global status like 'com_stmt%';
结果是这样的,这个时候差集不大。当他到达一个极限就会报错

image

  1. What did you see instead?
areorm kinbug

Most helpful comment

Restore to previous versions-v1.11.1

All 11 comments

我司昨日升级最新版后今日也出现这个问题:Can't create more than max_prepared_stmt_count statements (current value: 16382)
image

1.go version go1.12.9 linux/amd64

2.beego version v1.12.0

Com_stmt_prepare 创建多,Com_stmt_close 少。

Restore to previous versions-v1.11.1

@Danceofdeath will it be fixed in next version?

maybe,it depends on the author

beego v1.12.0版本存在这个问题,v1.11.1版本OK

@echoloveyou @ikingme orm里面用了哪些操作.我去查下

@DennisMao 我这边只是用了查询 。Raw().QueryRow()和Raw().QueryRows()。而且发现,一个连接如果不断开 ,即使没有sql在执行,也会占用50-60个prepare不释放

我们也遇到了, 十一过的可惨了

1.12.0版本遇到了这个问题,幸运的是,在上线之前发现了。

image
怎么释放这个呢

今天也遇到了,一旦启动就往上飙。

Was this page helpful?
0 / 5 - 0 ratings