aelius Posted February 24, 2014 Report Posted February 24, 2014 (edited) Daca utilizati SSD-uri, este o idee buna sa inlocuiti MySQL cu Percona. Veti fi uimit de castigul de performanta. Chiar si cu HDD-uri obisnuite, o sa aveti un castig de 10-30 % in performanta.Adaugam repo-urile in '/etc/apt/sources.list'echo "deb http://repo.percona.com/apt wheezy main" >> /etc/apt/sources.listecho "deb-src http://repo.percona.com/apt wheezy main" >> /etc/apt/sources.listAdaugam key-ul pentru aptapt-key adv --keyserver keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2AFacem un apt-get update pentru o lista cu pachetele actualizateapt-get updateInstalam percona server, percona client si common files (fisiere de configuratie, etc)apt-get install percona-server-common-5.5 percona-server-client-5.5 percona-server-server-5.5Un config se poate vedea aici# File '/etc/mysql/my.cnf'[client]port = 3306socket = /var/run/mysqld/mysqld.sock[mysqld_safe]socket = /var/run/mysqld/mysqld.socknice = 0[mysqld]user = mysqlpid-file = /var/run/mysqld/mysqld.pidsocket = /var/run/mysqld/mysqld.sockport = 3306basedir = /usrdatadir = /var/lib/mysqltmpdir = /run/shmlc-messages-dir = /usr/share/mysqlskip-external-lockingbind-address = 127.0.0.1key_buffer = 600Mmax_allowed_packet = 1200Mopen_files_limit = 4096thread_stack = 192Kthread_cache_size = 8myisam-recover = BACKUPmax_connections = 1000max_user_connections = 100table_cache = 512thread_concurrency = 2query_cache_limit = 128Mquery_cache_size = 16Mlog_slow_queries = /var/log/mysql/mysql-slow.loglong_query_time = 2expire_logs_days = 10max_binlog_size = 100M[mysqldump]quickquote-namesmax_allowed_packet = 1200M[mysql][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/Nota: configul este doar ca exemplu, nu-i dati copy/paste in sistemele voastre fara sa stiti cu exactitate ce fac acele variabile. Ele sunt calculate in in functie de resurse si aplicatii.Pagina oficiala percona: http://www.percona.com/Documentatie: http://www.percona.com/docs/wiki/ Edited February 24, 2014 by aelius Quote
aelius Posted February 24, 2014 Author Report Posted February 24, 2014 Nu am asa incredere in benchmark-uri. Am incercat direct pe servere aflate in productie cu aplicatii web intensive. Se vedea clar la diferenta de incarcare cat si la numarul de procese aflate in waiting pe mysql (inainte si dupa)Sunt curios pe MyISAM cum se comporta, cam pe toate serverele testate se folosea InnoDB. Quote
gogusan Posted February 25, 2014 Report Posted February 25, 2014 Nu am asa incredere in benchmark-uri. Am incercat direct pe servere aflate in productie cu aplicatii web intensive. Se vedea clar la diferenta de incarcare cat si la numarul de procese aflate in waiting pe mysql (inainte si dupa)Sunt curios pe MyISAM cum se comporta, cam pe toate serverele testate se folosea InnoDB.Percona nu pune mare accent pe MyISAM, mai degraba folositi mariaDB care e InnoDB-MyISAM must have la ora actuala (arunca un ochi si pe versiunea 10 > mariaDB 10.)uite aici un benchmark frumos: MySQL Benchmarks: MySQL 5.5.11 vs Percona 5.5.10-20.1 vs MariaDB 5.2.5 - InnoDB and MyISAM | vbtechsupport.com Quote
aelius Posted February 25, 2014 Author Report Posted February 25, 2014 InnoDB este row-level locking. La aplicatiile intensive, MyISAM produce incarcarea serverelor. Quote