Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 ?

share|improve this question
    
For anyone who might reach this topic with similar problem, the following link solved my issue (even though i'm not on EC2) prowebdev.us/2012/05/amazon-ec2-linux-micro-swap-space.html –  user148366 Jun 23 '13 at 16:34
add comment

3 Answers

up vote 1 down vote accepted

Uhmm, it appears twice in your log file

InnoDB: Fatal error: cannot allocate memory for the buffer pool
share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.