Git Product home page Git Product logo

Comments (2)

PatrickTulskie avatar PatrickTulskie commented on May 28, 2024 1

The way I have been running it in production at scale is to have a decoupled redis database living outside of the k8s cluster and then just let the autoscaler do its thing depending on workloads. Usually I work off CPU or Memory depending on the system, but there are also ways to autoscale based on number of jobs in a queue for example.

The way I structure the setup is like this:

  • Redis living on its own server. If you use AWS, you can use Elasticache just fine.
  • I use resque-pool to manage which workers startup for each queue.
  • Depending on your unit of separation, each one starts up resque pool which then forks off each of the workers. If you're using k8s, it would be pods. If you use bare metal or some other kind of VPS instance, each one would start up with a finite amount of workers.
  • Servers/pods/instances can die off but the state of the queue is tracked in redis externally so you can just add new boxes into rotation.
  • Redis also tracks the state of the workers, so if a resque main process is killed off and it hasn't had a chance to report in, you may have an incorrect number of workers in your resque dashboard. To get around that, I run a script that periodically cleans them up. That script looks something like this:
Resque.workers.each do |w|
  w.unregister_worker if w.processing['run_at'] && Time.now - w.processing['run_at'].to_time > 1000
end

Hope that answers your questions!

from resque.

a-schaefers avatar a-schaefers commented on May 28, 2024

Does the master process require it be running monolith style to control all the workers across various nodes? Is there a way to configure this (not kubernetes) or is it all just going to be ok, spinning this thing up over and over again, with various master processes that are only aware of their own nodes?

is any state contained within the resque master process or does it keep everything that other resque containers might need to know in redis just by default?

from resque.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.