mysql_warmer 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +1 -1
- data/VERSION +1 -1
- data/bin/mysql_warmer +2 -2
- data/lib/mysql_warmer/em/mysql.rb +5 -0
- data/mysql_warmer.gemspec +2 -2
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
= mysql_warmer
|
2
2
|
|
3
|
-
The need for mysql_warmer arose out of having to add a newly seeded MySQL slave in to production rotation. Since the internal buffer pool is empty / not tuned for the queries that will be run on it, queries that would run in less than 1s often took
|
3
|
+
The need for mysql_warmer arose out of having to add a newly seeded MySQL slave in to production rotation. Since the internal buffer pool is empty / not tuned for the queries that will be run on it, queries that would run in less than 1s often took much higher with a cold MySQL cache.
|
4
4
|
|
5
5
|
To alleviate the pain of addding a cold / untuned MySQL machine to the cluster, mysql_warmer simply executes the same queries that are being run on a warm slave, on a cold slave. You're expected to run a query reaper on the slave with some reasonable timeout so that the initial flood of slow queries will not kill the machine. And once enough time has gone by, both the warm slave and the cold slave will start exhibiting identical performance characteristics and then we can give production traffic to the new slave.
|
6
6
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/bin/mysql_warmer
CHANGED
@@ -17,7 +17,7 @@ OptionParser.new do |opts|
|
|
17
17
|
|
18
18
|
options[:db_opts] = {}
|
19
19
|
opts.on('-u USER', 'Username to use when connecting to the cold database') do |username|
|
20
|
-
options[:db_opts][:
|
20
|
+
options[:db_opts][:user] = username
|
21
21
|
end
|
22
22
|
opts.on('-p PASSWORD', 'Password to use when connecting to the cold database') do |password|
|
23
23
|
options[:db_opts][:password] = password
|
@@ -55,7 +55,7 @@ module MysqlSpammer
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def unbind
|
58
|
-
return if @query.empty?
|
58
|
+
return if @query.empty? or @query !~ /^select/i
|
59
59
|
|
60
60
|
puts @query.inspect if @options[:verbose]
|
61
61
|
SQL.raw(@query) {}
|
data/mysql_warmer.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{mysql_warmer}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Rohith Ravi", "Steven Lumos"]
|
12
|
-
s.date = %q{2010-01
|
12
|
+
s.date = %q{2010-02-01}
|
13
13
|
s.description = %q{mysql_warmer warms up a cold database by sniffing SQL queries from a hot machine and then repeating those queries on a cold machine}
|
14
14
|
s.email = %q{entombedvirus@gmail.com}
|
15
15
|
s.executables = ["mysql_sniff", "mysql_warmer"]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mysql_warmer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rohith Ravi
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2010-01
|
13
|
+
date: 2010-02-01 00:00:00 -08:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|