Not the answer you need?
Register and ask your own question!

Slow performance

Hi.
I just get new VPS and i install latest Percona MySQL server and benchmark on insert showing only ~700 queries per second. On my previous shared hosting same benchmark showing around 2000 queries per second.
I am using bechmark from Bitrix CMS (http://dev.1c-bitrix.ru/download/scripts/bitrix_server_test.php)
Is that result normal or a need to get worry?
My VPS:
OS: Ubuntu 18.04
CPU: 4 cores at 2.10GHz
RAM: 8Gb
SSD: 80Gb
Tagged:

Answers

  • vaibhav_upadhyay40vaibhav_upadhyay40 Contributor Current User Role Mentor
    Hi @supersonic45
    Please share below details for both old and new setup.
    Hardware spec (cpu ,ram ,disk details)
    os version and architecture (32 or 64 bit) 
    any other software installed? then provide details
    Percona MySQL version
    Percona MySQL config 
    method and details of testing

  • supersonic45supersonic45 Current User Role Poster
    i can`t tell previous setup hardware details, because it was shared hosting and all i can change there was disk space and how much memory per script i can use (i am set this to 256mb). That hosting using native MySQL server, not Percona.
    On my new VPS i have 64-bit OS, other specs i write in first post. I am also using nginx 1.19.2 and php 7.3.
    Percona MySQL version is 8.0.20-11
    Percona MySQL config is default:
    #
    # The Percona Server 8.0 configuration file.
    #
    # For explanations see

    [mysqld]
    pid-file        = /var/run/mysqld/mysqld.pid
    socket          = /var/run/mysqld/mysqld.sock
    datadir         = /var/lib/mysql
    log-error       = /var/log/mysql/error.log

    Part of it testing mysql performance:
    if ($mysqli = function_exists('mysqli_connect'))
    $conn = mysqli_connect($DBHost,$DBLogin,$DBPassword);
    else
    $conn = mysql_connect($DBHost,$DBLogin,$DBPassword);

    if ($conn)
    {
    show(array(GM('MYSQL_CONNECT'),'',1),1,0);
    $res=bx_mysql_query("SELECT version()");
    $f=bx_mysql_fetch_row($res);
    $pr=array(GM('MYSQL_VER'),GM('MYSQL_REQ'),1);
    show($pr,$f[0],version_compare($f[0], $MYSQL_MIN, '<'));

    $res=bx_mysql_query("SHOW VARIABLES LIKE 'sql_mode'");
    while($f=bx_mysql_fetch_row($res))
    show(array($f[0],GM('SQL_MODE_DESC'),1),"&nbsp;".$f[1],@preg_match("#strict#i",$f[1]));

    $res=bx_mysql_query("SHOW VARIABLES LIKE 'character\_set\_%'");
    while($f=bx_mysql_fetch_row($res))
    show(array($f[0],$warn),$f[1]);

    if ($mysqli ? mysqli_select_db($conn, $DBName) : mysql_select_db($DBName))
    {
    show(GM('MYSQL_SELECT_DB'),1,0);
    $name=create_tmp_table(true); // InnoDB
    $res=bx_mysql_query("SHOW CREATE TABLE $name");
    $f=bx_mysql_fetch_row($res);
    $val=preg_match("#ENGINE=InnoDB#",$f[1]);
    show(array(GM('INNODB'),'',2),$val,!$val);
    if ($name)
    bx_mysql_query("DROP TABLE ".$name);
    // Temporary table
    debug(__LINE__);
    $name=create_tmp_table();
    if ($name)
    {
    show(array(GM('DB_TEST_TABLE'),'',1),1,0);

    $t1=microtime_float();
    $good=true;
    // Insert 1000 rows
    debug(__LINE__);
    for($i=0;$i<1000;$i++)
    {
    if (!bx_mysql_query("INSERT INTO ".$name." VALUES ('test1','test2','test3','test4')"))
    {
    $good=false;
    break;
    }
    }
    if ($good)
    {
    $t2=microtime_float();
    $pr=array(GM('INSERT'),GM('INSERT_D'));
    $tmp = round(1000/($t2-$t1));
    show($pr,$tmp." q/".GM('SEC'),$tmp<2000);
    }
    else
    show(GM("INSERT"),GM("ERROR"),1);
    $pr = array(GM('DEL_TMP_TABLE'),'',1);
    if (bx_mysql_query("DROP TABLE ".$name))
    show($pr,1,0);
    else
    show($pr,0,1);
    } else
    show(GM('DB_TEST_TABLE'),GM('ERROR'),1);
    } else
    show(GM('DB_SELECT'),GM('ERROR'),1);
    } else
    show(GM('DB_CONNECT'),GM('ERROR'),1);

Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.