Bug #90943 Buffer pool size adjustment can cause crashes on small instance sizes
Submitted: 20 May 2018 14:42 Modified: 20 May 2018 15:44
Reporter: Peter Zaitsev Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Options Severity:S3 (Non-critical)
Version:5.7/8.0 OS:Any
Assigned to: CPU Architecture:Any
Tags: innodb

[20 May 2018 14:42] Peter Zaitsev
Description:
Buffer pool size calculation while documented is very non-obvious and can cause OOM crashes 

When specifying innodb_buffer_pool_size on startup  this size is rounded-up to the nearest  innodb_buffer_pool_instances*innodb_buffer_pool_chunk_size value

This will be 128M for buffer pools below 1GB and  1GB for buffer pools over 1GB

This means if I am using small instance with 2GB memory and size  buffer pool size to reasonable 1200M  it will be resized to 2GB without warning and risk swapping or OOM crashes

How to repeat:
Start MySQL with innodb_buffer_pool_size=1025M 

see the actual innodb_buffer_pool_size used is 2G

Suggested fix:
I believe

1) For memory usage rounding DOWN is less risky choice than Rounding UP as currently.

2) At the very least changing going to 8 buffer pools from  1GB to  4GB or 8GB would be good.
[20 May 2018 15:44] MySQL Verification Team
Thank you for the bug report.