Hacker News new | ask | show | jobs
by yxhuvud 1095 days ago
In the case of rails, using multiple threads will checkout extra database connections.

Database connections are often a limited resource though, so it is not without peril.

1 comments

Well yes. That's how a connection pool works. You're not really supposed to be creating extra threads inside a request. Things can get wonky unless you know what you're doing. Best to use ActiveJob, which will have its own context even if it uses threads underneath.