mycat learning-3-test the throughput performance of mysql and mycat under jdbc connection

http://www.cnblogs.com/toulon/p/4815659.html

A recent project requires the database to have a large throughput. Because the project requires a large amount of access and data, it is decided to use a database middleware to manage the database. After some inquiries, I decided to use an open source project of Ali - mycat. Because mycat is based on mysql, it is for reading and writing on the disk, so the reading and writing speed will theoretically be less than or equal to mysql. For the sake of rigor, I used java to write a program for testing, and adopted basic optimizations. For example, the test results of the connection pool are as follows:

  engines: innodb, mysql: 20 threads, single insert, speed: 300-400/s

  Engines: innodb, mycat controls 3 data sources, 100 databases, inserts data into one table, 20 threads, single insert, speed: 300-400/s

  (The reason for the instability of the data is because it is all calculated by myself using a calculator -.-)

 

  This speed does not meet the demand. Later, a colleague remembered a mysql-based data engine-----TokuDB that he had come into contact with. A note about TokuDB on the Internet made my heart skip a beat: "9x better insert performance". =. = Admittedly I don't believe it, I'm going to try it myself. So I installed the tokudb engine for testing (the installation method is in another article of mine). as follows:

  engines: tokudb, mysql: 20 threads, single insert, speed: 600-900/s

  Engines: tokudb, mycat controls 1 data source, 50 databases, inserts data into one table, 20 threads, single insert, speed: 600-900 entries/s

  From my rough test data, it can be seen that the insertion performance of tokudb is actually not 9 times higher. I estimate that 9 times is the peak. But the 2x performance improvement is still pretty good. To reach the 1200+ that the customer said, at least there is hope.

 

  Of course, I was not satisfied with my rough data, so I decided to use professional stress testing software----jmeter for testing. However, the results of the test left me ashamed.

  jmeter can be downloaded from https://archive.apache.org/dist/jmeter/binaries/, and the zip version can be decompressed directly (if not, you may need to configure environment variables), click jmeter.bat in the bin directory to run.

  How to test jdbc? Proceed as follows:

  1. Click Browse on the test plan page to load the driver package entered into the database. The mysql I use, the driver package is mysql-connector-java-5.1.26-bin.jar.

  2. Right-click on the test plan and create a new thread group. The number of threads can be configured on the thread group page. I set it to 20. The ramp-up period parameter means in how many seconds all threads will be started, set to 1 second, and the number of loops is how many times the thread will execute in a loop.

  3. Right-click on the thread group, add - configure the original, and select JDBC Connection Configuration. The configuration is as follows:

         

 

  4. Right-click on the thread group - add -sampler-JDBC Request. The configuration is as follows:

                             

  5. Click on the thread group to add two listeners. Graph Results and View Results Tree. Used to monitor execution.

  6. Click on the menu bar to run - start.

  Here are the test results that made me ashamed:

  mycat:

    

    

  mysql:

    

    The throughput is only 200 per second! ! ! what the hell! ! But it does prove that the speed of mycat is indeed less than or equal to mysql...

    I can only attribute the reduction in speed to the software jmeter.... I hope someone who knows the principle can tell me the reason =.=

 


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325396537&siteId=291194637