У меня небольшая проблема с сбоями MySQL каждые ~ 24 часа.
Это журнал ошибок.
121205 9:42:49 [Note] Plugin 'FEDERATED' is disabled.
121205 9:42:49 InnoDB: The InnoDB memory heap is disabled
121205 9:42:49 InnoDB: Mutexes and rw_locks use GCC atomic builtins
121205 9:42:49 InnoDB: Compressed tables use zlib 1.2.3.4
121205 9:42:49 InnoDB: Initializing buffer pool, size = 512.0M
121205 9:42:49 InnoDB: Completed initialization of buffer pool
121205 9:42:49 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
121205 9:42:49 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
121205 9:42:49 InnoDB: Waiting for the background threads to start
121205 9:42:50 InnoDB: 1.1.8 started; log sequence number 2449055943
121205 9:42:50 [Note] Event Scheduler: Loaded 0 events
121205 9:42:50 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.22-0ubuntu1-log' socket: '/var/run/mysqld/mysqld.sock' port: 49827 (Ubuntu)
121205 9:42:51 [ERROR] /usr/sbin/mysqld: Table './application/songs' is marked as crashed and should be repaired
121205 9:42:51 [Warning] Checking table: './application/songs'
121205 9:42:51 [ERROR] /usr/sbin/mysqld: Table './application/artists' is marked as crashed and should be repaired
121205 9:42:51 [Warning] Checking table: './application/artists'
121205 9:42:52 [ERROR] /usr/sbin/mysqld: Table './application/channels' is marked as crashed and should be repaired
121205 9:42:52 [Warning] Checking table: './application/channels'
121205 10:50:57 [Note] Plugin 'FEDERATED' is disabled.
121205 10:50:57 InnoDB: The InnoDB memory heap is disabled
121205 10:50:57 InnoDB: Mutexes and rw_locks use GCC atomic builtins
121205 10:50:57 InnoDB: Compressed tables use zlib 1.2.3.4
121205 10:50:57 InnoDB: Initializing buffer pool, size = 512.0M
121205 10:50:57 InnoDB: Completed initialization of buffer pool
121205 10:50:57 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
121205 10:50:57 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
121205 10:50:57 InnoDB: Waiting for the background threads to start
121205 10:50:58 InnoDB: 1.1.8 started; log sequence number 2449882518
121205 10:50:58 [Note] Event Scheduler: Loaded 0 events
121205 10:50:58 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.22-0ubuntu1-log' socket: '/var/run/mysqld/mysqld.sock' port: 49827 (Ubuntu)
121205 10:50:59 [ERROR] /usr/sbin/mysqld: Table './application/artists' is marked as crashed and should be repaired
121205 10:50:59 [Warning] Checking table: './application/artists'
121205 10:50:59 [ERROR] /usr/sbin/mysqld: Table './application/songs' is marked as crashed and should be repaired
121205 10:50:59 [Warning] Checking table: './application/songs'
121205 10:51:00 [ERROR] /usr/sbin/mysqld: Table './application/channels' is marked as crashed and should be repaired
121205 10:51:00 [Warning] Checking table: './application/channels'
Вылетел сразу после 10:51 (как в журнале).
Почему это происходит?
Моя текущая система
Я предполагаю (и это дикий удар в темноте с таким объемом информации) заключается в том, что задание cron выполняется в одно и то же время каждый день и использует кучу памяти, поэтому Linux услужливо убивает какой-то другой процесс, который использует много объем памяти.
Проверьте свои журналы на наличие oom-killer
.
Сколько у вас оперативной памяти? Сколько MySQL использует? Что еще работает на коробке?