MySQL stress test tools

  • Hi together...
    I need to make a stress test on one server.
    I found this site: http://dev.mysql.com/doc/mysqltest/2.0/en/test-programs.html
    but where are the scripts?


    Does anyone know where i can get this scripts?
    Or has anyone another idea?


    I should simulate a lot of traffic (up to 1000 connections with sql queries)...
    For the apache i found the tool "ab".


    Greetz
    Sascha

  • you want stress test mysql or your web server (apache + mysql )


    if you want stress your webserver : google chrome with hight refresh page p^^ + 100 pages open


    make a test page with hight SQL request (read and write for large table) and PHP page with most FOR)


    i test my server with that and it terrible p^^

    Debian 6 with proxmox 2 - OpenVZ - KVM
    I-mscp 1.0.3.0 migrate from ispcp 1.0.7
    dovecot + zarafa + z-push + maia mail guard + apacheITK

  • :D:D:D:D
    No... I have found everything
    http://packages.debian.org/de/sid/mysql-source-5.1


    There ist everything i need..
    But the idea to test the apache and mysql is better.
    So i created a php script with mysql queries.
    Then i use ab

    Code
    1. ab -n 1000 -c 50 http:/my_domnain.tld/my_script.php | tee /tmp/apache_perf.log


    This will open 1000 request and 50 concurrency...:angel:

    Edited once, last by TheCry ().

  • for php script i use this


    <META HTTP-EQUIV="Refresh" CONTENT="1"; URL=test.php">
    <?php
    function random_str(){


    $result="";
    for ($i = 1; $i <= 16; $i++) {


    $base10Rand = mt_rand(0, 15);
    $newRand = base_convert($base10Rand, 10, 36);
    $result.=$newRand;
    }
    return $result;


    }


    mysql_connect ("127.0.0.1", "test", "password");
    mysql_select_db ("test");


    $query = "CREATE TABLE IF NOT EXISTS test (test1 int(100) NOT NULL, test2 int(100) NOT NULL, test3 int(100) NOT NULL, test4 int(100) NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
    mysql_query($query);
    $aa=array();
    for ($i=1; $i <= 1000; $i++) {
    $a=random_str();
    $aa[]=$a;
    $b=random_str();
    $c=random_str();
    $d=random_str();
    $query="INSERT INTO test SET test1='$a', test2='$b', test3='$c', test4='$d'";
    mysql_query($query);
    }


    $query="SELECT * FROM test";
    mysql_query($query);


    foreach ($aa as $value) {
    $query="DELETE FROM test WHERE test1='$value'";
    mysql_query($query);
    }


    ?>





    6 request / s -> the server are 100 % IOPS use

    Debian 6 with proxmox 2 - OpenVZ - KVM
    I-mscp 1.0.3.0 migrate from ispcp 1.0.7
    dovecot + zarafa + z-push + maia mail guard + apacheITK

  • krok
    i duplicated your script 25 times with also 25 diff. tables for the first test. then running all in 25 tabs
    for the second test all the same but also 25 diff. databases


    and both variants don´t stress my server at all. the load was rising from 0,07 to 0,09 / 0,07 to 0,10


    server is running on a:Intel® Xeon® E3-1275 Quad-Core / 16 GB DDR3 RAM ECC / SATA hd´s


    TheCry
    please could you post your "my_script.php"



    thank you

  • How many request / s your launch the script ?


    i have test 15 req/s and the database grow up , 10 min ago the databasse size > 5 go and mysql use all memory cache.
    at this time the server is high load IOPS : HDD drive is 100% load but not CPU.

    Debian 6 with proxmox 2 - OpenVZ - KVM
    I-mscp 1.0.3.0 migrate from ispcp 1.0.7
    dovecot + zarafa + z-push + maia mail guard + apacheITK

  • Thank You!


    so no problems with my server: cpu´s=38% load=1,87


    Benchmarking domain.tld (be patient)



    Server Software: Apache/2.2.16
    Server Hostname: domain.tld
    Server Port: 80


    Document Path: /stress_1.php
    Document Length: 24 bytes


    Concurrency Level: 50
    Time taken for tests: 87.234 seconds
    Complete requests: 1000
    Failed requests: 0
    (Connect: 0, Receive: 0, Length: 0, Exceptions: 0)
    Write errors: 0
    Non-2xx responses: 7
    Total transferred: 187637 bytes
    HTML transferred: 31636 bytes
    Requests per second: 11.46 [#/sec] (mean)
    Time per request: 4361.700 [ms] (mean)
    Time per request: 87.234 [ms] (mean, across all concurrent requests)
    Transfer rate: 2.10 [Kbytes/sec] received


    Connection Times (ms)
    min mean[+/-sd] median max
    Connect: 0 0 0.4 0 2
    Processing: 335 4248 564.1 4308 5235
    Waiting: 335 4248 564.1 4308 5235
    Total: 337 4248 563.8 4308 5235


    Percentage of the requests served within a certain time (ms)
    50% 4308
    66% 4348
    75% 4371
    80% 4387
    90% 4459
    95% 4793
    98% 5152
    99% 5196
    100% 5235 (longest request)

  • Did the test too


    Failed requests... I used the script from TheCrys link. The failed requests happens because of the dynamic page or?


    Intel i7 all Kernels are full loaded - load up tu 1.3
    MySQL Test done in 24-30ms