How can artificially create a slow query in mysql?

Posted by Gray Race on Server Fault See other posts from Server Fault or by Gray Race
Published on 2011-06-29T23:07:46Z Indexed on 2011/06/30 0:23 UTC
Read the original article Hit count: 319

Filed under:
|

I'm giving a hands on presentation in a couple weeks. Part of this demo is for basic mysql trouble shooting including use of the slow query log. I've generated a database and installed our app but its a clean database and therefore difficult to generate enough problems.

I've tried the following to get queries in the slow query log:

Set slow query time to 1 second.

Deleted multiple indexes.

Stressed the system:

stress --cpu 100 --io 100 --vm 2 --vm-bytes 128M --timeout 1m

Scripted some basic webpage calls using wget.

None of this has generated slow queries. Is there another way of artificially stressing the database to generate problems? I don't have enough skills to write a complex Jmeter or other load generator. I'm hoping perhaps for something built into mysql or another linux trick beyond stress.

© Server Fault or respective owner

Related posts about mysql

Related posts about stress-testing

  • JMeter Stress testing

    as seen on Server Fault - Search for 'Server Fault'
    MAMP server hosting a Joomla instance. I'd like to hear the community's thoughts on the best way to stress test the server and find it's breaking point on concurrent users etc. Currently I have setup a test plan which I have going to the home page, grabbing the index.php, css, js and all images and… >>> More

  • Stresstesting ASP.NET/IIS with WCAT

    as seen on Stack Overflow - Search for 'Stack Overflow'
    I'm trying to setup a stress/load test using the WCAT toolkit included in the IIS Resources. Using LogParser, I've processed a UBR file with configuration. It looks something like this: [Configuration] NumClientMachines: 1 # number of distinct client machines to use NumClientThreads:… >>> More

  • web application load / stress testing services

    as seen on Programmers - Search for 'Programmers'
    Can you recommend reputable companies that offer help (consulting services, etc) in load testing (ASP.NET) web applications? We have a client looking to load test an ASP.NET application and we don't have any expertise in load testing web applications. The client is located in central Massachusetts… >>> More

  • Stress test speed on a gateway?

    as seen on Server Fault - Search for 'Server Fault'
    I'm interested in stress testing my gateway server but am lost on how. Most of the stress testing applications I've seen only see how much load an app like Apache can handle, but not this. Essentially I want to send as many packets I can into this box with one computer on one card and see how many… >>> More

  • Stress test speed on a gateway?

    as seen on Server Fault - Search for 'Server Fault'
    I'm interested in stress testing my gateway server but am lost on how. Most of the stress testing applications I've seen only see how much load an app like Apache can handle, but not this. Essentially I want to send as many packets I can into this box with one computer on one card and see how many… >>> More