I have AWS micro stance, 612MB RAM. I have Apache, PHP, MySQL and Magento running. But from time to time, mysql stops itself. I don't know why? My mysql log looks:

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

Thanks in advance


The error indicates essentially an out of memory exception, and it's easy to understand why from your description. You're running too many things in too small an amount of memory.

My best guess would be that traffic to Apache increases memory usage (each process can use 50-100mb or more depending on the use and connection limit) to the point where MySQL cannot allocate enough for normal operation, and it dies with the above message.

Now that's just PHP, Apache and MySQL, I have no idea what Magento is, but it's unlikely to make this already bad situation any better.

I realize you're using Micro because it's free, but seriously consider using the DB service separately from the web server. Apache will use a lot of memory when bursts of traffic come in, or just from normal operation over time. Generally it's worthwhile to think that Apache will use 100MB per process you allow it, though it will of course use more with PHP and such.

| improve this answer | |
  • On second thought, I agree with @lain. This is a duplicate question. – SplinterReality Aug 15 '13 at 8:55
  • I wonder if the OOM_killer ate it. – Tom O'Connor Aug 15 '13 at 10:04
  • 1
    Hey, that's an awesome function I never knew about. Thanks for teaching me something new! – SplinterReality Aug 16 '13 at 0:04

This questions is answered in stackoverflow. Adding swap fixed the crash. The link for solution is https://stackoverflow.com/questions/10284532/amazon-ec2-mysql-aborting-start-because-innodb-mmap-x-bytes-failed-errno-12

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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