Is there any tool available which can do stress testing using the log file created by MySQL general log?
After a lot of search on google I found few stress testing tools which only use some benchmarks for stress test. One solution is using Apache JMeter, but it does not create test plans from MySQL log file and creating custom test plan for all the queries I have is too time consuming.
Or is there a tool which can at least create .sql file from MySQL log?
MySQL – How to Stress Test with Queries Captured from General Log
logsMySQLperformanceperformance-testingscalability
Related Question
- Mysql – Stress Test to Saturate Memory for MySQL InnoDB
- MySQL Stress testing issues
- MySQL (on Windows) general log too large to rotate properly
- Mysql – stress-testing MySQL slave with master’s queries
- Mysql – Help Outputing MySQL General Log to Named Pipe
- Mysql – Replay (re-execute) MySQL SELECT queries from a log file
Best Answer
This is only a trace not a complete solution, "your" solution is based on your fantasy (and some work) ;)
I have done this kind of test capturing and cleaning query generated by the general query log and using sysbench 0.5 after writing my own
lua
file, you can find some samples in the official source code, on a mirror of my database(hw and schema/data -a snapshot so I can restore the original status of data immediately- ).Then you can run a command like this:
./sysbench --mysql-table-engine=myisam --mysql-db=<yourdb> --mysql-user=<user> --mysql-host=<host> --mysql-password=<pass> --test=tests/db/<yourlua>.lua --num-threads=8 --max-requests=8 run
Collect and graph your results, changing concurrency and requests, and monitor your database and HW status.
My
lua
file contains about 80.000 query and it is composed by insert, update and deleteUPDATE #1
A good starting point that you can try is to start (simply) writing your
lua
file like this:Putting your query into the
db_query("")
function, cleaning your general query log for this kind of process require a bit of workHere a simple output of a "personal"
lua
file, like the above, with 9 query, 7 insert and 2 select, +2 BEGIN/COMMIT:Hope this helps