I have Rails (4.2.6) App where I use Thread(s) for background data processing caused by the Rufus::Scheduler. I have the working app in the development env, but when I move it to production on nginx + passenger I get exceptions ActiveRecord::ConnectionNotEstablished, even without sufficient load.
All calls for ActiveRecord::Base's descendants that performing from Threads - are wrapped into
ActiveRecord::Base.connection_pool.with_connection{}
I've never used multi threaded environments before, but after some surveying of the problem, I suggest that probably this is the matter.
Is it reasonable to try it under JRuby and what containter is prefereable?
The host system is Ubuntu 14.04 x86_64.