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.

Hi all this night I have imported into my server (server Linux 512Mb Ram with ubuntu), is a very big import in a database with Magento (e commerce). When I open my site mysql doesn't work, I have seen that in the server the service is down, stopped. I have restarted all apache 2 and memcache and now works. But I want to know why mysql was stopped. In /var/log/mysql/error.log I founded this line:

InnoDB: Progress in percents: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52$
InnoDB: Rolling back of trx id 1CA46C3 completed
130126 14:29:58  InnoDB: Rollback of non-prepared transactions completed
130128  6:05:51 [Note] Plugin 'FEDERATED' is disabled.
130128  6:05:59 InnoDB: The InnoDB memory heap is disabled
130128  6:05:59 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130128  6:05:59 InnoDB: Compressed tables use zlib 1.2.3.4
130128  6:06:11 InnoDB: Initializing buffer pool, size = 128.0M
130128  6:06:19 InnoDB: Completed initialization of buffer pool
130128  6:11:51 [Note] Plugin 'FEDERATED' is disabled.
130128  6:12:01 InnoDB: The InnoDB memory heap is disabled
130128  6:12:01 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130128  6:12:01 InnoDB: Compressed tables use zlib 1.2.3.4
130128  6:12:19 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
130128  6:12:23 InnoDB: Completed initialization of buffer pool
130128  6:12:23 InnoDB: Fatal error: cannot allocate memory for the buffer pool
130128  6:12:28 [ERROR] Plugin 'InnoDB' init function returned error.
130128  6:12:29 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
130128  6:12:30 [ERROR] Unknown/unsupported storage engine: InnoDB
130128  6:12:30 [ERROR] Aborting

130128  6:12:32 [Note] /usr/sbin/mysqld: Shutdown complete


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

130128  6:21:04 [Note] /usr/sbin/mysqld: Shutdown complete

Can you help me to find the problem? This line can be usefull to understand the problem?

share|improve this question
    
130128 6:21:03 InnoDB: Fatal error: cannot allocate memory for the buffer pool <- Seems to cause the problem, do you have free memory? –  coincoin Jan 28 '13 at 8:35
    
yes the hard disk is used 47% there are 25G available @EricDANNIELOU –  Alessandro Minoccheri Jan 28 '13 at 8:42
    
I meant memory, RAM –  coincoin Jan 28 '13 at 8:44
1  
Have a look at cacti/munin/whatever graph to figure out how much memory there was. –  coincoin Jan 28 '13 at 8:48
1  
Repeat this mantra three times every day: If it's not monitored, it's not in production. (This includes your RAM.) –  Ladadadada Jan 28 '13 at 9:35

2 Answers 2

up vote 1 down vote accepted

As suggested in the comments, you should install any monitoring software.

If ever your problem happens again, you will then be able to figure out why.

Note that some people had the same problem and solved it by adding swap.

share|improve this answer
    
ok I have installed cacti now I monitor the memory, this night I import again the database and I'll see the graph, thanks! –  Alessandro Minoccheri Jan 28 '13 at 10:51
    
How can you possibly advocate adding SWAP - over adding more RAM? –  MageStackDay Needs You ... Feb 2 '13 at 0:52
    
Money : If op had money, he would be on a dedicated server with plenty of ram instead of (just a guess) vps. –  coincoin Feb 2 '13 at 1:37

Firstly, I cannot possibly imagine why you are trying to run a Magento store with only 512MB of RAM - its a recipe for disaster.

130128 6:21:03 InnoDB: Fatal error: cannot allocate memory for the buffer pool

This is one of two things.

You've over allocated memory in your my.cnf

This wouldn't be a surprise if you've copy+pasted an "optimised" Magento MySQL config off the internet - without paying any attention to the differentiation of your hardware, and the OP's hardware.

You can verify by executing,

mysql> show variables like 'innodb_buffer%';

If that figure is exceeding your amount of RAM - then reduce it in your MySQL config /etc/mysql/my.cnf or /etc/my.cnf and restart MySQL.

You're restricted by ulimit

Even if your MySQL config is within acceptable memory limits - you could be restricted by the server settings.

You can verify by executing,

ulimit  -a

And checking the values for virtual memory and max memory size. Test it by executing

ulimit -v unlimited
ulimit -m unlimited

Then starting MySQL

/etc/init.d/mysql start
share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.