Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multi-threading ruby workers on heroku

I have a ruby app on Heroku that needs to do some background processing with worker threads. I haven't decided between Delayed Job and Resque yet, but the answer to this question could sway me. The background jobs will be mostly waiting on external APIs (facebook, twitter, etc) so they will be making very low utilization of CPU.

Is there some way to get multiple threads with each worker dyno on heroku? Is this standard or available with a plugin for DJ or Resque? Or a foreman config to pre-fork or something? Otherwise I'm going to be wasting a lot of money on worker dynos that are 95% sitting idle waiting for an external API.

like image 894
Leopd Avatar asked May 30 '12 15:05

Leopd


1 Answers

You might try sidekiq, which works similar to resque, but uses threads to process tasks concurrently. You can also use resque and sidekiq together.

like image 176
Wizard of Ogz Avatar answered Sep 23 '22 23:09

Wizard of Ogz