worker_roulette 0.1.12 → 0.1.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 18fac5a135506a2e24d37a0d7c64a5e38deb5958
4
- data.tar.gz: 8805d12a5a60b90353baf73a459399e41c0a7254
3
+ metadata.gz: 0ccac947b3e9fe9ac48a645af9a741d3375fd707
4
+ data.tar.gz: 739b595bb367adae6156dd06ebb1588de9e6f4cc
5
5
  SHA512:
6
- metadata.gz: a924c28f238c090ceaaab24ce7c0d1c247711f0e253c1ab63ede4b8515fc7eddf2d1139aba6c8abf570d2c0270a1bba3c772dd3eee9c78826f63197b65220eb5
7
- data.tar.gz: 9e8dc7891d83aad2e8ed176a25588cd0fd32ee853e7b7819cb21afdf8eab311184ccd52c5133d36e72e87ec6fe323c25051e704e6ab291e375b1df516de8f688
6
+ metadata.gz: dfffcf5ab8772c0d77a32570a9336771c6631e223948b02c69491f294773cb99636b72490bc5cf43f6e81cb58a615f641b3f914c450ebda890e5c19a701251d1
7
+ data.tar.gz: 02ee55c2d2073cac53b5214048bad24d46b08fb04457683e420c0b134ffc6f2604add70f90d594d699b8b7f2e5a33bcb045868973228da7207674ba021763e45
data/README.md CHANGED
@@ -1,6 +1,18 @@
1
1
  # WorkerRoulette
2
2
 
3
- WorkerRoulette is designed to allow large numbers of unique devices, processes, users, or whatever communicate over individual channels without messing up the order of their messages. WorkerRoulette was created to solve two otherwise hard problems. First, other messaging solutions (I'm looking at you RabbitMQ) are not designed to handle very large numbers of queues (millions); because WorkerRoulette is built on top of Redis, we have successfully tested it running with millions of queues. Second, other messaging systems assume one (or more) of three things: 1. Your message consumers know the routing key of messages they are interested in processing; 2. Your messages can wait so that only one consumer is processed at a time; 3. You love to complicated write code to put your messages back in order. Sometimes, none of these things is true and that is where WorkerRoulette comes in.
3
+ WorkerRoulette is designed to allow large numbers of unique devices, processes, users, or whatever communicate over individual channels without messing up the order of their messages.
4
+
5
+ WorkerRoulette was created to solve two otherwise hard problems:
6
+
7
+ 1) Other messaging solutions (I'm looking at you RabbitMQ) are not designed to handle very large numbers of queues (millions). Because WorkerRoulette is built on top of Redis, we have successfully tested it running (fast) with millions of queues.
8
+
9
+ 2) Other messaging systems assume one (or more) of three things:
10
+
11
+ 1. Your message consumers know the routing key of messages they are interested in processing
12
+ 2. Your messages can wait so that only one consumer is processed at a time
13
+ 3. You love to write complicated code to put your messages back in order.
14
+
15
+ Sometimes, none of these things is true and that is where WorkerRoulette comes in.
4
16
 
5
17
  WorkerRoulette lets you have thousands of competing consumers (distributed over as many machines as you'd like) processing ordered messages from millions of totally unknown message providers. It does all this and ensures that the messages sent from each message provider are processed in exactly the order it sent them.
6
18
 
@@ -74,7 +86,7 @@ Running the performance tests on my laptop, the numbers break down like this:
74
86
  - Polling: ~10,000 read-write round-trips / second
75
87
  - Manual: ~5,500 read-write round-trips / second
76
88
 
77
- To run the perf tests yourself run `bundle exec spec:perf`
89
+ To run the perf tests yourself run `bundle exec rake spec:perf`
78
90
 
79
91
  ## Redis Version
80
92
  WorkerRoulette uses Redis' lua scripting feature to acheive such high throughput and therefore requires a version of Redis that supports lua scripting (>= Redis 2.6)
@@ -1,3 +1,3 @@
1
1
  module WorkerRoulette
2
- VERSION = '0.1.12'
2
+ VERSION = '0.1.13'
3
3
  end
@@ -14,14 +14,14 @@ puts "Redis Connection Pool Size: #{REDIS_CONNECTION_POOL_SIZE}"
14
14
  times = Benchmark.bm do |x|
15
15
  x.report "#{ITERATIONS} ASync Api Read/Writes" do
16
16
  EM.run do
17
- WorkerRoulette.start(evented: true)
18
- WorkerRoulette.tradesman_connection_pool.with {|r| r.flushdb}
17
+ @roullete = WorkerRoulette::WorkerRoulette.start(evented: true)
18
+ @roullete.tradesman_connection_pool.with {|r| r.flushdb}
19
19
  @total = 0
20
- @tradesman = WorkerRoulette.tradesman
20
+ @tradesman = @roullete.tradesman
21
21
 
22
22
  ITERATIONS.times do |iteration|
23
23
  sender = 'sender_' + iteration.to_s
24
- foreman = WorkerRoulette.foreman(sender)
24
+ foreman = @roullete.foreman(sender)
25
25
  foreman.enqueue_work_order(work_order) do
26
26
  @tradesman.work_orders! do
27
27
  @total += 1
@@ -36,21 +36,21 @@ puts "#{(ITERATIONS / times.first.real).to_i} ASync Api Read/Writes per second"
36
36
  puts "#################"
37
37
  puts
38
38
 
39
- WorkerRoulette.tradesman_connection_pool.with {|r| r.flushdb}
39
+ @roullete.tradesman_connection_pool.with {|r| r.flushdb}
40
40
 
41
41
  times = Benchmark.bm do |x|
42
42
  x.report "#{ITERATIONS * 2} ASync Api Polling Read/Writes" do
43
43
  EM.run do
44
44
  @processed = 0
45
45
  @total = 0
46
- WorkerRoulette.start(evented: true)
47
- WorkerRoulette.tradesman_connection_pool.with {|r| r.flushdb}
46
+ @roullete = WorkerRoulette::WorkerRoulette.start(evented: true)
47
+ @roullete.tradesman_connection_pool.with {|r| r.flushdb}
48
48
  @total = 0
49
- @tradesman = WorkerRoulette.tradesman
49
+ @tradesman = @roullete.tradesman
50
50
  ITERATIONS.times do |iteration|
51
51
  @start ||= Time.now
52
52
  sender = 'sender_' + iteration.to_s
53
- foreman = WorkerRoulette.foreman(sender)
53
+ foreman = @roullete.foreman(sender)
54
54
  foreman.enqueue_work_order(work_order)
55
55
  end
56
56
  @tradesman.wait_for_work_orders {@processed += 1; ((@stop = Time.now) && EM.add_timer(1){EM.stop}) if @processed == (ITERATIONS - 1)}
@@ -60,28 +60,28 @@ end
60
60
  puts "#{ITERATIONS * 2 / (@stop - @start)} ASync Api Polling Read/Writes per second"
61
61
  puts "#################"
62
62
  puts
63
- WorkerRoulette.tradesman_connection_pool.with {|r| r.flushdb}
63
+ @roullete.tradesman_connection_pool.with {|r| r.flushdb}
64
64
 
65
- WorkerRoulette.start(size: REDIS_CONNECTION_POOL_SIZE, evented: false)
65
+ @roullete = WorkerRoulette::WorkerRoulette.start(size: REDIS_CONNECTION_POOL_SIZE, evented: false)
66
66
  times = Benchmark.bm do |x|
67
67
  puts x.class.name
68
68
  x.report "#{ITERATIONS} Sync Api Writes" do
69
69
  ITERATIONS.times do |iteration|
70
70
  sender = 'sender_' + iteration.to_s
71
- foreman = WorkerRoulette.foreman(sender)
71
+ foreman = @roullete.foreman(sender)
72
72
  foreman.enqueue_work_order(work_order)
73
73
  end
74
74
  end
75
- WorkerRoulette.tradesman_connection_pool.with {|r| r.flushdb}
75
+ @roullete.tradesman_connection_pool.with {|r| r.flushdb}
76
76
  end
77
- WorkerRoulette.tradesman_connection_pool.with {|r| r.flushdb}
77
+ @roullete.tradesman_connection_pool.with {|r| r.flushdb}
78
78
 
79
79
  puts "#{(ITERATIONS / times.first.real).to_i} Sync Api Writes per second"
80
80
  puts "#################"
81
81
  puts
82
82
  ITERATIONS.times do |iteration|
83
83
  sender = 'sender_' + iteration.to_s
84
- foreman = WorkerRoulette.foreman(sender)
84
+ foreman = @roullete.foreman(sender)
85
85
  foreman.enqueue_work_order(work_order)
86
86
  end
87
87
 
@@ -89,7 +89,7 @@ times = Benchmark.bm do |x|
89
89
  x.report "#{ITERATIONS} Sync Api Reads" do
90
90
  ITERATIONS.times do |iteration|
91
91
  sender = 'sender_' + iteration.to_s
92
- tradesman = WorkerRoulette.tradesman
92
+ tradesman = @roullete.tradesman
93
93
  tradesman.work_orders!
94
94
  end
95
95
  end
@@ -97,19 +97,19 @@ end
97
97
  puts "#{(ITERATIONS / times.first.real).to_i} Sync Api Reads per second"
98
98
  puts "#################"
99
99
  puts
100
- WorkerRoulette.tradesman_connection_pool.with {|r| r.flushdb}
100
+ @roullete.tradesman_connection_pool.with {|r| r.flushdb}
101
101
 
102
102
  times = Benchmark.bm do |x|
103
103
  x.report "#{ITERATIONS} Sync Api Read/Writes" do
104
104
  ITERATIONS.times do |iteration|
105
105
  sender = 'sender_' + iteration.to_s
106
- foreman = WorkerRoulette.foreman(sender)
106
+ foreman = @roullete.foreman(sender)
107
107
  foreman.enqueue_work_order(work_order)
108
108
  end
109
109
 
110
110
  ITERATIONS.times do |iteration|
111
111
  sender = 'sender_' + iteration.to_s
112
- tradesman = WorkerRoulette.tradesman
112
+ tradesman = @roullete.tradesman
113
113
  tradesman.work_orders!
114
114
  end
115
115
  end
@@ -117,16 +117,16 @@ end
117
117
  puts "#{(ITERATIONS / times.first.real).to_i} Sync Api Read/Writes per second"
118
118
  puts "#################"
119
119
  puts
120
- WorkerRoulette.tradesman_connection_pool.with {|r| r.flushdb}
120
+ @roullete.tradesman_connection_pool.with {|r| r.flushdb}
121
121
 
122
122
  times = Benchmark.bm do |x|
123
123
  x.report "#{ITERATIONS * 2} Sync Api Polling Read/Writes" do
124
- WorkerRoulette.start(size: REDIS_CONNECTION_POOL_SIZE, evented: false)
124
+ @roullete = WorkerRoulette::WorkerRoulette.start(size: REDIS_CONNECTION_POOL_SIZE, evented: false)
125
125
  ITERATIONS.times do |iteration|
126
126
  sender = 'sender_' + iteration.to_s
127
- foreman = WorkerRoulette.foreman(sender)
127
+ foreman = @roullete.foreman(sender)
128
128
  foreman.enqueue_work_order(work_order)
129
- tradesman = WorkerRoulette.tradesman
129
+ tradesman = @roullete.tradesman
130
130
  tradesman.wait_for_work_orders {|m| m}
131
131
  end
132
132
  end
@@ -134,4 +134,4 @@ end
134
134
  puts "#{(ITERATIONS * 2 / times.first.real).to_i} Sync Api Polling Read/Writes per second"
135
135
  puts "#################"
136
136
  puts
137
- WorkerRoulette.tradesman_connection_pool.with {|r| r.flushdb}
137
+ @roullete.tradesman_connection_pool.with {|r| r.flushdb}
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
8
8
  spec.version = WorkerRoulette::VERSION
9
9
  spec.authors = ['Paul Saieg']
10
10
  spec.email = ['classicist@gmail.com']
11
- spec.description = %q{Pub Sub Queue for Redis that ensures ordered processing}
12
- spec.summary = %q{Pub Sub Queue for Redis that ensures ordered processing}
11
+ spec.description = %q{High performance queueing system for Redis that ensures each publishers messages will be processed in order. Designed to work with 100s of thousands of publishers and an arbitrary number of competing consumers that need 0 knoweldge of what producer's message they are handling.}
12
+ spec.summary = %q{High performance queueing system for Redis that ensures each publishers messages will be processed in order.}
13
13
  spec.homepage = 'https://github.com/classicist/worker_roulette'
14
14
 
15
15
  spec.files = `git ls-files`.split($/)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: worker_roulette
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Saieg
@@ -192,7 +192,10 @@ dependencies:
192
192
  - - "~>"
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0.2'
195
- description: Pub Sub Queue for Redis that ensures ordered processing
195
+ description: High performance queueing system for Redis that ensures each publishers
196
+ messages will be processed in order. Designed to work with 100s of thousands of
197
+ publishers and an arbitrary number of competing consumers that need 0 knoweldge
198
+ of what producer's message they are handling.
196
199
  email:
197
200
  - classicist@gmail.com
198
201
  executables: []
@@ -245,7 +248,8 @@ rubyforge_project:
245
248
  rubygems_version: 2.4.3
246
249
  signing_key:
247
250
  specification_version: 4
248
- summary: Pub Sub Queue for Redis that ensures ordered processing
251
+ summary: High performance queueing system for Redis that ensures each publishers messages
252
+ will be processed in order.
249
253
  test_files:
250
254
  - spec/benchmark/irb_demo_runner.rb
251
255
  - spec/benchmark/perf_test.rb