We have a Rails application, which interfaces with iOS and web clients. Currently we are spawning subprocesses from a Rails controller using Open3 to retrieve and send data to a chat server, which running node.js with MongoDB. However, after a few days in production, we found out that the subprocesses made our Rails app very slow and increased the CPU usage by a lot.
We know that the long-term solution is to wrap our chat server with a REST API framework such as Express. But for the short term, we'd like to have a quick fix on how to make our subprocesses execute faster (spawning, execution etc.).
Any ideas?