1

I'm facing a problem that i can't figure out, for some reason my MySQL server keeps on crashing after 30-40minutes the server load itself isn't too high, it's not even 0.5 (for 2 cpu machine) i've been trying to snoop around in the error log /var/log/mysql/error.log but couldn't find any clue, but i'll be the first to admit i might be due to lack of knowledge.

the server is ubuntu 12.04 with basic lamp settings.. every time to server crash i have to manually restart mysql otherwise it will stay down.

this is the error log i have:

130623 15:09:18 [Note] Plugin 'FEDERATED' is disabled.
130623 15:09:18 InnoDB: The InnoDB memory heap is disabled
130623 15:09:18 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130623 15:09:18 InnoDB: Compressed tables use zlib 1.2.3.4
130623 15:09:18 InnoDB: Initializing buffer pool, size = 128.0M
130623 15:09:18 InnoDB: Completed initialization of buffer pool
130623 15:09:18 InnoDB: highest supported file format is Barracuda.
130623 15:09:18  InnoDB: Waiting for the background threads to start
130623 15:09:19 InnoDB: 5.5.31 started; log sequence number 2220260
130623 15:09:19 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
130623 15:09:19 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
130623 15:09:19 [Note] Server socket created on IP: '127.0.0.1'.
130623 15:09:19 [Note] Event Scheduler: Loaded 0 events
130623 15:09:19 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.31-0ubuntu0.12.04.2'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu)
130623 15:27:48 [Note] Plugin 'FEDERATED' is disabled.
130623 15:27:48 InnoDB: The InnoDB memory heap is disabled
130623 15:27:48 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130623 15:27:48 InnoDB: Compressed tables use zlib 1.2.3.4
130623 15:27:48 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
130623 15:27:48 InnoDB: Completed initialization of buffer pool
130623 15:27:48 InnoDB: Fatal error: cannot allocate memory for the buffer pool
130623 15:27:48 [ERROR] Plugin 'InnoDB' init function returned error.
130623 15:27:48 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
130623 15:27:48 [ERROR] Unknown/unsupported storage engine: InnoDB
130623 15:27:48 [ERROR] Aborting

130623 15:27:48 [Note] /usr/sbin/mysqld: Shutdown complete

130623 15:27:49 [Note] Plugin 'FEDERATED' is disabled.
130623 15:27:49 InnoDB: The InnoDB memory heap is disabled
130623 15:27:49 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130623 15:27:49 InnoDB: Compressed tables use zlib 1.2.3.4
130623 15:27:49 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
130623 15:27:49 InnoDB: Completed initialization of buffer pool
130623 15:27:49 InnoDB: Fatal error: cannot allocate memory for the buffer pool
130623 15:27:49 [ERROR] Plugin 'InnoDB' init function returned error.
130623 15:27:49 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
130623 15:27:49 [ERROR] Unknown/unsupported storage engine: InnoDB
130623 15:27:49 [ERROR] Aborting

does anyone see something i don't ?

1

3 Answers 3

1

Uhmm, it appears twice in your log file

InnoDB: Fatal error: cannot allocate memory for the buffer pool
1

Edit your /etc/mysql/my.cnf adding this line

innodb_buffer_pool_size = 64M

And then restart the mysql

service mysql restart

It's a good thing to use the Swap if you don't have enough memory. Check out this nice article:

https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04

This works fine for me.

0

Add a swap file to clear this up.

You can follow this to setup the swap page:

http://www.prowebdev.us/2012/05/amazon-ec2-linux-micro-swap-space.html

https://stackoverflow.com/questions/10284532/amazon-ec2-mysql-aborting-start-because-innodb-mmap-x-bytes-failed-errno-12

You must log in to answer this question.