Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure a specific processor_host for Cloudtasker::Cron::Schedule #42

Open
wagnerpereira opened this issue Sep 24, 2021 · 3 comments
Open
Labels
enhancement New feature or request

Comments

@wagnerpereira
Copy link

wagnerpereira commented Sep 24, 2021

Use case:

Have one Cloud Run service for user actions and ActiveJob Tasks, and another Cloud Run Service with more CPU and Memory resources to run heavier schedule tasks.

application_service => 01 vcpu 512M
application_cron_tasks => 04 vcpu 8gb RAM

For ActiveJob tasks, use config.processor_host = "application_service.run.app"

For Cloudtasker::Cron::Schedule ( Workers ), use processor_host = "application_cron_tasks.run.app"

Would it be possible?

@alachaum
Copy link
Member

@wagnerpereira At the moment it is not possible. However what is possible is to have one Cloud Run service for "regular" web traffic (user actions, API requests) and one Cloud Run service for background jobs.

It could be made possible to specify the processor host on each worker. That is the most elegant approach I believe.

class HeavyCronWorker
  include Cloudtasker::Worker

  cloudtasker_options processor_host: 'heavy-worker.run.app'

  def perform(some_arg)
    #... some heavy work
  end
end

Feel free to submit a PR. From a config perspective it should be similar to max_retries (configurable at global level or worker level).

@alachaum alachaum added the enhancement New feature or request label Sep 29, 2021
@wagnerpereira
Copy link
Author

@alachaum Thanks for all the work done in cloudtasker to help Rails apps runs smooth in Cloud Run. ❤️

I will try this approach. I'm moving large background schedule workloads from sidekiq to Cloud Tasks using cloudtasker.

02 months in production without any issues until now, nut now I have huge schedule tasks that need a higher configuration on cloud run service instance.

Thanks again!

@alachaum
Copy link
Member

No worries! Don't hesitate to let me know if you struggle with this PR - I'm happy to help 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants