unicorn-worker-killer 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/ChangeLog +3 -0
- data/Gemfile +1 -1
- data/VERSION +1 -1
- data/lib/unicorn/worker_killer.rb +7 -3
- metadata +9 -15
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: bc54add3d9c196fd10f539f76d06df569328f65b
|
4
|
+
data.tar.gz: 373a33dc80ec2565e3ac212e95ea5cf547953fa9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ac4c3c6ebceed0ed1c6e04e1d967e6e86315c51847a629b35a7a0a1a3a5b1889982f6f04e113db2806d20daed30b2ea4e102bfaff1820d46bfce9f782c0850e1
|
7
|
+
data.tar.gz: 1474e97424f25807f66c917fc949c3376a1d8a849a78958ba13ee9822b00b4bca3f59c0da208a9ed3ebd4c85fd03d0c0ebde2c92c4a60c5e08cc9de6fed732b3
|
data/ChangeLog
CHANGED
data/Gemfile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.3
|
@@ -38,13 +38,17 @@ module Unicorn::WorkerKiller
|
|
38
38
|
end
|
39
39
|
app # pretend to be Rack middleware since it was in the past
|
40
40
|
end
|
41
|
-
|
41
|
+
|
42
|
+
def randomize(integer)
|
43
|
+
RUBY_VERSION > "1.9" ? Random.rand(integer) : rand(integer)
|
44
|
+
end
|
45
|
+
|
42
46
|
def process_client(client)
|
43
47
|
super(client) # Unicorn::HttpServer#process_client
|
44
48
|
return if @_worker_memory_limit_min == 0 && @_worker_memory_limit_max == 0
|
45
49
|
|
46
50
|
@_worker_process_start ||= Time.now
|
47
|
-
@_worker_memory_limit ||= @_worker_memory_limit_min +
|
51
|
+
@_worker_memory_limit ||= @_worker_memory_limit_min + randomize(@_worker_memory_limit_max - @_worker_memory_limit_min + 1)
|
48
52
|
@_worker_check_count += 1
|
49
53
|
if @_worker_check_count % @_worker_check_cycle == 0
|
50
54
|
rss = _worker_rss()
|
@@ -108,7 +112,7 @@ module Unicorn::WorkerKiller
|
|
108
112
|
return if @_worker_max_requests_min == 0 && @_worker_max_requests_max == 0
|
109
113
|
|
110
114
|
@_worker_process_start ||= Time.now
|
111
|
-
@_worker_cur_requests ||= @_worker_max_requests_min +
|
115
|
+
@_worker_cur_requests ||= @_worker_max_requests_min + randomize(@_worker_max_requests_max - @_worker_max_requests_min + 1)
|
112
116
|
@_worker_max_requests ||= @_worker_cur_requests
|
113
117
|
if (@_worker_cur_requests -= 1) <= 0
|
114
118
|
logger.warn "#{self}: worker (pid: #{Process.pid}) exceeds max number of requests (limit: #{@_worker_max_requests})"
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unicorn-worker-killer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
5
|
-
prerelease:
|
4
|
+
version: 0.3.3
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Kazuki Ohta
|
@@ -10,12 +9,11 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-28 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: unicorn
|
17
16
|
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
17
|
requirements:
|
20
18
|
- - ~>
|
21
19
|
- !ruby/object:Gem::Version
|
@@ -23,7 +21,6 @@ dependencies:
|
|
23
21
|
type: :runtime
|
24
22
|
prerelease: false
|
25
23
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
24
|
requirements:
|
28
25
|
- - ~>
|
29
26
|
- !ruby/object:Gem::Version
|
@@ -31,17 +28,15 @@ dependencies:
|
|
31
28
|
- !ruby/object:Gem::Dependency
|
32
29
|
name: rake
|
33
30
|
requirement: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
31
|
requirements:
|
36
|
-
- -
|
32
|
+
- - '>='
|
37
33
|
- !ruby/object:Gem::Version
|
38
34
|
version: 0.9.2
|
39
35
|
type: :development
|
40
36
|
prerelease: false
|
41
37
|
version_requirements: !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
38
|
requirements:
|
44
|
-
- -
|
39
|
+
- - '>='
|
45
40
|
- !ruby/object:Gem::Version
|
46
41
|
version: 0.9.2
|
47
42
|
description: Kill unicorn workers by memory and request counts
|
@@ -63,26 +58,25 @@ files:
|
|
63
58
|
- unicorn-worker-killer.gemspec
|
64
59
|
homepage: https://github.com/kzk/unicorn-worker-killer
|
65
60
|
licenses: []
|
61
|
+
metadata: {}
|
66
62
|
post_install_message:
|
67
63
|
rdoc_options: []
|
68
64
|
require_paths:
|
69
65
|
- lib
|
70
66
|
required_ruby_version: !ruby/object:Gem::Requirement
|
71
|
-
none: false
|
72
67
|
requirements:
|
73
|
-
- -
|
68
|
+
- - '>='
|
74
69
|
- !ruby/object:Gem::Version
|
75
70
|
version: '0'
|
76
71
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
|
-
none: false
|
78
72
|
requirements:
|
79
|
-
- -
|
73
|
+
- - '>='
|
80
74
|
- !ruby/object:Gem::Version
|
81
75
|
version: '0'
|
82
76
|
requirements: []
|
83
77
|
rubyforge_project:
|
84
|
-
rubygems_version:
|
78
|
+
rubygems_version: 2.0.0
|
85
79
|
signing_key:
|
86
|
-
specification_version:
|
80
|
+
specification_version: 4
|
87
81
|
summary: Kill unicorn workers by memory and request counts
|
88
82
|
test_files: []
|