2005-10-18 18:26:31 +02:00
|
|
|
|
|
|
|
Overview
|
|
|
|
--------
|
|
|
|
|
2006-03-03 19:15:01 +01:00
|
|
|
The stress script is designed to perform testing of the MySQL server in
|
|
|
|
a multi-threaded environment.
|
2005-10-18 18:26:31 +02:00
|
|
|
|
2006-03-03 19:15:01 +01:00
|
|
|
All functionality regarding stress testing is implemented in the
|
2022-12-12 04:20:08 +01:00
|
|
|
mariadb-stress-test.pl script.
|
2006-03-03 19:15:01 +01:00
|
|
|
|
|
|
|
The stress script allows:
|
2005-10-18 18:26:31 +02:00
|
|
|
|
2022-12-12 04:20:08 +01:00
|
|
|
- To stress test the mariadb-test binary test engine.
|
|
|
|
- To stress test the regular test suite.
|
2006-03-03 19:15:01 +01:00
|
|
|
- To specify files with lists of tests both for initialization of
|
|
|
|
stress db and for further testing itself.
|
|
|
|
- To define the number of threads to be concurrently used in testing.
|
|
|
|
- To define limitations for the test run. such as the number of tests or
|
|
|
|
loops for execution or duration of testing, delay between test
|
|
|
|
executions, and so forth.
|
|
|
|
- To get a readable log file that can be used for identification of
|
|
|
|
errors that occur during testing.
|
|
|
|
|
2022-12-12 04:20:08 +01:00
|
|
|
There are two ways to run the mariadb-stress-test.pl script:
|
2006-03-03 19:15:01 +01:00
|
|
|
|
|
|
|
- For most cases, it is enough to use the options below for starting
|
2022-12-12 04:20:08 +01:00
|
|
|
the stress test from the mariadb-test-run wrapper. In this case, the
|
2006-03-03 19:15:01 +01:00
|
|
|
server is run automatically, all preparation steps are performed,
|
|
|
|
and after that the stress test is started.
|
|
|
|
|
2022-12-12 04:20:08 +01:00
|
|
|
- In advanced case, you can run the mariadb-stress-test.pl script directly.
|
2006-03-03 19:15:01 +01:00
|
|
|
But this requires that you perform some preparation steps and to specify
|
|
|
|
a bunch of options as well, so this invocation method may be a bit
|
|
|
|
complicated.
|
2005-10-18 18:26:31 +02:00
|
|
|
|
|
|
|
Usage
|
|
|
|
-----
|
|
|
|
|
2006-03-03 19:15:01 +01:00
|
|
|
The following mysql-test-run options are specific to stress-testing:
|
2005-10-18 18:26:31 +02:00
|
|
|
|
|
|
|
--stress
|
|
|
|
Enable stress mode
|
|
|
|
|
|
|
|
--stress-suite=<suite name>
|
2006-03-03 19:15:01 +01:00
|
|
|
Test suite name to use in stress testing. We assume that all suites
|
|
|
|
are located in the mysql-test/suite directory.
|
2005-10-18 18:26:31 +02:00
|
|
|
There is one special suite name - <main|default> that corresponds
|
2006-03-03 19:15:01 +01:00
|
|
|
to the regular test suite located in the mysql-test directory.
|
2005-10-18 18:26:31 +02:00
|
|
|
|
|
|
|
--stress-threads=<number of threads>
|
2006-03-03 19:15:01 +01:00
|
|
|
The number of threads to use in stress testing.
|
2005-10-18 18:26:31 +02:00
|
|
|
|
|
|
|
--stress-tests-file=<filename with list of tests>
|
2006-03-03 19:15:01 +01:00
|
|
|
The file that contains the list of tests (without .test suffix) to use in
|
|
|
|
stress testing. The default filename is stress_tests.txt and the default
|
2005-10-18 18:26:31 +02:00
|
|
|
location of this file is suite/<suite name>/stress_tests.txt
|
|
|
|
|
|
|
|
--stress-init-file=<filename with list of tests>
|
2006-03-03 19:15:01 +01:00
|
|
|
The file that contains list of tests (without .test suffix) to use in
|
|
|
|
stress testing for initialization of the stress db. These tests will be
|
|
|
|
executed only once before starting the test itself. The default filename
|
|
|
|
is stress_init.txt and the default location of this file is
|
2005-10-18 18:26:31 +02:00
|
|
|
suite/<suite name>/stress_init.txt
|
|
|
|
|
|
|
|
--stress-mode=<method which will be used for choosing tests from the list>
|
|
|
|
Possible values are: random(default), seq
|
|
|
|
|
2006-03-03 19:15:01 +01:00
|
|
|
There are two possible modes that affect the order of test selection
|
2005-10-18 18:26:31 +02:00
|
|
|
from the list:
|
2006-03-03 19:15:01 +01:00
|
|
|
- In random mode, tests are selected in random order
|
|
|
|
- In seq mode, each thread executes tests in a loop one by one in
|
|
|
|
the order specified in the list file.
|
2005-10-18 18:26:31 +02:00
|
|
|
|
2006-03-03 19:15:01 +01:00
|
|
|
--stress-test-count=<number>
|
2005-10-18 18:26:31 +02:00
|
|
|
Total number of tests that will be executed concurrently by all threads
|
|
|
|
|
2006-03-03 19:15:01 +01:00
|
|
|
--stress-loop-count=<number>
|
2005-10-18 18:26:31 +02:00
|
|
|
Total number of loops in seq mode that will be executed concurrently
|
|
|
|
by all threads
|
|
|
|
|
2006-03-03 19:15:01 +01:00
|
|
|
--stress-test-duration=<number>
|
2005-10-18 18:26:31 +02:00
|
|
|
Duration of stress testing in seconds
|
|
|
|
|
|
|
|
Examples
|
|
|
|
--------
|
|
|
|
|
2006-03-03 19:15:01 +01:00
|
|
|
1. Example of a simple command line to start a stress test:
|
2005-10-18 18:26:31 +02:00
|
|
|
|
2022-12-12 04:20:08 +01:00
|
|
|
mariadb-test-run --stress alias
|
2005-10-18 18:26:31 +02:00
|
|
|
|
2006-03-03 19:15:01 +01:00
|
|
|
Runs a stress test with default values for number of threads and number
|
|
|
|
of tests, with test 'alias' from suite 'main'.
|
2005-10-18 18:26:31 +02:00
|
|
|
|
|
|
|
2. Using in stress testing tests from other suites:
|
|
|
|
|
2022-12-12 04:20:08 +01:00
|
|
|
- mariadb-test-run --stress --stress-threads=10 --stress-test-count=1000 \
|
2005-10-18 18:26:31 +02:00
|
|
|
--stress-suite=example --stress-tests-file=testslist.txt
|
|
|
|
|
2006-03-03 19:15:01 +01:00
|
|
|
Runs a stress test with 10 threads, executes 1000 tests by all
|
|
|
|
threads, tests are used from suite 'example', the list of tests is
|
2005-10-18 18:26:31 +02:00
|
|
|
taken from file 'testslist.txt'
|
|
|
|
|
2022-12-12 04:20:08 +01:00
|
|
|
- mariadb-test-run --stress --stress-threads=10 --stress-test-count=1000 \
|
2005-10-18 18:26:31 +02:00
|
|
|
--stress-suite=example sum_distinct
|
|
|
|
|
2006-03-03 19:15:01 +01:00
|
|
|
Runs stress test with 10 threads, executes 1000 tests by all
|
|
|
|
threads, tests are used from suite 'example', the list of tests
|
|
|
|
contains only one test 'sum_distinct'
|
2005-10-18 18:26:31 +02:00
|
|
|
|
|
|
|
3. Debugging of issues found with stress test
|
|
|
|
|
2022-12-12 04:20:08 +01:00
|
|
|
Right now, the stress test is not fully integrated in mariadb-test-run
|
2006-03-03 19:15:01 +01:00
|
|
|
and does not support the --gdb option. To debug issues found with the
|
2022-12-12 04:20:08 +01:00
|
|
|
stress test, you must start the MariaDB server separately under a debugger
|
2006-03-03 19:15:01 +01:00
|
|
|
and then run the stress test like this:
|
2005-10-18 18:26:31 +02:00
|
|
|
|
2022-12-12 04:20:08 +01:00
|
|
|
- mariadb-test-run --extern --stress --stress-threads=10 \
|
2005-10-18 18:26:31 +02:00
|
|
|
--stress-test-count=1000 --stress-suite=example \
|
|
|
|
sum_distinct
|