In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
What is mysql background thread, I believe that many inexperienced people do not know what to do about it, so this article summarizes the causes and solutions of the problem, through this article I hope you can solve this problem.
1.mysql background thread
Mysql background threads are mainly used to maintain the normal operation of the server and complete the tasks submitted by users, including: master thread,read thread,write thread,redo log thread,change buffer thread,page cleaner thread,purge thread,checkpoint,error monitor thread,lock monitor thread and so on.
Detailed explanation of 2.mysql background thread
1) master thread
Master thread has the highest priority and contains several loops: main loop (loop), background loop (background loop), refresh loop (flush loop), and pause loop (suspend loop). Master thread will switch between the above loops according to the relevant state of its internal operation.
Most of the operations are done in the main cycle (loop), which includes 1 s and 10 s operations.
1s operations mainly include: log buffer flushing to disk (always, even if the transaction has not been committed); brushing up to 100 new dirty pages to disk (possible); performing and changing buffer operations (possible); if there is no current user activity, you may switch to background loop and so on.
10s operations mainly include: refreshing 100 dirty pages to disk (possible); merging up to 5 change buffers (always); log buffers flushing to disk (always); deleting useless undo pages (always); refreshing 100 or 10 dirty pages to disk (always) to generate a checkpoint (always), etc.
2) read thread
Read thread is the mysql reader thread, default is 4, it is responsible for reading data pages from disk, which is controlled by the innodb_read_io_threads option. The user thread initiates the read request and puts it into the read request queue. Read threads takes the read task from the read request queue and completes it.
3) write thread
Write thread is mysql write thread, default is 4, it is responsible for writing data page from buffer to disk, it is controlled by innodb_write_io_threads control option. Page _ cleaner thread initiates write request and puts it into write request queue, write threads gets write task from write request queue and completes it.
4) redo log thread
Redo log thread is responsible for flushing the contents of the log buffer into the redo log file.
5) change buffer thread
Change buffer thread is responsible for flushing the contents of the change buffer (change buffer) to disk.
6) page cleaner thread
Page cleaner thread is the thread responsible for dirty page refresh, which can be added more than one from MySQL5.7.
7) purge thread
Purge thread is responsible for deleting useless undo pages. As the operation of the DML statement will generate undo, the system needs to clean up the undo page regularly, which requires purge operation. At the same time, it also clears the useless clustered and secondary index data that has been marked as deleted but has not been cleaned. Mysql5.6 starts to separate purge thread from master thread, which is controlled by the innodb_purge_thread option. The default is 1, and the maximum can be adjusted to 32.
8) checkpoint thread
Checkpoint thread is responsible for executing checkpoint. Checkpoint thread when the redo log is switched.
9) error monitor thread
Error monitor thread is responsible for monitoring mysql error reports.
10) lock monitor thread
Lock monitor thread is responsible for the monitoring of mysql locks.
After reading the above, have you mastered what is the method of mysql background thread? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
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.