Skip to content

Commit

Permalink
Add latency output
Browse files Browse the repository at this point in the history
  • Loading branch information
mperham committed Aug 28, 2019
1 parent f07d8c0 commit bd4c5a2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,18 @@ Rails to make background processing dead simple.
Performance
---------------

Version | Latency | Garbage created for 10,000 jobs | Time to process 100,000 jobs | Throughput
Version | Latency | Garbage created for 10,000 jobs | Time to process 100,000 jobs | Throughput | Ruby
-----------------|------|---------|---------|------------------------
Sidekiq 4.0.0 | 10ms | 151 MB | 22 sec | **4500 jobs/sec**
Sidekiq 3.5.1 | 22ms | 1257 MB | 125 sec | 800 jobs/sec
Resque 1.25.2 | - | - | 420 sec | 240 jobs/sec
DelayedJob 4.1.1 | - | - | 465 sec | 215 jobs/sec
Sidekiq 6.0.0 | 3 ms | 156 MB | 19 sec | **5200 jobs/sec** | MRI 2.6.3
Sidekiq 4.0.0 | 10 ms | 151 MB | 22 sec | **4500 jobs/sec** |
Sidekiq 3.5.1 | 22 ms | 1257 MB | 125 sec | 800 jobs/sec |
Resque 1.25.2 | - | - | 420 sec | 240 jobs/sec |
DelayedJob 4.1.1 | - | - | 465 sec | 215 jobs/sec |

<small>This benchmark can be found in `bin/sidekiqload`.</small>

Benchmarks assume a Redis network latency of 1ms.

Requirements
-----------------

Expand Down
11 changes: 9 additions & 2 deletions bin/sidekiqload
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ class LoadWorker
1
end

def perform(idx)
def perform(idx, ts=nil)
puts(Time.now.to_f - ts) if ts != nil
#raise idx.to_s if idx % 100 == 1
end
end
Expand Down Expand Up @@ -111,7 +112,13 @@ Monitoring = Thread.new do
total = qsize
Sidekiq.logger.error("RSS: #{Process.rss} Pending: #{total}")
if total == 0
Sidekiq.logger.error("Done")
Sidekiq.logger.error("Done, now here's the latency for three jobs")

LoadWorker.perform_async(1, Time.now.to_f)
LoadWorker.perform_async(2, Time.now.to_f)
LoadWorker.perform_async(3, Time.now.to_f)

sleep 0.2
exit(0)
end
end
Expand Down

0 comments on commit bd4c5a2

Please sign in to comment.