This file contains 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
### machine1$ ruby redis_test.rb -c conf.rb | |
### machine2$ ab -n 10000 -c 100 http://***.compute-1.amazonaws.com:9000/ | |
### ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux] | |
### Redis server version 2.2.11 (00000000:0) | |
### goliath (0.9.1), em-synchrony (0.3.0.beta.1), eventmachine (1.0.0.beta.3) | |
### Redis pool size: 10 | |
### GC: enabled |
This file contains 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
Xen Minimal OS! | |
start_info: 0xb10000(VA) | |
nr_pages: 0x6a400 | |
shared_inf: 0xbef32000(MA) | |
pt_base: 0xb13000(VA) | |
nr_pt_frames: 0x9 | |
mfn_list: 0x967000(VA) | |
mod_start: 0x0(VA) | |
mod_len: 0 | |
flags: 0x0 |
This file contains 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
# This way we re-query the app itself in order to avoid sequential execution for CPU-intensive tasks | |
# that can (and should) be executed in parallel. | |
# | |
# Pros: decent scalability can be achieved by assigning path=some.load.balancer.com (i.e. Amazon ELB) | |
# and putting a bunch of multicore machines behind it. | |
# | |
# Cons: we lose some fraction of time on JSON encoding/decoding and HTTP traffic. | |
# Load-balanced fault-tolerant DRb could be a better choice, but would require more work and provide only | |
# minor performance improvement in situation where JSON/HTTP aren't the main CPU consumers. |
This file contains 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 | |
# | |
# A simple tool for testing Memcached's evictions functionality. | |
# | |
# It saves TOTAL_BYTES of data in chunks of CHUNK_BYTES size. | |
# Well-behaving Memcached server should start evicting old data | |
# unless it's configured to return error on memory exhaustion. | |
# | |
require 'rubygems' |
This file contains 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
require 'formula' | |
class ErlangManuals < Formula | |
url 'http://erlang.org/download/otp_doc_man_R15B02.tar.gz' | |
end | |
class ErlangHtmls < Formula | |
url 'http://erlang.org/download/otp_doc_html_R15B02.tar.gz' | |
end |
This file contains 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 | |
# | |
# This script tries to eat up 2GB of RAM every second | |
# It can be used to test if memory usage alerts work correctly | |
GB_PER_STEP = 2 | |
str = '' | |
ate = 0 | |
puts "Hey, you do have too much free RAM! Don't worry as we'll fix this very soon." |
This file contains 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
# Ruby has #source_location method that returns code location where a method was declared. | |
# What Ruby lacks is alike functionality that could show where an object was created. | |
# Below is a very rough solution that may help with tracing object allocations | |
# by storing the first entry in the caller list during object initialization phase. | |
# It doesn't work for built-in classes like Fixnum and for classes that don't invoke #initialize() | |
# like the ones derived from ActiveRecord::Base, but can be potentially tailored to address | |
# at least the latter case by overriding ActiveRecord::Base.new in addition to overriding #initialize() | |
class BasicObject | |
attr_reader :allocated_at |
This file contains 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
# Ruby has #source_location method that returns code location where a method was declared. | |
# What Ruby lacks is alike functionality that could show where an object was created. | |
# Below is a very rough solution that may help with tracing object allocations | |
# by storing the first entry in the caller list during object initialization phase. | |
# It doesn't work for built-in classes like Fixnum and for classes that don't invoke #initialize() | |
# like the ones derived from ActiveRecord::Base, but can be potentially tailored to address | |
# at least the latter case by overriding ActiveRecord::Base.new in addition to overriding #initialize() | |
class BasicObject | |
attr_reader :allocated_at |
This file contains 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
# Ruby has #source_location method that returns code location where a method was declared. | |
# What Ruby lacks is alike functionality that could show where an object was created. | |
# Below is a very rough solution that may help with tracing object allocations | |
# by storing the first entry in the caller list during object initialization phase. | |
# It doesn't work for built-in classes like Fixnum and for classes that don't invoke #initialize() | |
# like the ones derived from ActiveRecord::Base, but can be potentially tailored to address | |
# at least the latter case by overriding ActiveRecord::Base.new in addition to overriding #initialize() | |
class BasicObject | |
attr_reader :allocated_at |