Mysql travando devido ao InnoDB não conseguir alocar memória

2

O MySQL trava de vez em quando devido a, creio eu, um grande pedido acertando acima do conjunto innodb-buffer-pool-size em my.cnf (atualmente em 210M), que eu precisava configurar para o mysql iniciar o primeiro lugar.

Aqui estão os registros de erros:

    130518 17:28:52 mysqld_safe Number of processes running now: 0
    130518 17:28:52 mysqld_safe mysqld restarted
    130518 17:28:52 [Note] Plugin 'FEDERATED' is disabled.
    130518 17:28:52 InnoDB: Mutexes and rw_locks use GCC atomic builtins
    130518 17:28:52 InnoDB: Compressed tables use zlib 1.2.3
    130518 17:28:52 InnoDB: Using Linux native AIO
    130518 17:28:52 InnoDB: Initializing buffer pool, size = 210.0M
    InnoDB: mmap(223117312 bytes) failed; errno 12
    130518 17:28:52 InnoDB: Completed initialization of buffer pool
    130518 17:28:52 InnoDB: Fatal error: cannot allocate memory for the buffer pool
    130518 17:28:52 [ERROR] Plugin 'InnoDB' init function returned error.
    130518 17:28:52 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
    130518 17:28:52 [ERROR] Unknown/unsupported storage engine: InnoDB
    130518 17:28:52 [ERROR] Aborting

    130518 17:28:52 [Note] /usr/libexec/mysqld: Shutdown complete

    130518 17:28:52 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

Reiniciei o servidor e reiniciei o mysqld aqui. Corrige o problema temporariamente, mas irá falhar novamente.

    130518 18:22:32 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    130518 18:22:32 [Note] Plugin 'FEDERATED' is disabled.
    130518 18:22:32 InnoDB: Mutexes and rw_locks use GCC atomic builtins
    130518 18:22:32 InnoDB: Compressed tables use zlib 1.2.3
    130518 18:22:32 InnoDB: Using Linux native AIO
    130518 18:22:32 InnoDB: Initializing buffer pool, size = 210.0M
    130518 18:22:32 InnoDB: Completed initialization of buffer pool
    130518 18:22:32 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!
    130518 18:22:32  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...
    130518 18:22:32  InnoDB: Waiting for the background threads to start
    130518 18:22:33 InnoDB: 5.5.31 started; log sequence number 789470772
    130518 18:22:33 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
    130518 18:22:33 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
    [mysqld]
    130518 18:22:33 [Note] Server socket created on IP: '0.0.0.0'.
    130518 18:22:33 [ERROR] Missing system table mysql.proxies_priv; please run mysql_upgrade to create it
    130518 18:22:33 [ERROR] Native table 'performance_schema'.'events_waits_current' has the wrong structure
    130518 18:22:33 [ERROR] Native table 'performance_schema'.'events_waits_history' has the wrong structure
    130518 18:22:33 [ERROR] Native table 'performance_schema'.'events_waits_history_long' has the wrong structure
    130518 18:22:33 [ERROR] Native table 'performance_schema'.'setup_consumers' has the wrong structure
    130518 18:22:33 [ERROR] Native table 'performance_schema'.'setup_instruments' has the wrong structure
    130518 18:22:33 [ERROR] Native table 'performance_schema'.'setup_timers' has the wrong structure
    130518 18:22:33 [ERROR] Native table 'performance_schema'.'performance_timers' has the wrong structure
    130518 18:22:33 [ERROR] Native table 'performance_schema'.'threads' has the wrong structure
    130518 18:22:33 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_thread_by_event_name' has the wrong structure
    130518 18:22:33 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_instance' has the wrong structure
    130518 18:22:33 [ERROR] Native table 'performance_schema'.'events_waits_summary_global_by_event_name' has the wrong structure
    130518 18:22:33 [ERROR] Native table 'performance_schema'.'file_summary_by_event_name' has the wrong structure
    130518 18:22:33 [ERROR] Native table 'performance_schema'.'file_summary_by_instance' has the wrong structure
    130518 18:22:33 [ERROR] Native table 'performance_schema'.'mutex_instances' has the wrong structure
    130518 18:22:33 [ERROR] Native table 'performance_schema'.'rwlock_instances' has the wrong structure
    130518 18:22:33 [ERROR] Native table 'performance_schema'.'cond_instances' has the wrong structure
    130518 18:22:33 [ERROR] Native table 'performance_schema'.'file_instances' has the wrong structure
    130518 18:22:33 [Note] Event Scheduler: Loaded 0 events
    130518 18:22:33 [Note] /usr/libexec/mysqld: ready for connections.
    Version: '5.5.31'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server (GPL) by Remi

Aqui está meu my.cnf: pastebin.com/SSeU8gxK

    
por slyv 18.05.2013 / 20:34

1 resposta

1

Adicione os seguintes parâmetros e verifique se o problema foi resolvido:
innodb_buffer_pool_instances = 3
innodb_change_buffering = inserções
innodb_flush_method = O_DIRECT

    
por 20.05.2013 / 13:20