Les insertions dans le tableau suivant prennent jusqu'à 70 secondes pour terminer:
CREATE TABLE IF NOT EXISTS `productsCategories` (
`categoriesId` int(11) NOT NULL,
`productsId` int(11) NOT NULL,
PRIMARY KEY (`categoriesId`,`productsId`),
KEY `categoriesId` (`categoriesId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Il y a environ 100 000 lignes dans le tableau, et cela prend 7 Mo sur le disque.
Y a-t-il des paramètres dans MySQL qui peuvent améliorer les performances d'écriture?
Mon my.cnf
dossier est le suivant:
log-slow-queries="/var/log/mysql/slow-query.log"
long_query_time=1
log-queries-not-using-indexes
innodb_buffer_pool_size=4G
innodb_log_buffer_size=4M
innodb_flush_log_at_trx_commit=2
innodb_thread_concurrency=8
innodb_flush_method=O_DIRECT
query_cache_size = 6G
key_buffer_size = 284M
query_cache_limit = 1024M
thread_cache_size = 128
table_cache = 12800
sort_buffer_size=2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
read_buffer_size=128K
open_files_limit = 1000
table_definition_cache = 1024
table_open_cache = 6000
max_heap_table_size=512M
tmp_table_size=4096M
max_connections=1000
thread_concurrency = 24
Voici la configuration matérielle:
- Dell R710
- RAID10
- RAM 48G
Compte tenu de ce matériel, je ne m'attendrais pas à ce que le problème soit un goulot d'étranglement matériel.