和puma连用,如果报Sequel::PoolTimeout错误,可能是的puma -t的max_threads的值大于了max_connections的值(默认为4, 见 http://sequel.jeremyevans.net/rdoc/classes/Sequel/ThreadedConnectionPool.html ).
同样, puma -w的值大于了pool,也会报同样的问题: ActiveRecord::ConnectionTimeoutError - could not obtain a database connection within 5 seconds. The max pool size is currently 5; consider increasing it
Sneakers里面的configuration中有threads数量, default value is 10.
So sneakers is multiple processes with multiple threads each process.
Please make sure the database connection pools of ActiveRecord has been set to the same value of threads in configuration of Sneakers(default should be 10)!
Refus_scheduler is one process with multiple threads.
.cron etc will create a new thread.
So database connections
pool should be set to at least the threads count.
You should count the threads count by yourself.