production.log 日志
ActiveRecord::ConnectionTimeoutError (could not obtain a database connection within 5.000 seconds (waited 5.000 seconds)):
activerecord (4.1.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:190:in `block in wait_poll'
activerecord (4.1.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:181:in `loop'
activerecord (4.1.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:181:in `wait_poll'
activerecord (4.1.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:136:in `block in poll'
/usr/local/rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
activerecord (4.1.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:146:in `synchronize'
activerecord (4.1.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:134:in `poll'
activerecord (4.1.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:418:in `acquire_connection'
activerecord (4.1.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:351:in `block in checkout'
/usr/local/rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
nginx 配置
client_max_body_size 1000m;
passenger_max_pool_size 10;
server {
listen 80;
server_name localhost;
location / {
root /we/test/public;
index index.html index.htm;
passenger_enabled on;
}
}
database.yml
development: &development
adapter: mysql2
encoding: utf8
host: localhost
database: mall
pool: 10
username: test
password: 123456
reconnect: true
timeout: 5000
sidekiq.yml
production:
:concurrency: 10
尝试过的解决办法: 把 pool 加大,config.ru 添加
use ActiveRecord::ConnectionAdapters::ConnectionManagement
都没有解决此问题,不定时的就会出现这个报错,找不到具体引发的原因 求教