Bug #68077 | Mixing 4K/16K blocks increases 8K free blocks and holds buf pool mutex longer | ||
---|---|---|---|
Submitted: | 14 Jan 2013 3:37 | Modified: | 3 Apr 2013 11:33 |
Reporter: | Yoshinori Matsunobu (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S5 (Performance) |
Version: | 5.6 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[14 Jan 2013 3:37]
Yoshinori Matsunobu
[14 Jan 2013 7:16]
Marko Mäkelä
The allocation of InnoDB compressed pages is based on a binary buddy system, impelemented in buf0buddy.c. When the first 4k compressed page is allocated, buf0buddy.c will request a 16k page frame from the main buffer pool. This will then be split to 8k pages and further to 4k pages, to fulfill the request. When a page is freed, the buddy system can try to relocate blocks in order to create bigger free blocks. If you are only using 4k compressed pages, it probably does not seem to make that much sense to try to relocate blocks in order to get a free 8k block when releasing a 4k block. However, this relocation could still make some sense. If you release 4*n*4k blocks, the current system could release a full n*16k pages to the buffer pool. With the relocation disabled, in the worst case you would have one 4k block allocated in each 16k block, and the buffer pool would be underutilized. It is somewhat tricky to test and tweak this, because pages are not freed directly, but through the buffer pool LRU and unzip_LRU mechanism.
[25 Jan 2013 14:44]
Matthew Lord
Thank you for the great bug report, Yoshinori! I have marked this as verified and moved it into the internal bugs DB for the InnoDB team to examine further.
[13 Feb 2013 19:48]
Justin Tolmer
Note: I have fixed this issue in our branch by changing zip_free from a list to a rb tree.
[3 Apr 2013 11:33]
Bugs System
Added changelog entry to 5.6.11, 5.7.1: "When the InnoDB buffer pool is almost filled with 4KB compressed pages, inserting into 16KB compact tables would cause 8KB >pages_free to increase, which could potentially slow or stall inserts."