Sur un serveur sous wheezy, j’ai régulièrement des plantages de mysql/percona
Percona 5.6.26 est installé et j’ai sur ce serveur 2 “gros” scripts :
- Prestashop pour la boutique
- Invision Board pour le forum
Les plantages disparaissent lorsque le forum est mis "hors d’état de nuire"
Par contre s’il est actif, le serveur plante tous les 2 jours.
Voici ce que donne le log mysql :
2016-04-20 18:11:03 3884 [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. Statement: UPDATE `ps_cart_product`
SET `quantity` = `quantity` + 1, `date_add` = NOW()
WHERE `id_product` = 141
AND `id_cart` = 31764
LIMIT 1
2016-04-20 18:11:04 3884 [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. Statement: UPDATE `ps_cart_product`
SET `quantity` = `quantity` + 1, `date_add` = NOW()
WHERE `id_product` = 141
AND `id_cart` = 31764
LIMIT 1
2016-04-20 18:11:05 3884 [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. Statement: UPDATE `ps_cart_product`
SET `quantity` = `quantity` + 1, `date_add` = NOW()
WHERE `id_product` = 141
AND `id_cart` = 31764
LIMIT 1
2016-04-20 18:11:07 3884 [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. Statement: UPDATE `ps_cart_product`
SET `quantity` = `quantity` + 1, `date_add` = NOW()
WHERE `id_product` = 141
AND `id_cart` = 31764
LIMIT 1
2016-04-20 18:11:10 3884 [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. Statement: UPDATE `ps_cart_product`
SET `quantity` = `quantity` - 1, `date_add` = NOW()
WHERE `id_product` = 141
AND `id_cart` = 31764
LIMIT 1
2016-04-20 18:11:10 3884 [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. Statement: UPDATE `ps_cart_product`
SET `quantity` = `quantity` - 1, `date_add` = NOW()
WHERE `id_product` = 141
AND `id_cart` = 31764
LIMIT 1
2016-04-20 18:11:11 3884 [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. Statement: UPDATE `ps_cart_product`
SET `quantity` = `quantity` - 1, `date_add` = NOW()
WHERE `id_product` = 141
AND `id_cart` = 31764
LIMIT 1
2016-04-20 18:11:11 3884 [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. Statement: UPDATE `ps_cart_product`
SET `quantity` = `quantity` - 1, `date_add` = NOW()
WHERE `id_product` = 141
AND `id_cart` = 31764
LIMIT 1
2016-04-20 18:35:30 3884 [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave. Statement: UPDATE `ps_order_invoice` SET number =(SELECT new_number FROM (SELECT (MAX(`number`) + 1) AS new_number
FROM `ps_order_invoice`) AS result) WHERE `id_order_invoice` = 11867
2016-04-20 18:44:58 3884 [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave. Statement: UPDATE `ps_order_invoice` SET number =(SELECT new_number FROM (SELECT (MAX(`number`) + 1) AS new_number
FROM `ps_order_invoice`) AS result) WHERE `id_order_invoice` = 11868
2016-04-20 19:01:18 3884 [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. Statement: UPDATE `ps_cart_product`
SET `quantity` = `quantity` + 2, `date_add` = NOW()
WHERE `id_product` = 182
AND `id_cart` = 30953
LIMIT 1
2016-04-20 19:02:54 3884 [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave. Statement: UPDATE `ps_order_invoice` SET number =(SELECT new_number FROM (SELECT (MAX(`number`) + 1) AS new_number
FROM `ps_order_invoice`) AS result) WHERE `id_order_invoice` = 11869
Killed
160420 19:23:26 mysqld_safe Number of processes running now: 0
160420 19:23:26 mysqld_safe mysqld restarted
2016-04-20 19:23:28 0 [Warning] options --log-slow-admin-statements, --log-queries-not-using-indexes and --log-slow-slave-statements have no effect if --slow-query-log is not set
2016-04-20 19:23:28 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-04-20 19:23:28 0 [Note] /usr/sbin/mysqld (mysqld 5.6.26-74.0-log) starting as process 23706 ...
2016-04-20 19:23:28 23706 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
2016-04-20 19:23:28 23706 [Note] Plugin 'FEDERATED' is disabled.
2016-04-20 19:23:28 23706 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-04-20 19:23:28 23706 [Note] InnoDB: The InnoDB memory heap is disabled
2016-04-20 19:23:28 23706 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-04-20 19:23:28 23706 [Note] InnoDB: Memory barrier is not used
2016-04-20 19:23:28 23706 [Note] InnoDB: Compressed tables use zlib 1.2.7
2016-04-20 19:23:28 23706 [Note] InnoDB: Using Linux native AIO
2016-04-20 19:23:28 23706 [Note] InnoDB: Using CPU crc32 instructions
2016-04-20 19:23:28 23706 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-04-20 19:23:28 23706 [Note] InnoDB: Completed initialization of buffer pool
2016-04-20 19:23:28 23706 [Note] InnoDB: Highest supported file format is Barracuda.
2016-04-20 19:23:28 23706 [Note] InnoDB: The log sequence numbers 17461728446 and 17461728446 in ibdata files do not match the log sequence number 17587562963 in the ib_logfiles!
2016-04-20 19:23:28 23706 [Note] InnoDB: Database was not shutdown normally!
2016-04-20 19:23:28 23706 [Note] InnoDB: Starting crash recovery.
2016-04-20 19:23:28 23706 [Note] InnoDB: Reading tablespace information from the .ibd files...
2016-04-20 19:23:28 23706 [Note] InnoDB: Restoring possible half-written data pages
2016-04-20 19:23:28 23706 [Note] InnoDB: from the doublewrite buffer...
InnoDB: Last MySQL binlog file position 0 9568488, file name mysql-bin.005084
2016-04-20 19:23:29 23706 [Note] InnoDB: 128 rollback segment(s) are active.
2016-04-20 19:23:29 23706 [Note] InnoDB: Waiting for purge to start
2016-04-20 19:23:29 23706 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.26-74.0 started; log sequence number 17587562963
2016-04-20 19:23:29 23706 [Note] Recovering after a crash using /var/lib/mysql/mysql-bin
2016-04-20 19:23:29 23706 [Note] Starting crash recovery...
2016-04-20 19:23:29 23706 [Note] Crash recovery finished.
2016-04-20 19:23:29 23706 [Note] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.
2016-04-20 19:23:29 23706 [Note] RSA public key file not found: /var/lib/mysql//public_key.pem. Some authentication plugins will not work.
2016-04-20 19:23:29 23706 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
2016-04-20 19:23:29 23706 [Note] - '127.0.0.1' resolves to '127.0.0.1';
2016-04-20 19:23:29 23706 [Note] Server socket created on IP: '127.0.0.1'.
2016-04-20 19:23:29 23706 [Note] Event Scheduler: Loaded 0 events
2016-04-20 19:23:29 23706 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.6.26-74.0-log' socket: '/var/run/mysqld/mysqld.sock' port: 3306 Percona Server (GPL), Release 74.0, Revision 32f8dfd
2016-04-20 19:23:29 23706 [ERROR] /usr/sbin/mysqld: Table './forum/ibf_core_sessions' is marked as crashed and should be repaired
2016-04-20 19:23:29 23706 [Warning] Checking table: './forum/ibf_core_sessions'
2016-04-20 19:23:30 23706 [ERROR] /usr/sbin/mysqld: Table './forum/ibf_forums_forums' is marked as crashed and should be repaired
2016-04-20 19:23:30 23706 [Warning] Checking table: './forum/ibf_forums_forums'
2016-04-20 19:23:30 23706 [ERROR] /usr/sbin/mysqld: Table './forum/ibf_core_members' is marked as crashed and should be repaired
2016-04-20 19:23:30 23706 [Warning] Checking table: './forum/ibf_core_members'
2016-04-20 19:23:34 23706 [ERROR] /usr/sbin/mysqld: Table './prestashop/ps_configuration' is marked as crashed and should be repaired
2016-04-20 19:23:34 23706 [Warning] Checking table: './prestashop/ps_configuration'
2016-04-20 19:23:35 23706 [ERROR] /usr/sbin/mysqld: Table './prestashop/ps_customer' is marked as crashed and should be repaired
2016-04-20 19:23:35 23706 [Warning] Checking table: './prestashop/ps_customer'
2016-04-20 19:23:36 23706 [ERROR] /usr/sbin/mysqld: Table './prestashop/ps_customer_group' is marked as crashed and should be repaired
2016-04-20 19:23:36 23706 [Warning] Checking table: './prestashop/ps_customer_group'
2016-04-20 19:23:37 23706 [ERROR] /usr/sbin/mysqld: Table './prestashop/ps_cart' is marked as crashed and should be repaired
2016-04-20 19:23:37 23706 [Warning] Checking table: './prestashop/ps_cart'
2016-04-20 19:23:39 23706 [ERROR] /usr/sbin/mysqld: Table './prestashop/ps_orders' is marked as crashed and should be repaired
2016-04-20 19:23:39 23706 [Warning] Checking table: './prestashop/ps_orders'
2016-04-20 19:23:40 23706 [ERROR] /usr/sbin/mysqld: Table './prestashop/ps_address' is marked as crashed and should be repaired
2016-04-20 19:23:40 23706 [Warning] Checking table: './prestashop/ps_address'
2016-04-20 19:23:40 23706 [ERROR] /usr/sbin/mysqld: Table './prestashop/ps_cart_product' is marked as crashed and should be repaired
2016-04-20 19:23:40 23706 [Warning] Checking table: './prestashop/ps_cart_product'
2016-04-20 19:23:41 23706 [ERROR] /usr/sbin/mysqld: Table './prestashop/ps_product' is marked as crashed and should be repaired
2016-04-20 19:23:41 23706 [Warning] Checking table: './prestashop/ps_product'
2016-04-20 19:23:41 23706 [ERROR] /usr/sbin/mysqld: Table './prestashop/ps_stock_available' is marked as crashed and should be repaired
2016-04-20 19:23:41 23706 [Warning] Checking table: './prestashop/ps_stock_available'
2016-04-20 19:23:41 23706 [ERROR] /usr/sbin/mysqld: Table './prestashop/ps_cart_cart_rule' is marked as crashed and should be repaired
2016-04-20 19:23:41 23706 [Warning] Checking table: './prestashop/ps_cart_cart_rule'
2016-04-20 19:23:58 23706 [ERROR] /usr/sbin/mysqld: Table './prestashop/ps_guest' is marked as crashed and should be repaired
2016-04-20 19:23:58 23706 [Warning] Checking table: './prestashop/ps_guest'
2016-04-20 19:24:12 23706 [ERROR] /usr/sbin/mysqld: Table './prestashop/ps_smarty_lazy_cache' is marked as crashed and should be repaired
2016-04-20 19:24:12 23706 [Warning] Checking table: './prestashop/ps_smarty_lazy_cache'
Killed
160420 19:24:20 mysqld_safe Number of processes running now: 0
160420 19:24:20 mysqld_safe mysqld restarted
2016-04-20 19:24:21 0 [Warning] options --log-slow-admin-statements, --log-queries-not-using-indexes and --log-slow-slave-statements have no effect if --slow-query-log is not set
2016-04-20 19:24:21 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-04-20 19:24:21 0 [Note] /usr/sbin/mysqld (mysqld 5.6.26-74.0-log) starting as process 23919 ...
2016-04-20 19:24:21 23919 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
2016-04-20 19:24:21 23919 [Note] Plugin 'FEDERATED' is disabled.
2016-04-20 19:24:21 23919 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-04-20 19:24:21 23919 [Note] InnoDB: The InnoDB memory heap is disabled
2016-04-20 19:24:21 23919 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-04-20 19:24:21 23919 [Note] InnoDB: Memory barrier is not used
2016-04-20 19:24:21 23919 [Note] InnoDB: Compressed tables use zlib 1.2.7
2016-04-20 19:24:21 23919 [Note] InnoDB: Using Linux native AIO
2016-04-20 19:24:21 23919 [Note] InnoDB: Using CPU crc32 instructions
2016-04-20 19:24:21 23919 [Note] InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
2016-04-20 19:24:21 23919 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2016-04-20 19:24:21 23919 [ERROR] Plugin 'InnoDB' init function returned error.
2016-04-20 19:24:21 23919 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2016-04-20 19:24:21 23919 [ERROR] Unknown/unsupported storage engine: InnoDB
2016-04-20 19:24:21 23919 [ERROR] Aborting
2016-04-20 19:24:21 23919 [Note] Binlog end
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'partition'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'BLACKHOLE'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'INNODB_CHANGED_PAGES'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'INNODB_METRICS'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'INNODB_CMPMEM'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'INNODB_CMP'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'INNODB_LOCKS'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'INNODB_TRX'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'XTRADB_RSEG'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'XTRADB_INTERNAL_HASH_TABLES'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'XTRADB_READ_VIEW'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'ARCHIVE'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'MEMORY'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'MyISAM'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'CSV'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'MRG_MYISAM'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'sha256_password'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'mysql_old_password'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'mysql_native_password'
2016-04-20 19:24:21 23919 [Note] Shutting down plugin 'binlog'
2016-04-20 19:24:21 23919 [Note] /usr/sbin/mysqld: Shutdown complete
160420 19:24:21 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
Voici mon fichier /etc/mysql/my.cnf :
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
# GENERAL #
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
innodb_force_recovery = 0
# BINARY LOGGING #
log-bin = /var/lib/mysql/mysql-bin
expire-logs-days = 1
sync-binlog = 1
max-allowed-packet = 16M
max-connect-errors = 1000000
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
#
# * Fine Tuning
#
#key_buffer = 16M
#thread_stack = 192K
#thread_cache_size = 8
#innodb_buffer_pool_size = 64M
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover = BACKUP
# CACHES AND LIMITS #
tmp-table-size = 32M
max-heap-table-size = 32M
query-cache-type = 0
query-cache-size = 16M
query-cache-limit = 16M
max-connections = 30
thread-cache-size = 50
open-files-limit = 65535
table-definition-cache = 2048
table-open-cache = 2048
#table_cache = 4096
key_buffer_size = 16M
# BINARY LOGGING #
log-bin = /var/lib/mysql/mysql-bin
expire-logs-days = 10
sync-binlog = 0
max_binlog_size = 10M
# LOGGING #
log-error = /var/log/mysql-error.log
log-queries-not-using-indexes = 1
slow-query-log = 0
slow-query-log-file = /var/log/mysql-slow.log
# INNODB #
innodb-flush-method = O_DIRECT
innodb-log-files-in-group = 2
innodb-log-file-size = 64M
innodb-flush-log-at-trx-commit = 2
innodb-file-per-table = 1
innodb-buffer-pool-size = 128M
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
[mysql]
#no-auto-rehash # faster start of mysql but no tab completition
[isamchk]
key_buffer = 16M
#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/
Je pense qu’il y a un paramètre mysql qui m’échappe, mais je cale un peu là…

