Sidekiq-在5.000秒内无法获得数据库连接 [英] Sidekiq - could not obtain a database connection within 5.000 seconds
本文介绍了Sidekiq-在5.000秒内无法获得数据库连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在OS X上开发时,我在Rails 4和Sidekiq上收到以下警告
I get the following warning with Rails 4 and Sidekiq on os x on development
10:13:39 worker.1 | 2014-09-22T07:13:39.857Z 86981 TID-oug0oog10 WARN: could not obtain a database connection within 5.000 seconds (waited 5.002 seconds)
10:13:39 worker.1 | 2014-09-22T07:13:39.857Z 86981 TID-oug0oog10 WARN: /Users/me/.rvm/gems/ruby-2.1.3/gems/activerecord-4.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:190:in `block in wait_poll'
我读了其他回答说减少并发性给予sidekiq以允许更多其他事情,但
I read other answers that say to reduce the concurrency I give to sidekiq to allow more for other things, but with
worker: bundle exec sidekiq -c 10
它仍然不起作用
我正在使用Postgres.app
I am using Postgres.app
本地主机中的数字/并发应该是什么?
What should the numbers/concurrency be in localhost?
推荐答案
我将数据库池设置为sidekiq并发,现在它对我有用。
I set database pool to sidekiq concurrency and now it works for me.
bundle exec sidekiq -c 10
在我的数据库中。yml
in my database.yml
development:
adapter: postgresql
...
host: localhost
pool: 10
这篇关于Sidekiq-在5.000秒内无法获得数据库连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文