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
template "/etc/my.cnf" do | |
innodb_buffer_pool_size = "256M" | |
if node.attributes?("ec2") | |
case node[:ec2][:instance_type] | |
when "t1.micro" | |
innodb_buffer_pool_size = "256M" | |
when "m1.large" | |
innodb_buffer_pool_size = "5G" | |
end | |
end |
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
bash "generate_random_server_id" do | |
user "root" | |
code <<-EOH | |
echo $RANDOM%900 | bc > /etc/mysql-server-id | |
EOH | |
not_if "test -f /etc/mysql-server-id" | |
end | |
ruby_block "reload_client_config" do | |
block do |
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
vol = connection.volumes.new(:snapshot_id => snapshot.id, :availability_zone => current_instance.availability_zone, :size => snapshot.volume_size) | |
vol.device = "/dev/sdk" | |
vol.server = current_instance | |
vol.save | |
vol.wait_for { ready? } |
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/ruby | |
def print_responses(times) | |
%w{ 0.95 0.99 0.995 0.999 }.each do |percentile| | |
pos = (percentile.to_f * times.length).floor | |
p pos.to_s + ": " + times[pos].to_s | |
end | |
end | |
num = 0 |
NewerOlder