Comment limiter le nombre de threads dans mysql ?
Bonjour,
Lorsque j'utilise mysqltuner , j'ai un avertissement sur lequel j'aurais besoin de vos conseils/experiences
Code:
1 2
| *** MySQL's maximum memory usage is dangerously high ***
*** Add RAM before increasing MySQL buffer variables *** |
en effet au debut, il semble que j'ai un nb de threads à 214 !?
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Physical Memory : 57.4G
[--] Max MySQL memory : 56.7G
[--] Other process memory: 455.8M
[--] Total buffers: 16.4G global + 192.7M per thread (214 max threads)
[--] P_S Max memory usage: 0B
[--] Galera GCache Max memory usage: 0B
[OK] Maximum reached memory usage: 16.8G (29.24% of installed RAM)
[!!] Maximum possible memory usage: 56.7G (98.68% of installed RAM)
[OK] Overall possible memory usage with other process is compatible with memory available
[OK] Slow queries: 0% (0/2K)
[OK] Highest usage of available connections: 0% (2/214)
[!!] Aborted connections: 6.67% (1/15)
[!!] name resolution is active : a reverse name resolution is made for each new connection and can reduce performance
[OK] Query cache is disabled by default due to mutex contention on multiprocessor machines.
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 633 sorts)
[OK] No joins without indexes
[!!] Temporary tables created on disk: 83% (534 on disk / 637 total)
[OK] Thread cache hit rate: 86% (2 created / 15 connections)
[OK] Table cache hit rate: 122% (142 open / 116 opened)
[OK] Open file limit used: 24% (246/1K)
[OK] Table locks acquired immediately: 100% (11K immediate / 11K locks) |
Mais voila comment reduire ce nombre de threads ? après mon my.cnf pour infos
c'est un prestashop avec plus de 30K produits.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| [mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
[mysqld]
key-buffer-size = 32M
# CACHES #
tmp_table_size = 256M
max_heap_table_size = 256M
query_cache_type = 0
query_cache_size = 0
max-connections = 500
thread_cache_size =50
table-definition-cache = 4096
table-open-cache = 10240
join_buffer_size = 128M
sort_buffer_size = 64M
# INNODB #
innodb-buffer-pool-size = 16G
innodb-file-per-table = 1
innodb_buffer_pool_instances = 1 |