The auto-scaling platform enables better auto scaling between the three type of jobs i.e priority, misc, and higher.
- Ruby 2.7.3
- Rails 6.1.4.1
- sqlite3
- sidekiq 6.2.2
- Install deps using
bundle install
- Copy
config/application.example.yml
toconfig/application.yml
after runningbundle exec figaro install
- Setup DB using
rails db:setup
- Run
bundle exec sidekiq
at project root and go to rake tasks and saw rake files
rubocop
- Currently there is 10 threads for single worker instance
- Three types of jobs priority, misc and heavy
- Autoscalar run to manage the priority jobs if it is found in a queue and it will create new worker instance.
If no priority job exists then our autoscalar task run to verify and remove the extra obsolete running worker instances.
Example Considerations:
- If all 10 threads in a worker are busy executing jobs 1.e 3 priority jobs, 3 misc jobs, 4 heavy jobs.
- If new jobs are enqueued within 5 minutes, auto-scalar will initiate a new worker.
- We have a rake task that terminates idle instances.
- rake autoscale:create_and_enqueue_jobs
- rake autoscale:scale_servers
- rake autoscale:terminate_idle_instances