简体   繁体   English

Heroku上的Mongoid连接池

[英]Mongoid connection pool on heroku

I have an application deployed on heroku. 我在heroku上部署了一个应用程序。 Sometimes background process raises the following error: "The task failed because of an error: could not obtain connection within 5.0 seconds. The max pool size is currently 1; consider increasing the pool size or timeout." 有时后台进程会引发以下错误:“由于错误,任务失败:在5.0秒内无法获得连接。最大池大小当前为1;请考虑增加池大小或超时。”

How can I increase pool size or the timeout ? 如何增加pool sizetimeout Unfortunately I can't find anything useful in Mongoid documentation and sources. 不幸的是,我在Mongoid文档和资源中找不到有用的东西。

You can specify the pool size in mongoid.yml : 您可以在mongoid.yml指定池大小:

production:
    pool_size: 5

Details here . 详细信息在这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM