In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
I. Analysis of storage structure
MySQL storage structure diagram:
Parsing:
1. Read operation: memory read-> cache cache read-> disk physical read
The read data will be sent back in the above order.
2. Write operation: write memory data directly to cache cache (very fast)-> write disk
It can be seen from the above that cache plays a key role in the fast reading and writing speed of MySQL.
1. Cache cache features:
1. High speed
2. Loss of power-off data
3. Limited capacity
2. Measures to protect data security (to prevent data loss in case of accidental power loss):
In storage, add BBU (battery backup unit, that is, battery). After the power is off, the data in the cache can be written to disk to ensure that the data will not be lost.
If BBU is not provided or the BBU is broken, memory data is not written to the cache cache, but directly to the disk; compared to writing to memory, the speed of writing to disk is greatly reduced (by ten thousand times). At the same time, because slow "writing" accounts for most of the "read" bandwidth. Therefore, the problem of BBU is a big influence factor of poor reading and writing performance.
3. Cache cache capacity is limited.
(4G, 8G, 16G, 32G), in order to keep cache useful, the system will periodically write cache cached data to disk to prevent cache from being full.
Second, the analysis of slow writing speed of storage.
Database-- > write speed is slow-- > system hang lives
Q: how to judge that the writing speed is slow?
A:
1. Suspect BBU problem
Monitor the bug of BBU, solve: restart BBU
2. Cache is full (similar to the case where BBU is broken)
1. Massive write data fill up the cache cache, so judge:
Shell > iostat-x
Mysql > show global status like 'handler_write'
2. The writing speed of cache to disk is slow (the speed of drainage is much less than that of water injection).
The hard disk Icano is abnormal, the load is too high: massive physical reads of the database (abnormal SQL), judge:
Mysql > show status like 'Innodb_buffer_pool_reads'
3. Poor storage performance
1. The storage device is poor, update the device
2, disaster preparedness synchronous risk, "the best engineer is no match for Lanxiang's excavator and migrant worker's hoe."
III. About BBU
English abbreviation: BBU
English full name: Battery Backup Unit
Full name: battery backup unit, battery
1. Function:
After the power is off, write the cached data to the hard disk to ensure that the data will not be lost
It is a protective measure for accidental power failure to brush dirty data.
It can provide backup power support in the case of external power supply failure to ensure the security of business data in the storage array.
2. Many storage devices will be equipped with BBU
BBU provides power for the RAID controller cache when there is a problem with the power supply. When the power supply is cut off, BBU Power enables the data in the cache in the controller to be saved for a certain period of time (depending on the model of the BBU). Users only need to restore the normal power supply before the BBU power is exhausted (the battery is limited), and the data in the cache can be fully written back to the RAID to avoid data loss caused by power outage.
Different from the server battery, the server can be equipped with a battery when configuring the raid card, which can keep the data in memory from being lost after the system is powered off, but the time is limited, about 12 hours, if it is 12 hours, if it is not restored within 12 hours, the data in memory will be lost.
3. Super capacitor
The server also has a way of protection, called the super capacitor, which is also matched with the raid card. It can write the data in the cache to the capacitor after the server is powered off, and it will be saved forever, similar to writing to the hard disk, which is actually a write capacitor, which you understand as writing to a USB drive. It is better than the battery, and even if the server is not powered back on after 12 hours, it will not cause data loss.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.