worker_killer 0.1.0.19839 → 0.1.0.19840
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -10
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0320c08d8cf006010822dc1fe800d5967028ed491de7b832300ccbc550b325b
|
4
|
+
data.tar.gz: 1849c4ec03a678cbb1653b1b26fae06f6c59a481c757b545cda27a75735f79c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfb3ad12cf879083ff6fa3cee357c2373d93265ae547f864d826b04b66b2c1a0f53e94d3186c553490beb7f2a91b9108542d43d19c0d1bbd72df66ad3310268a
|
7
|
+
data.tar.gz: 92b2afea5aee01a08054bab270498a4bd58bb9b8287bcc42cbe3bc9b67a3d70f7a0267a1decd9f97ac4165ca9ca3525bd32c39af9fc8ae4193d68c5dfd7c12b3
|
data/README.md
CHANGED
@@ -16,21 +16,24 @@ Planned:
|
|
16
16
|
# Install
|
17
17
|
|
18
18
|
No external process like `god` is required. Just install one gem: `worker-killer`.
|
19
|
-
|
20
|
-
|
19
|
+
```ruby
|
20
|
+
gem 'worker-killer'
|
21
|
+
```
|
21
22
|
|
22
23
|
# Usage
|
23
24
|
|
24
25
|
Add these lines to your `config.ru` or `application.rb`. (These lines should be added above the `require ::File.expand_path('../config/environment', __FILE__)` line.
|
25
26
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
27
|
+
```ruby
|
28
|
+
# self-process killer
|
29
|
+
require 'worker_killer/middleware'
|
30
|
+
|
31
|
+
# Max requests per worker
|
32
|
+
config.middleware.insert_before(Rack::Sendfile, WorkerKiller::Middleware::RequestsLimiter, min: 4096, max: 5120)
|
33
|
+
|
34
|
+
# Max memory size (RSS) per worker
|
35
|
+
config.middleware.insert_before(Rack::Sendfile, WorkerKiller::Middleware::OOMLimiter, min: 300 * (1024**2), max: 400 * (1024**2))
|
36
|
+
```
|
34
37
|
|
35
38
|
This gem provides two modules: WorkerKiller::CountLimiter and WorkerKiller::MemoryLimiter and some Rack integration.
|
36
39
|
|