Quantcast
Channel: Comments on: Dump and reload InnoDB buffer pool in MySQL 5.6
Viewing all articles
Browse latest Browse all 5

By: Mark Leith

$
0
0

Both implementations can block buffer pool operations for certain periods of time.

Looking at the fix for the above mentioned bug by Laurynas (https://code.launchpad.net/~gl-az/percona-server/5.1-686534-881001/+merge/119062), I’d say that “does not block server operation anymore” is wrong, too. The LRU_list_mutex is still held whilst scanning the buffer pool pages, it’s just released whilst writing to the file, and reacquired immediately afterwards. And this is done for each individual page.

I really question parts of that fix too, especially the changes on lines 117/118 – the mutex should already be held there (line 109), and the goto skips releasing the mutex (and that is not done within end either).

The approach we have taken is very different. For those that want to follow along code wise see – http://bazaar.launchpad.net/~mysql/mysql-server/5.6/view/head:/storage/innobase/buf/buf0dump.cc#L178.

Instead of scanning the whole buffer pool LRU list in one go, we scan each buffer pool *instance* individually, and only hold the buf_pool mutex whilst we are getting the space# and page# number of each page, buffering the entire buffer pool instance’s pages along the way. We then release the buf_pool mutex, and write the entire buffer of page info per buffer pool instance out to the file.

Overall this means that you may get better concurrency with larger buffer pools if you appropriately tune the innodb_buffer_pool_instances variable as well – http://dev.mysql.com/doc/refman/5.6/en/innodb-performance.html#innodb-multiple-buffer-pools – tuning this with the Percona approach would have no effect.

Which approach is better? Hard to say without a comparison benchmark.. The Percona approach seems like it would aqcuire/release the mutex much more often, whereas our approach acquires different mutexes depending on the buffer pool instance, yet may hold it for slightly longer periods of time whilst generating the list to write out to the file.

Out of interest, why was the “dump on interval” done in the first place? Is that in case of a server crash (the only reason I can think of..)?


Viewing all articles
Browse latest Browse all 5

Trending Articles