Last active
December 24, 2015 10:19
-
-
Save sskylar/6783842 to your computer and use it in GitHub Desktop.
Benchmarking Rackspace Cloud Files vs Amazon S3 For results see: https://docs.google.com/spreadsheet/ccc?key=0AsDVtmCyFfrbdFRvTVRJLTVmM1lIWG42MWpvTTY0bmc&usp=sharing
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 'fog' | |
def benchmark(connection, dir, n) | |
path = connection.directories.get(dir) | |
timers = [] | |
n.times do | |
folder = SecureRandom.hex.to_s | |
start = Time.now | |
file = path.files.create( | |
:key => File.join(folder, 'index.html'), | |
:body => '<html><body>Hello world!</body></html>', | |
:public => true | |
) | |
puts timer = Time.now - start | |
timers.push(timer) | |
end | |
end | |
n = 100 | |
puts 'Benchmarking Rackspace...' | |
benchmark(Fog::Storage::Rackspace.new( | |
:rackspace_api_key => '...', | |
:rackspace_username => '...', | |
:rackspace_region => :ord | |
), 'test-container', n) | |
puts 'Benchmarking S3...' | |
benchmark(Fog::Storage::AWS.new( | |
:aws_access_key_id => '...', | |
:aws_secret_access_key => '...', | |
:region => 'us-east-1' | |
), 'test-container', n) | |
puts 'Done' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment