Home >Database >Mysql Tutorial >How JMeter Stress Tests MySQL Database

How JMeter Stress Tests MySQL Database

王林
王林forward
2023-05-27 23:03:231660browse

    1. Install and configure JMeter

    Download

    Official website download, download the binary zip

    How JMeter Stress Tests MySQL Database

    Configure environment variables

    Then unzip to your favorite location, configure the environment variables, create a new JMETER_HOME

    Then add %JMETER_HOME%\bin to the path

    Add
    %JMETER_HOME%\lib\ext\ApacheJMeter_core.jar;%JMETER_HOME%\lib\jorphan.jar;%JMETER_HOME%\lib\ at the front of CLASSPATH logkit-2.0.jar;

    How JMeter Stress Tests MySQL Database

    Import the MySQL driver

    Put the MySQL driver into the lib folder of the unzipped jmeter root directory ( No need to teach you how to download this)

    How JMeter Stress Tests MySQL Database

    Click browse below, find the driver in your lib, double-click it

    How JMeter Stress Tests MySQL Database

    2. Start JMeter

    Open the command line, enter jmeter.bat and the graphical interface of jmeter will automatically open. It is recommended to check the Chinese

    How JMeter Stress Tests MySQL Database

    How JMeter Stress Tests MySQL Database

    ##3. Start the stress test

    Configuration

    Right-click TestPlan and create a new thread group

    How JMeter Stress Tests MySQL Database

    The number of threads is the number of simulated users. Ramp-Up time refers to how long it takes for users to complete their requests.

    The following means that within 1 second, 100 users request the database at the same time. The number of cycles represents a total of 5 executions. Second-rate. It is recommended that the number of threads be set larger for better results.

    How JMeter Stress Tests MySQL Database

    Right-click the thread group and add a JDBC configuration component. You only need to configure the

    How JMeter Stress Tests MySQL Database

    How JMeter Stress Tests MySQL Database

    Right-click the thread group, add a JDBC Request sampler, test is the pool name configured previously, write the SQL statement in the box, the type can be selected to query or modify

    How JMeter Stress Tests MySQL Database

    How JMeter Stress Tests MySQL Database

    Right-click the thread group and add a few listeners. This is something to see the test results. You can add more to have fun with it yourself.

    How JMeter Stress Tests MySQL Database

    Observation results

    If there are mostly errors in the result tree, it means that the number of threads is set too high, that is, your database cannot bear it.

    How JMeter Stress Tests MySQL Database

    How JMeter Stress Tests MySQL Database

    The above is the detailed content of How JMeter Stress Tests MySQL Database. For more information, please follow other related articles on the PHP Chinese website!

    Statement:
    This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete