Skip to content

Instantly share code, notes, and snippets.

@andresaquino
Forked from NerOcrO/mysql.md
Created December 20, 2018 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andresaquino/f231c052bdb91fef9bf96bfd22cf332b to your computer and use it in GitHub Desktop.
Save andresaquino/f231c052bdb91fef9bf96bfd22cf332b to your computer and use it in GitHub Desktop.
mysql
  • Finalement, je me rends compte qu'il n'y a pas grand chose à faire pour un poste de dev à partir du moment où je ne laisse pas mon poste allumé tout le temps.
  • A savoir que la plupart des variables sont à mettre dans [mysqld] pour qu'elles soient prises en compte.
  • https://www.askapache.com/mysql/mysql-performance-tuning/
  • Il faut un MySQL allumé et utilisé depuis longtemps pour avoir des recommandations pertinentes
  • Ceci dit, quelques améliorations demandé par mysqltuner :
# sudo vim /etc/mysql/conf.d/perso.cnf
[mysqld]
key_buffer_size = 128M
query_cache_limit = 2048M
table_open_cache = 10000 # anciennement table_cache
tmp_table_size = 1024M
max_heap_table_size = 1024M
innodb_buffer_pool_size = 2048M
innodb_flush_log_at_trx_commit = 2 # permet d'écrire plus vite (dev)!
innodb_file_per_table = 1
# Mettre en commentaire log_error : sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf.

Problèmes

  • Drush command terminated abnormally due to an unrecoverable error.

sudo vim /etc/security/limits.conf

  •       soft    nofile          10240
    
  •       hard    nofile          10240
    

sudo vim /lib/systemd/system/mysql.service
LimitNOFILE=infinity

reboot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment