Sha256: cdbca6ab1280d44ca570228f11ca978d116594e8c1950bcacbcff242b3ef9ff4

Contents?: true

Size: 1.54 KB

Versions: 8

Compression:

Stored size: 1.54 KB

Contents

# Jobs Autoscaling

This [inst-jobs](https://github.com/instructure/inst-jobs) plugin enables
autoscaling of job worker pools using AWS Autoscaling Groups.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'inst-jobs-autoscaling'
```

## Usage

Before using the plugin you'll need to configure your jobs workers to run as an
AWS ASG. This typically means creating an AMI containing your application's
code, and then setting scaleup/scaledown actions based on either CPU or job
queue length.

Using this plugin requires configuring inst-jobs to use the ParentProcess
WorkQueue implementation, which is not currently the default. Add to your
`delayed_jobs.yml` file:

```yaml
production:
  work_queue: parent_process
  workers: ...
```

If jobs aren't configured to use `parent_process` this plugin will still run,
but do nothing. This allows easily switching between work queue implementations
while `parent_process` is still experimental.

To enable the plugin you'll need to provide the ASG name to the app via an ENV
var or other means, and add a line in an application initializer:

```ruby
require 'jobs_autoscaling'
action = JobsAutoscaling::AwsAction.new(asg_name: "my_asg_name")
autoscaler = JobsAutoscaling::Monitor.new(action: action)
autoscaler.activate!
```

To just log what actions would be taken, rather than make actual ASG API calls,
use the `LoggerAction`:

```ruby
action = JobsAutoscaling::LoggerAction.new
```

## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
inst-jobs-autoscaling-2.1.1 README.md
inst-jobs-autoscaling-2.1.0 README.md
inst-jobs-autoscaling-2.0.0 README.md
inst-jobs-autoscaling-1.0.5 README.md
inst-jobs-autoscaling-1.0.4 README.md
inst-jobs-autoscaling-1.0.3 README.md
inst-jobs-autoscaling-1.0.2 README.md
inst-jobs-autoscaling-1.0.1 README.md