![](/img/trans.png)
[英]How to increase the connection timeout for mysql connection from c# application?
[英]How to increase connection timeout in rails?
我收到錯誤消息,因為"could not obtain a database connection within 5.000 seconds (waited 5.000 seconds)"
。 我試圖通過在database.yml文件中添加超時字段來將超時增加到10秒,如下所示。
adapter: mysql2
encoding: utf8
pool: 10
timeout: 10000
username: root
password: root
在將超時添加到10秒后,我希望獲得10秒的超時,但是仍然獲得5秒的超時。 似乎超時設置不正確。
設置中的超時控制數據庫連接本身的超時,但是由於所有10個設備都忙於5秒鍾,因此您無法在Rails上獲取錯誤,導致無法從池中獲得空閑連接
嘗試增加池大小。 還要考慮慢速查詢
對於池超時-使用checkout_timeout
設置
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.