How to use MySQL to execute 0.75 million NOSQL queries per second

Source: Internet
Author: User

As Web applications become increasingly complex, simple MySQL + Memcached seems to be unable to meet the needs of data storage. Some enterprises have switched to NoSQL solutions, such as MongoDB, CouchDB, TokyoCabinet/Tyrant, and Cassandra. In their opinion, if the data access mode is not very complex, SQL databases will not be used. However, DeNA chose the "only MySQL" solution and achieved far better performance than NoSQL.

The company is still using MySQL + Memcached. Memcached is mainly used for front-end Cache, such as pre-processing HTML, count, and digest information. However, data rows are not stored in the Cache, but are directly queried from the database, because a common server can get 0.75 million queries per second, what kind of NoSQL can do now?

You can use tools such as sysbench, super-smack, and mysqlslap to test MySQL performance, such

[Matsunobu @ host ~] $ Mysqlslap -- query = "select user_name ,..
From test. user where user_id = 1 "\
-- Number-of-queries = 10000000 -- concurrency = 30 -- host = xxx-uroot

Run the following command to obtain the number of rows read per second,

[Matsunobu @ host ~] $ Mysqladmin extended-status-I 1-r-uroot \
| Grep-e "Com_select"
...
| Com_selected | 107069 |
| Com_selected | 108873 |
| Com_selected | 108921 |
| Com_selected | 109511 |
| Com_selected | 108084 |
| Com_selected | 108483 |
| Com_selected | 108115 |
...

You can use tools such as vmstat and Oprofile to diagnose system bottlenecks.

MySQL Cluster has been criticized for its performance problems. To improve this situation, NDBAPI is introduced, which improves the performance by N times. But how can we optimize non-cluster conditions? Through MySQL bottleneck analysis, it is found that most of the time is spent on SQL parsing and table operations. If you bypass this layer of operation to directly access the storage engine, it can greatly improve the performance, the MySQL plug-in HandlerSocket is the result of obtaining the performance of 0.75 million queries per second. This evaluation data will undoubtedly subvert the NoSQL world. In addition, HandlerSocket supports batch read and write operations, which further improves its performance.

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.