Search code examples
ruby-on-rails-4jrubysidekiq

Jruby - rails app and sidekiq on same jvm instance


This a silly question, but couldn't find an answer. I'm running a rails app on jruby, and I use sidekiq to proccess background jobs. Do I really have to run sidekiq in another instance of jvm (is that what happens running bundle exec sidekiq) ?

Jruby is too much RAM consuming so this is not possible with my aws t2.micro instance.


Solution

  • Due to high memory consumption your AWS microinstance will choke eventually. There is one way to have both Ruby App and Background process sidekiq running.

    • Either you can boot another EC2 micro with sidekiq. You app instance and sidekiq server will share the same Redis instance. So, your BG processing wont be disrupted.

    • Another way is to bootup a Heroku free dyno.

    • Or you can move to CRuby or MRI.

    hope this helps