-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
76 lines (45 loc) · 1.92 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Database load testing toolkit
=============================
Fire is a tool I wrote to make database load testing easier.
It spawns a thread for each file passed on the commandline and shows useful metrics and
progress for each thread while it's running.
The three key aims of this project are:
Speed
-----
fire should not be significantly measurably slower than the longwinded manual processes
it is designed to replace (eg spawning cat | mysql threads manually, having some way to
monitor execution time, etc). As far as I can tell this has been achieved.
Simplicity
----------
fire requires no configuration other than a single environment variable and no other
dependencies.
Metrics and progress
--------------------
fire shows metrics, progress and ETA for each thread as it runs so you have some idea
how long it will take.
Installation
------------
$ sudo gem install fire
Usage
-----
1. Capture some general.log
2. Split the queries using:
$ fire -s general.log 4
where 4 is the number of threads you want to load-test with.
alternatively you can split the log into {n} threads without separating the queries:
$ fire -s general.log 4 all
Only SELECT, INSERT, UPDATE and DELETE queries will be written to the new files.
3. Export the cli path for your database client including all the options you want,
connection password etc:
export CLI="mysql -uroot -f -q -n mydatabase"
Note that -q is advised for MySQL if you're going to be testing with a very large set
of files, as this will stop the client caching all the query responses and exhausting
the system memory.
4. Execute fire and pass in the files you want to test with. It will automatically
create a thread for each file, eg:
$ fire SELECT.*
Credit
------
Thanks to Dominik Honnef for Filesize.pretty which I have included with this gem rather
than add the dependency as I wanted fire to be as easy for sysadmins to use as possible
and not require installing other gems.