Details

    • Task
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.2.1
    • OTHER
    • None
    • 10.2.1-1, 10.2.1-2

    Description

      Put all OK packets in one physical packet.

      Attachments

        Issue Links

          Activity

            revision-id: 7e70658d1e88b4a255e3c28426f8259e5e596a85 (mariadb-10.2.0-20-g7e70658)
            parent(s): c0a59b46be5be341bd6ffc9fe188a236ced46522
            committer: Oleksandr Byelkin
            timestamp: 2016-05-09 15:26:18 +0200
            message:

            MDEV-9947: COM_MULTI united response

            sanja Oleksandr Byelkin added a comment - revision-id: 7e70658d1e88b4a255e3c28426f8259e5e596a85 (mariadb-10.2.0-20-g7e70658) parent(s): c0a59b46be5be341bd6ffc9fe188a236ced46522 committer: Oleksandr Byelkin timestamp: 2016-05-09 15:26:18 +0200 message: MDEV-9947 : COM_MULTI united response —
            sanja Oleksandr Byelkin added a comment - - edited

            So I made such test:

            send in one COM_MULTI 50 following group of 3 statement:

            insert into t1 values (1)
            insert into t1 values (2)
            delete from t1
            

            then read response
            and do it 10000 times

            I run 5 times test with my patch then 5 times without and then 3 times with and without (just to be sure that result is stable):

            With the patch (s):

            26.956
            26.743
            26.659
            26.708
            26.597
             
            26.671
            26.213
            26.501
            ------
            26.631
            

            without the patch (s):

            38.014
            39.698
            38.269
            39.738
            39.620
             
            39.558
            39.310
            39.779
            ------
            39.24825
            

            so it is 32% gain on 127.0.0.1 tcp connection.

            Server and test was compiled without debug info (for server all 4 times, client was compiled only once).
            Server started via ./mysql-test-run --start

            client:
            time ./unittest/libmariadb/features-10_2 -u root -d test -h 127.0.0.1 -P 16000

            the test function is:

            #define repeat1 50
            #define repeat2 10000
             
             
            static int com_multi_2(MYSQL *mysql)
            {
              int rc;
              enum mariadb_com_multi status;
             
             
              rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1");
              check_mysql_rc(rc, mysql);
              rc= mysql_query(mysql, "create table t1 (a int)");
              check_mysql_rc(rc, mysql);
             
              /* TEST COM_MULTI */
             
              for (uint i= 0; i < repeat2; i++)
              {
                status= MARIADB_COM_MULTI_BEGIN;
                if (mysql_options(mysql, MARIADB_OPT_COM_MULTI, &status))
                {
                  diag("COM_MULT not supported");
                  have_com_multi= 0;
                  return SKIP;
                }
             
                for (uint j= 0; j < repeat1; j++)
                {
                  rc= mysql_query(mysql, "insert into t1 values (1)");
                  rc= mysql_query(mysql, "insert into t1 values (2)");
                  rc= mysql_query(mysql, "delete from t1;");
                }
             
                status= MARIADB_COM_MULTI_END;
                rc= mysql_options(mysql, MARIADB_OPT_COM_MULTI, &status);
             
                for (uint j= 0; j < repeat1; j++)
                {
                  /* 1 INSERT */
                  check_mysql_rc(rc, mysql);
                  /* 2 INSERT */
                  rc= mysql_next_result(mysql);
                  check_mysql_rc(rc, mysql);
                  /* 3 DELETE */
                  rc= mysql_next_result(mysql);
                  check_mysql_rc(rc, mysql);
             
                  rc= mysql_next_result(mysql);
                  //printf("%u\n", (i+1)*repeat1 + j+1);
                }
                //putchar('.');
             
                rc= mysql_next_result(mysql);
                FAIL_UNLESS(rc == -1, "more then 3*repeat1 results");
              }
             
              /* TEST a simple query after COM_MULTI */
             
              rc= mysql_query(mysql, "drop table t1");
             
              /* question: how will result sets look like ? */
              diag("error: %s", mysql_error(mysql));
             
              return OK;
            }
            

            sanja Oleksandr Byelkin added a comment - - edited So I made such test: send in one COM_MULTI 50 following group of 3 statement: insert into t1 values (1) insert into t1 values (2) delete from t1 then read response and do it 10000 times I run 5 times test with my patch then 5 times without and then 3 times with and without (just to be sure that result is stable): With the patch (s): 26.956 26.743 26.659 26.708 26.597   26.671 26.213 26.501 ------ 26.631 without the patch (s): 38.014 39.698 38.269 39.738 39.620   39.558 39.310 39.779 ------ 39.24825 so it is 32% gain on 127.0.0.1 tcp connection. Server and test was compiled without debug info (for server all 4 times, client was compiled only once). Server started via ./mysql-test-run --start client: time ./unittest/libmariadb/features-10_2 -u root -d test -h 127.0.0.1 -P 16000 the test function is: #define repeat1 50 #define repeat2 10000     static int com_multi_2(MYSQL *mysql) { int rc; enum mariadb_com_multi status;     rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1"); check_mysql_rc(rc, mysql); rc= mysql_query(mysql, "create table t1 (a int)"); check_mysql_rc(rc, mysql);   /* TEST COM_MULTI */   for (uint i= 0; i < repeat2; i++) { status= MARIADB_COM_MULTI_BEGIN; if (mysql_options(mysql, MARIADB_OPT_COM_MULTI, &status)) { diag("COM_MULT not supported"); have_com_multi= 0; return SKIP; }   for (uint j= 0; j < repeat1; j++) { rc= mysql_query(mysql, "insert into t1 values (1)"); rc= mysql_query(mysql, "insert into t1 values (2)"); rc= mysql_query(mysql, "delete from t1;"); }   status= MARIADB_COM_MULTI_END; rc= mysql_options(mysql, MARIADB_OPT_COM_MULTI, &status);   for (uint j= 0; j < repeat1; j++) { /* 1 INSERT */ check_mysql_rc(rc, mysql); /* 2 INSERT */ rc= mysql_next_result(mysql); check_mysql_rc(rc, mysql); /* 3 DELETE */ rc= mysql_next_result(mysql); check_mysql_rc(rc, mysql);   rc= mysql_next_result(mysql); //printf("%u\n", (i+1)*repeat1 + j+1); } //putchar('.');   rc= mysql_next_result(mysql); FAIL_UNLESS(rc == -1, "more then 3*repeat1 results"); }   /* TEST a simple query after COM_MULTI */   rc= mysql_query(mysql, "drop table t1");   /* question: how will result sets look like ? */ diag("error: %s", mysql_error(mysql));   return OK; }
            sanja Oleksandr Byelkin added a comment - - edited

            there is problem in above test in case repeat1 = 100 (fixed in the connector by Georg)

            sanja Oleksandr Byelkin added a comment - - edited there is problem in above test in case repeat1 = 100 (fixed in the connector by Georg)

            revision-id: 8022548d2dd3ea4beef58a0613cc0f6a9d9e70be (mariadb-10.2.0-20-g8022548)
            parent(s): c0a59b46be5be341bd6ffc9fe188a236ced46522
            committer: Oleksandr Byelkin
            timestamp: 2016-05-14 14:04:08 +0200
            message:

            MDEV-9947: COM_MULTI united response

            sanja Oleksandr Byelkin added a comment - revision-id: 8022548d2dd3ea4beef58a0613cc0f6a9d9e70be (mariadb-10.2.0-20-g8022548) parent(s): c0a59b46be5be341bd6ffc9fe188a236ced46522 committer: Oleksandr Byelkin timestamp: 2016-05-14 14:04:08 +0200 message: MDEV-9947 : COM_MULTI united response —

            ok to push

            serg Sergei Golubchik added a comment - ok to push

            People

              sanja Oleksandr Byelkin
              sanja Oleksandr Byelkin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.