-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Too Many Prepare Statement #4025
Conversation
更新这个版本后,Prepared_stmt_count 资源未释放问题貌似还没解决 |
服务器几台,beego版本多少 |
我们现在设置的上限是,单个orm实例上限是1000。如果你单机存在多个orm实例,又或者是分布式系统部署大量实例,则按照比例相乘则是数量上限。 |
beego版本12.2,单机5个go进程使用,两台机器 |
5 * 2 * 1000 = 10000 |
我将上限调到25000 ,目前已经到了 19319 |
是否存在多库在同一台 mysql 实例的情况,如果是这样的话,有可能超过限制 |
不是算goroutine。是算DB实例。即你创建了多少个DB实例。比如一台机器上创建了n个DB实例,那么上限就是 n * 1000,如果有m台机器,就是m * n * 1000。 |
看代码Beego Prepared Statement是在DB级别Cache的吧,但MySQL Server Prepared Statement的Id生成是在连接级别生成的,不同连接Id会有重复吧,所以是不是应该改为连接级别Cache啊? https://github.com/mysql/mysql-server/blob/8.0/sql/sql_class.h#L2169 |
而且Beego Raw SQL能不能不用Prepared Statement啊? |
我考虑一下这个问题。 |
判断一下sql语句中有没有字符?如果没有就不用Prepared Statement. |
Close #3791
Close #3737
Close #3827