Key_buffer_size settings in MyISAM

Source: Internet
Author: User

In MyISAM, key_buffer_size settings Key_read_requests and Key_reads are two counters. Their meanings are as follows: Key_read_requests: the number of requests that read the index from the cache. Key_reads: the number of requests that read the index from the disk. Generally, people think that the larger the value of Key_read_requests/Key_reads, the better. Otherwise, the key_buffer_size setting should be increased. However, there are two problems for tuning through the counter ratio: Problem 1: the ratio does not show the absolute value of the quantity. Problem 2: The counter does not consider the time factor. Although Key_read_requests is relatively small, it is better for system tuning, more importantly, it should be the Key_reads: Key_reads/Uptime in a unit of time. You can obtain a real-time data result through the command line, for example: # mysqladmin ext-ri10 | grep Key_reads | 83777189 | Key_reads | 211 | Key_reads | 177 | Key_reads | 202 | tip: mysqladmin ext in the command is actually mysqladmin extended-status, you even It can be abbreviated as mysqladmin e. The first line indicates the sum value, so you don't need to consider it here. The values in each row below indicate the data changes within 10 seconds, from this data, we can see that the system will see about 200 Key_reads accesses every 10 seconds, equivalent to about 20 accesses every 1 second. As to whether this value is reasonable or not, it depends on the disk capacity of the server. By the way, why does the data sampling take 10 seconds instead of 1 second? Here is the result of one second: # mysqladmin ext-ri1 | grep Key_reads | 83776743 | Key_reads | 7 | Key_reads | 7 | Key_reads | 38 | we can see that, because the time period is too small and the data changes dramatically, it is difficult to estimate the size intuitively. Therefore, it is better to sample data in a period of 10 or 60 seconds. Forget: Key_read_requests/Key_reads remember: Key_reads/Uptime

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.