I've got a big project running on MRI Ruby and Rails 3.2 on Passenger with an app that was not designed with thread-safety in mind and this app handles mailings through DelayedJob and the database is paying a heavy price for this.
Some possible problems are mentioned in the sidekiq railscast http://railscasts.com/episodes/366-sidekiq including:
- database connection limit (if using thread-pool of 1, the db connection limit should be doubled)
- thread-safety (this is probably the show stopper)
- fiber-safety? Is this an issue with AR?
So, the question are:
- how viable is it to make a big project thread-safe enough for the mail generation to work in threads inside the passenger process? (mailings are complex enough to depend on AR)
- same question when using sidekiq, "how viable is it to make a big project thread-safe enough for the mail generation to work using sidekiq? (mailings are complex enough to depend on AR)"
- apart from db connection limit and thread-safety issues, is there anything else to consider or less obvious got'chas I failed to forsee?