Skip to content

Instantly share code, notes, and snippets.

@delano
Created June 4, 2009 03:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save delano/123400 to your computer and use it in GitHub Desktop.
Save delano/123400 to your computer and use it in GitHub Desktop.

Amazon EC2 EBS Performance Test

This gist describes a working Rudy configuration for running the Bonnie64 benchmark on EC2.

Installation (2 steps)

  1. Install Rudy
    • Follow the Getting Started guide up to and including "Create Accounts Configuration".
  2. Download this gist
    • git clone git://gist.github.com/123400.git bonnie64-aws-test

Running the test

$ cd bonnie64-aws-test
$ rudy -e linux -r small -v startup         # Installs all necessary software
$ rudy -e linux -r small -v bonnie64        # Runs tests and downloads report
  • -e the machine environment
  • -r the machine role
  • -v (optional) verbose output displays shell commands as they're executed

The test report will be downloaded to your current local working directory with the name:

bonnie64-YYYY-MM-DD-m-us-east-1b-linux-small-01 

Other stuff

$ rudy -e linux -r small -u root ssh        # Login via SSH as root user
$ rudy -e linux -r small shutdown           # Terminate the EC2 instance

Example Report

$ cat bonnie64-2009-06-04-m-us-east-1b-linux-small-01
              -------Sequential Output-------- ---Sequential Input-- --Random--
              -Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --Seeks---
Machine    GB M/sec %CPU M/sec %CPU M/sec %CPU M/sec %CPU M/sec %CPU  /sec %CPU
EBS-1GB     1  50.0 77.0 454.5 75.9 155.8 19.6  58.0 77.0 1282.1 64.1 66666 66.7
              -------Sequential Output-------- ---Sequential Input-- --Random--
              -Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --Seeks---
Machine    GB M/sec %CPU M/sec %CPU M/sec %CPU M/sec %CPU M/sec %CPU  /sec %CPU
MNT-1GB     1  50.1 76.2 442.5 76.1 260.4 35.2  57.8 75.9 1315.8 76.3 57142 57.1
# --------------------------------------------------------- MACHINES --------
# The machines block describes the "physical" characteristics of your machines.
machines do
env :linux do
disks do # Define EBS volumes
path '/rudy/disk1' do # The paths can be anything but
size 50 # they must be unique.
device '/dev/sdr' # Devices must be unique too.
end
end
role :small do
size 'm1.small' # EC2 machine type for all machines
ami 'ami-e348af8a' # Alestic Debian 5.0, 32-bit (US)
end
role :large do
size 'm1.large'
ami 'ami-fb57b092' # Alestic Debian 5.0, 64-bit (US)
end
end
end
bonnie_dir = '/tmp/bonnie-64-read-only'
now = Time.now
mon, day = now.mon.to_s.rjust(2, '0'), now.day.to_s.rjust(2, '0')
hour, min = now.hour.to_s.rjust(2, '0'), now.min.to_s.rjust(2, '0')
bonnie_log = '/tmp/' << ['bonnie64', now.year, mon, day].join('-')
# ----------------------------------------------------------- COMMANDS --------
# The commands block defines shell commands that can be used in routines. The
# ones defined here are added to the default list defined by Rye::Cmd (Rudy
# executes all SSH commands via Rye).
commands do
allow :apt_get, 'apt-get', :y, :q
allow :gem_install, '/usr/bin/gem', 'install', :n, '/usr/bin', :y, :V, '--no-rdoc', '--no-ri'
allow :gem_sources, '/usr/bin/gem', 'sources'
allow :update_rubygems
allow :bonnie, "#{bonnie_dir}/Bonnie"
end
# ----------------------------------------------------------- ROUTINES --------
# The routines block describes the repeatable processes for each machine group.
# To run a routine, specify its name on the command-line: rudy bonnie64
routines do
bonnie64 do # Run bonnie
script :root do
# The following commands are analogous to running:
# $ bonnie -d /rudy/disk -m EBS-1GB -r -s 1000 > bonnie_log
bonnie(:d, '/rudy/disk1', :m, 'EBS-1GB', :r, :s, 1000) > bonnie_log
bonnie(:d, '/mnt', :m, 'MNT-1GB', :r, :s, 1000) >> bonnie_log
bonnie(:d, '/rudy/disk1', :m, 'EBS-5GB', :r, :s, 5000) >> bonnie_log
bonnie(:d, '/mnt', :m, 'MNT-5GB', :r, :s, 5000) >> bonnie_log
# Download report to current working directory
download bonnie_log, [File.basename(bonnie_log), hostname].join('-')
end
end
sysupdate do # Prep system
script :root do
apt_get 'update'
apt_get 'install', 'build-essential', 'git-core', 'subversion'
apt_get 'install', 'ruby1.8-dev', 'rubygems'
gem_sources :a, 'http://gems.github.com'
gem_install 'rubygems-update'
update_rubygems
end
end
bonnie64_install do # Install Bonnie64 from source
script :root do
svn 'checkout', 'http://bonnie-64.googlecode.com/svn/trunk/', bonnie_dir
cd bonnie_dir
make 'SysV' # SysV is required for Linux (and probably Solaris)
end
end
startup do
disks do
create '/rudy/disk1'
end
after :sysupdate
after :bonnie64_install
end
shutdown do
disks do
destroy '/rudy/disk1'
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment