MySQL boot prompt Can not allocate memory for the buffer pool

surroundings:

malfunction:

In total physical memory on a server 125G, modified after the mysql innodb_buffer_pool_size 64G, start being given, the following theme:

The reason is almost out of memory error.

diagnosis

I began to think that the problem is tuning parameters, see the official website after carefully, did not find any problems; innodb_buffer_pool_size try to adjust to 60G, the database can start, it was suspected that the operating system memory allocation limits. Was found by the investigation of the operating system / proc / sys / vm / overcommit_memory is 2, and the default value should be zero. overcommit_memory is a core strategy for memory allocation, carefully see this parameter, roughly defined as follows:

overcommit_memory = 0, represents the kernel will check whether there is enough supply of available memory by using the process; if there is enough free memory, memory allocation allows; otherwise, memory allocation fails, and the error is returned to the application process.

overcommit_memory = 1, represents a kernel allows allocation of all physical memory, regardless of the current memory status.

overcommit_memory = 2, represents the kernel memory to allow to allocate more than the sum of physical memory and swap space all.

When overcommit_memory = 2, which generally represents the percentage of total system memory, particularly virtual memory is the sum of:

Memory sum = SwapTotal + MemTotal * overcommit_ratio, overcommit_ratio where the default 50%.

solution

After diagnosis by the above, the solution is to modify the / proc / sys / vm / overcommit_memory 0:

echo  0  > /proc/sys/vm/overcommit_memory

After editing, start mysql again, this time able to start properly.

Guess you like

Origin www.linuxidc.com/Linux/2019-09/160671.htm