Last active
December 12, 2015 05:59
-
-
Save jsanders/4726220 to your computer and use it in GitHub Desktop.
Resque memory test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in {1..10} | |
do | |
RUBY_HEAP_MIN_SLOTS=974 RUBY_HEAP_SLOTS_INCREMENT=1 RUBY_HEAP_SLOTS_GROWTH_FACTOR=1 ruby test.rb & | |
sleep 1 | |
pid=$! | |
ps -o rss -p $pid | tail -1 | |
kill $pid | |
done 2> /dev/null | awk '{count+=1; sum+=$1}END{print sum/count}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem 'json' | |
gem 'resque', '1.19.0' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'bundler' | |
Bundler.setup | |
require 'json' | |
require 'resque' | |
worker = Resque::Worker.new('test_queue') | |
worker.work(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What this all tells me is that there doesn't seem to really be a weird leak in resque, not sure what @diminish7 was seeing, but I think his memory parameters were just causing havoc.