Leopd
Leopd

Reputation: 42779

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.

Upvotes: 5

Views: 2770

Answers (1)

Wizard of Ogz
Wizard of Ogz

Reputation: 12643

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

Upvotes: 5

Related Questions