5
The stress script is designed to perform testing of the MySQL server in
6
a multi-threaded environment.
8
All functionality regarding stress testing is implemented in the
9
mysql-stress-test.pl script.
11
The stress script allows:
13
- To stress test the mysqltest binary test engine.
14
- To stress test the regular test suite and any additional test suites
15
(such as mysql-test-extra-5.0).
16
- To specify files with lists of tests both for initialization of
17
stress db and for further testing itself.
18
- To define the number of threads to be concurrently used in testing.
19
- To define limitations for the test run. such as the number of tests or
20
loops for execution or duration of testing, delay between test
21
executions, and so forth.
22
- To get a readable log file that can be used for identification of
23
errors that occur during testing.
25
There are two ways to run the mysql-stress-test.pl script:
27
- For most cases, it is enough to use the options below for starting
28
the stress test from the mysql-test-run wrapper. In this case, the
29
server is run automatically, all preparation steps are performed,
30
and after that the stress test is started.
32
- In advanced case, you can run the mysql-stress-test.pl script directly.
33
But this requires that you perform some preparation steps and to specify
34
a bunch of options as well, so this invocation method may be a bit
40
The following mysql-test-run options are specific to stress-testing:
45
--stress-suite=<suite name>
46
Test suite name to use in stress testing. We assume that all suites
47
are located in the mysql-test/suite directory.
48
There is one special suite name - <main|default> that corresponds
49
to the regular test suite located in the mysql-test directory.
51
--stress-threads=<number of threads>
52
The number of threads to use in stress testing.
54
--stress-tests-file=<filename with list of tests>
55
The file that contains the list of tests (without .test suffix) to use in
56
stress testing. The default filename is stress_tests.txt and the default
57
location of this file is suite/<suite name>/stress_tests.txt
59
--stress-init-file=<filename with list of tests>
60
The file that contains list of tests (without .test suffix) to use in
61
stress testing for initialization of the stress db. These tests will be
62
executed only once before starting the test itself. The default filename
63
is stress_init.txt and the default location of this file is
64
suite/<suite name>/stress_init.txt
66
--stress-mode=<method which will be used for choosing tests from the list>
67
Possible values are: random(default), seq
69
There are two possible modes that affect the order of test selection
71
- In random mode, tests are selected in random order
72
- In seq mode, each thread executes tests in a loop one by one in
73
the order specified in the list file.
75
--stress-test-count=<number>
76
Total number of tests that will be executed concurrently by all threads
78
--stress-loop-count=<number>
79
Total number of loops in seq mode that will be executed concurrently
82
--stress-test-duration=<number>
83
Duration of stress testing in seconds
88
1. Example of a simple command line to start a stress test:
90
mysql-test-run --stress alias
92
Runs a stress test with default values for number of threads and number
93
of tests, with test 'alias' from suite 'main'.
95
2. Using in stress testing tests from other suites:
97
- mysql-test-run --stress --stress-threads=10 --stress-test-count=1000 \
98
--stress-suite=example --stress-tests-file=testslist.txt
100
Runs a stress test with 10 threads, executes 1000 tests by all
101
threads, tests are used from suite 'example', the list of tests is
102
taken from file 'testslist.txt'
104
- mysql-test-run --stress --stress-threads=10 --stress-test-count=1000 \
105
--stress-suite=example sum_distinct
107
Runs stress test with 10 threads, executes 1000 tests by all
108
threads, tests are used from suite 'example', the list of tests
109
contains only one test 'sum_distinct'
111
3. Debugging of issues found with stress test
113
Right now, the stress test is not fully integrated in mysql-test-run
114
and does not support the --gdb option. To debug issues found with the
115
stress test, you must start the MySQL server separately under a debugger
116
and then run the stress test like this:
118
- mysql-test-run --extern --stress --stress-threads=10 \
119
--stress-test-count=1000 --stress-suite=example \