[MXS-1948] Connections not balanced between workers Created: 2018-06-29  Updated: 2018-08-03  Resolved: 2018-07-03

Status: Closed
Project: MariaDB MaxScale
Component/s: Core
Affects Version/s: 2.2.9
Fix Version/s: 2.2.11

Type: Bug Priority: Major
Reporter: dapeng huang Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None
Environment:

CentOS7


Attachments: PNG File image-2018-06-29-09-32-34-656.png     PNG File image.png    

 Description   

We found that, In high pressure, load is not balance between workers; Our test shows this have big impact on performance.

Test1: long session

sysbench --test=$sysbenchpath/tests/db/oltp.lua --mysql-host=$ro --mysql-port=$port --mysql-user=xxxx --mysql-password=xxxx --mysql-table-engine=innodb --oltp-table-size=25000 --oltp-tables-count=250 --db-driver=mysql --max-requests=0 --oltp_simple_ranges=0 --oltp-distinct-ranges=0 --oltp-sum-ranges=0 --oltp-order-ranges=0 --max-time=$maxtime --oltp-read-only=on --num-threads=256 --mysql-db=xxx  --report-interval=1 --oltp-skip-trx=on run


test2: short session

function prepare()
   return 0
end
 
function cleanup()
end
 
function thread_init(thread_id)
end
 
function event(thread_id)
   db_connect()
   rs = db_query("select 1;")
   db_disconnect()
end



 Comments   
Comment by Johan Wikman [ 2018-06-29 ]

dapeng Could please rerun your test with the following modification:

index 22db114..2f2463e 100644
--- a/server/modules/protocol/MySQL/mariadbclient/mysql_client.cc
+++ b/server/modules/protocol/MySQL/mariadbclient/mysql_client.cc
@@ -1342,7 +1342,7 @@ int gw_MySQLAccept(DCB *listener)
     }
     else
     {
-        while ((client_dcb = dcb_accept(listener)) != NULL)
+        if ((client_dcb = dcb_accept(listener)) != NULL)
         {
             gw_process_one_new_client(client_dcb);
         } /**< while client_dcb != NULL */

Does it have any effect?

Comment by dapeng huang [ 2018-07-02 ]

@johan.wikman@mariadb.com it doesn‘t have any effect。

Comment by markus makela [ 2018-07-03 ]

Changed the load balancing to use round-robin assignment of workers. This is known to produce acceptable performance in the general case as this is what was previously used. In addition to this, it will produce better load balancing when connections are created in bursts.

Generated at Thu Feb 08 04:10:35 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.