In previous post, I've introduced MySQL Fabric and give two video(1 2) to show how to use it. It is pretty simple and user-friendly. You can use it to manage a farm of MySQL servers. But I also pointed out that the XML-RPC protocol used by Fabric server may become a bottleneck. Now, I've tested it. And I would say my concern is justifiable and reasonable.
I can't directly use sysbench to test due to the fact that it is written by C. So I have to write it by myself. I choose Python as it is very suitable for writing a simple benchmark. The code can be download from here. It is pretty simple benchmark, just selecting data by primary key by a number of threads.
Since I test in one server, I have to configure Fabric Server, back store, MySQL servers all in one. The following picture is my whole MySQL Fabric architecture:
I find that Oracle MySQL Python Connector is written fully by Python. So I compare the Oracle MySQL Connector with Python MySQLdb which is wrapped C API. The following table show the final result:
As you can see it, when you connect using MySQL Fabric XML-RPC protocol. The performance is 1/5 ~ 1/4 than using direct MySQL protocol connection. In addition, MySQLdb is 1.2 ~ 1.5 times faster than Oracle Python MySQL Connector.
Another problem bother me about my test is that when doing benchmark under thread 128 or 512, it will raise following errors or something like that, which causes the QPS to decline dramatically. I've tune some parameter, like connect_attempts, connect_delay, ttl, but it does not help at all.
Reported faulty server to Fabric (2003: Can't connect to MySQL server on 'localhost:3309' (99 Cannot assign requested address))
I notice that Fabric Server protocol seems configurable in fabric.cfg. Currently it only supports XML-PRC. I hope MySQL Fabric can support a higher performance protocol and address the performance disparity between itself and Python MySQLdb. Only in this way, can MySQL Fabric be really and rapidly used in production environment.
Now I guess it's time for reading the code of MySQL Fabric.