sidekiq-tamer 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/Gemfile.lock +1 -1
- data/README.md +10 -7
- data/lib/sidekiq_tamer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2adba0f73b751d199957c599296ec1cbcc92dae6c83129f0269aa0b4bced7ff0
|
4
|
+
data.tar.gz: 29db51d3795b45a596773cba3a504d7b2c9d466d1cf332b0b29e028fa76b02fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d2c99801c6cc9c8bf3bd56419c3ce5cc6c55c56f79ef6097afd78c6ce83fcb61ed21c29eef1d33b2fd008975e98437750076606ec5fed47a1826c731599691f
|
7
|
+
data.tar.gz: c07175327b97edb15f1a39dbaa65eba048d9887769e26b282efc0dbbcf09f54b76fc044e97d42e8f2cd761ee7f084def477e92fc992018fb1b4558090f8712a8
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
#
|
2
|
-
Do you ever worry about your Sidekiq jobs consuming too many resources, causing your system to slow down or even crash? When you don't have specific throttling requirements,
|
1
|
+
# SidekiqTamer
|
2
|
+
Do you ever worry about your Sidekiq jobs consuming too many resources, causing your system to slow down or even crash? When you don't have specific throttling requirements, SidekiqTamer can help you to easily protect your resources and prevent them from being overwhelmed by Sidekiq overscaling.
|
3
3
|
|
4
4
|
## Installation
|
5
|
-
Getting started with
|
5
|
+
Getting started with SidekiqTamer is a breeze. Simply add the gem to your Gemfile:
|
6
6
|
|
7
7
|
```ruby
|
8
8
|
gem 'sidekiq-tamer'
|
@@ -11,14 +11,17 @@ gem 'sidekiq-tamer'
|
|
11
11
|
Then, run bundle install or gem install sidekiq-tamer to install the gem.
|
12
12
|
|
13
13
|
## Usage
|
14
|
-
With
|
14
|
+
With SidekiqTamer, you can delay the execution of jobs that depend on particular resources when those are on an stressed state. While SidekiqTamer was initially built to help handling the load over MongoDB, it is actually a generic framework which you can use to protect any kind of resource, such as a database or an API endpoint.
|
15
15
|
|
16
16
|
### Protecting a MongoDB cluster
|
17
|
-
|
17
|
+
SidekiqTamer includes an off-the-shelf implementation to handle MongoDB clusters. To use it, simply execute the following line during your initialization code:
|
18
18
|
|
19
19
|
```ruby
|
20
20
|
SidekiqTamer::Mongo::Configuration.setup(user: 'your_user', password: 'your_password')
|
21
21
|
```
|
22
|
+
|
23
|
+
The MongoDB monitoring relies on inspecting the read and write available tickets and whenever those are below a certain configurable threshold, the server is assumed to be on an unhealthy state and therefore jobs will be pushed back until health is recovered.
|
24
|
+
|
22
25
|
Note that in order for the health monitor to work, you'll need to supply a user that has the clusterMonitor role enabled on the admin database of your cluster.
|
23
26
|
|
24
27
|
### Defining Your Own Resources
|
@@ -46,10 +49,10 @@ Then, add an instance of your new class to the resource vault:
|
|
46
49
|
SidekiqTamer::Resource::Vault.add_resources(MyDatabaseResource.new)
|
47
50
|
```
|
48
51
|
|
49
|
-
Now, whenever the `is_healthy?` method returns false for a job that depends on this resource, the Sidekiq middleware that
|
52
|
+
Now, whenever the `is_healthy?` method returns false for a job that depends on this resource, the Sidekiq middleware that SidekiqTamer introduces will raise an exception, causing the job to be retried later.
|
50
53
|
|
51
54
|
## Contributing
|
52
55
|
We welcome bug reports and pull requests on GitHub at https://github.com/leandrogoe/sidekiq-tamer.
|
53
56
|
|
54
57
|
## License
|
55
|
-
|
58
|
+
SidekiqTamer is available as open source under the terms of the MIT License.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-tamer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leandro Gomez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sidekiq
|