[MySQLFAQ] series-what is the impact of enabling generallog?

Source: Internet
Author: User
We know that MySQL generallog is temporarily opened for debugging or tracking convenience. If online business requests are frequent, a large number of logs are generated instantly, which affects IOPS performance to a certain extent. In addition, we also have a work und, that is, to open slowquerylog and set 0, so that we can record all

We know that the general log of MySQL is temporarily opened for debugging or tracking convenience. If online business requests are frequent, a large number of logs are generated instantly, which affects IOPS performance to a certain extent. In addition, we also have a work und, that is, to open the slow query log and set it to = 0, so that we can record all

We know that the general log of MySQL is temporarily opened for debugging or tracking convenience. If online business requests are frequent, a large number of logs are generated instantly, which affects IOPS performance to a certain extent.

In addition, we also have a work und, that is, to open the slow query log and set it to = 0, so that all request logs can be recorded, in addition, the recorded log is smaller than the general log, and the IOPS performance may be less affected than the direct Open general log. Is that true? Let's compare and test it.

MySQL version: 5.5.5-10.0.11-MariaDB-log MariaDB Server
Test Tool: tpcc-mysql
Number of test Warehouse: 100
Warmup time: 60 s
Run time: 600 s
Concurrent threads: 512

For comparison of test results, see:

In "general scenarios", I set long_query_time = 1 and disable general log.

When all general logs are logged, The TpmC is about 73.28% of the records when the log is not opened, and the TpmC is about 59.53% of the records when all slow logs are logged. It can be seen that the direct opening of general log has less impact on TpmC, and the log generated in this mode is actually smaller. Isn't it a little ruined, haha O (?_ =) O ~

In addition, if log-output = TABLE is returned, please test it by yourself :)

Note: Only MySQL 5.1 and later versions support setting long_query_time to 0 s. In earlier versions, the minimum value is 1 s.

This entry was published on. Belongs to the database category and is labeled with FAQ, mariadb, MySQL, MySQL FAQ, and slowlog. The author is yejr. [MySQL FAQ] a large number of binlog dump records appear in the series-slow log

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.