You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

120 lines
4.5 KiB

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