In this session we will discuss selected areas of InnoDB and XtraDB 5.7 internals that are mostly related to buffer pool management, flushing, and the doublewrite buffer, from a performance and scalability point of view.
2. InnoDB buffer pool
• Clean and dirty data pages, distributed among
instances
• Protected by the buffer pool mutex:
• Data pages ordered by last access: LRU list
• Free pages: free list
• Protected by the flush list mutex:
• Dirty data pages ordered by first write: flush list
3. XtraDB buffer pool
• Clean and dirty data pages, distributed among instances
• Protected by the LRU list mutex:
• Data pages ordered by last access: LRU list
• Protected by the free list mutex:
• Free pages: free list
• Protected by the flush list mutex:
• Dirty data pages ordered by first write: flush list
4. MySQL multi-threaded
flushing
LRU instance #0 flush list instance #0
LRU instance #1 flush list instance #1
LRU instance #2 flush list instance #2
coordinator thread
worker thread #0
worker thread #1
time
0 s 1 s
LRU…
LRU…
LRU…
28. Summary: how we got there
• I/O-bound workloads: high demand for free pages,
provided by LRU batch flushing or single-page flushing
• Single-page flushes are bad, w/ and w/o doublewrite
• Removed it
• Made batch LRU flusher truly parallel
• Doublewrite buffer negates parallel flushing gains
• Made it parallel too