I've had a openSUSE 11.4 VM running for quite some time with no problems. Recently, ever day or so my MariaDB (MySQL fork) will crash out of nowhere. Nothing has really changed as far as database side or site traffic. When I restart MySQL, I see the following:
120911 02:09:33 mysqld_safe Number of processes running now: 0 120911 02:09:40 mysqld_safe mysqld restarted 120911 2:17:07 [Note] Plugin 'ndbcluster' is disabled. InnoDB: The InnoDB memory heap is disabled InnoDB: Mutexes and rw_locks use GCC atomic builtins InnoDB: Compressed tables use zlib 1.2.5 120911 2:17:52 InnoDB: Initializing buffer pool, size = 80.0M 120911 2:17:52 InnoDB: Completed initialization of buffer pool 120911 02:18:47 mysqld_safe mysqld from pid file /var/run/mysql/mysqld.pid ended 120911 09:57:06 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 120911 9:57:07 [Note] Plugin 'ndbcluster' is disabled. InnoDB: The InnoDB memory heap is disabled InnoDB: Mutexes and rw_locks use GCC atomic builtins InnoDB: Compressed tables use zlib 1.2.5 120911 9:57:07 InnoDB: Initializing buffer pool, size = 80.0M 120911 9:57:07 InnoDB: Completed initialization of buffer pool
Occasionally I use to see errors like these in my logs:
InnoDB: mmap(550764544 bytes) failed; errno 12 120904 2:08:50InnoDB: Fatal error: cannot allocate the memory for the buffer pool 120904 2:08:50 [ERROR] Plugin 'InnoDB' init function returned error. 120904 2:08:50 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 120904 2:08:50 [ERROR] Failed to initialize plugins. 120904 2:08:50 [ERROR] Aborting
But I played around with my buffer pool size and now I don't even get that error. The entire size of /var/lib/mysql is 669 MB on disk. 604M is the size of all the mysql-bin files, with the actual database directories only being 46MB.
My actual my.cnf is as follows:
[client] port = 3306 socket = /var/run/mysql/mysql.sock [mysqld] port = 3306 socket = /var/run/mysql/mysql.sock datadir = /var/lib/mysql skip-external-locking key_buffer_size = 16M max_allowed_packet = 2M table_open_cache = 64 sort_buffer_size = 512K net_buffer_length = 8K read_buffer_size = 256K read_rnd_buffer_size = 512K myisam_sort_buffer_size = 8M log-bin=mysql-bin binlog_format=mixed server-id = 1 innodb_buffer_pool_size = 80M [safe_mysqld] log-error = /var/log/mysql/mysqld.log socket = /var/run/mysql/mysql.sock !include_dir /etc/mysql [mysqldump] socket = /var/run/mysql/mysql.sock quick max_allowed_packet = 16M [mysql] no-auto-rehash [myisamchk] key_buffer_size = 20M sort_buffer_size = 20M read_buffer = 2M write_buffer = 2M [mysqlhotcopy] interactive-timeout [mysqld_multi] mysqld = /usr/bin/mysqld_safe mysqladmin = /usr/bin/mysqladmin log = /var/log/mysqld_multi.log