Mysql Insert Data Performance test

Source: Internet
Author: User
Tags mongodb mysql insert

Some tests were done on MySQL some time ago, and some test data were obtained. On the Internet to see some of the relevant summary of MySQL, and can not blindly believe, or need to look at the data to speak.

The following test cases insert 10 million data, test each of the three types of data table types (MYISAM,INNODB,NDB), and test cases are:

The NDB is the official cluster deployment version, and the test data is based on 6.x. Mysql Proxy is also official, with the same as the 0.8.x version, do load balancing, read and write separation test, load balance is relatively stable, but read-write separation in multithreading is very unstable.
Single-thread for 1.MYISAM type datasheet
2.INNODB type datasheet for single thread, open Innodb_flush_log_at_trx_commit
3.INNODB type datasheet for single thread, close Innodb_flush_log_at_trx_commit
4.MYISAM 100 thread, 100 connection pool
5.INNODB 100 thread, 100 connection pool, NO LOG
6.MYISAM 1000 threads, 1000 thread pools
7.INNODB 1000 threads, 1000 thread pools
8.NDB type datasheet (3NODE, 3 redundancy), single thread, using MySQL proxy load balancing
9.NDB (3NODE, 3 redundancy), 100 threads, 100 connection pools, using MySQL proxy
10.NDB (3NODE, 3 redundancy), 1000 threads, 1000 connection pools, using MySQL proxy


Test Results Summary:

• The horizontal axis is the data quantity, the ordinate is the time, the unit millisecond. The performance of the machine used to bubble test cases is more than once, starting 2000 threads and then running.
• The test case does not use a transaction, all test inserts are 10 varchar (255) fields, and a 10 32-bit UUID is inserted, except that no other indexes are established for the primary key.
• Testing is run on the virtual machine, NDB type due to the virtual machine to share the network card and CPU reasons, is the three independent host.
MyISAM in the stress test the advantage is very obvious, the bottom line is 100 threads, second only to 1000 threads, and the performance is basically linear.

The InnoDB test first depends on the condition of the innodb_flush_log_at_trx_commit, the performance of the log on a single path almost to the bottom.
InnoDB After the log is closed, performance is acceptable, but under large pressure performance has a significant drop, and is not called linear.
NDB data in memory, plus a set of 3 redundancy, the default configuration of memory quickly consumed, you need to manually set the use of memory size. The establishment of visual data redundancy is synchronous.
NDB data because it is in memory, the test performance is not too bad. NDB is the bottom of the single thread, may proxy performance has a certain effect, but the good news is that 100 threads and 1000 threads on the graph performance is basically coincident.


MySQL-related technology is very rich and diverse, basically I can think of online can find relevant solutions. However, in the era of cloud computing, it may be necessary to consider backward compatibility, there is no special solution to the data consistency, high load, redundant disaster preparedness and massive data and so on. From the insert point of view, the MongoDB test 10 million data in a single thread, 3 times times the speed of MySQL, based on the storage principle (MongoDB index in memory) to estimate the Select performance gap will be greater. More and more non-relational databases are becoming more and more mature in these aspects, MySQL's advantages basically only the business support.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.