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) |
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Doing some tests to see how low I can get memory consumption using REE 2012.02 with memory tuning parameters:
Those settings should guarantee the smallest possible vm size (obviously trading off performance).
Tests:
(Everything allows 1 second to reach steady-state unless otherwise noted)