This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| global | |
| log 127.0.0.1 local2 | |
| chroot /var/lib/haproxy | |
| pidfile /var/run/haproxy.pid | |
| maxconn 20000 | |
| user haproxy | |
| group haproxy | |
| daemon | |
| #nbproc 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| net.core.somaxconn = 32768 | |
| net.ipv4.conf.all.send_redirects = 1 | |
| net.ipv4.ip_nonlocal_bind = 1 | |
| net.ipv4.tcp_abort_on_overflow = 0 | |
| net.ipv4.tcp_fin_timeout = 10 | |
| net.ipv4.tcp_keepalive_time = 300 | |
| net.ipv4.tcp_max_orphans = 262144 | |
| net.ipv4.tcp_max_syn_backlog = 16384 | |
| net.ipv4.tcp_max_tw_buckets = 262144 | |
| net.ipv4.tcp_mem = 200000 280000 300000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| awk -v lines=1000000 -v fmt="database.table.%06d.sql" '{print>sprintf(fmt,1+int((NR-1)/lines))}' ../export-20121119-062335/database.table.sql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| select all_tables.* | |
| FROM | |
| (select table_schema, table_name from information_schema.statistics group by table_schema, table_name ) all_tables | |
| LEFT JOIN | |
| (select table_schema, table_name from information_schema.statistics where index_name='PRIMARY' group by table_schema, table_name ) primary_tables | |
| USING ( table_schema, table_name) | |
| WHERE primary_tables.table_name is null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT table_schema, | |
| CONCAT(ROUND(sum(table_rows) / 1000000, 2), 'M') rows, | |
| CONCAT(ROUND(sum(data_length) / ( 1024 * 1024 * 1024 ), 2), 'G') DATA, | |
| CONCAT(ROUND(sum(index_length) / ( 1024 * 1024 * 1024 ), 2), 'G') idx, | |
| CONCAT(ROUND(( sum(data_length) + sum(index_length) ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size, | |
| ROUND(sum(index_length) / sum(data_length), 2) idxfrac | |
| FROM information_schema.TABLES | |
| group by table_schema | |
| ORDER BY data_length + index_length DESC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE `ids` ( | |
| `id` BIGINT(21) UNSIGNED NOT NULL AUTO_INCREMENT, | |
| `stub` CHAR(1) NOT NULL, | |
| PRIMARY KEY (`id`), | |
| UNIQUE KEY (`stub`) | |
| ) | |
| CREATE TABLE `ids` ( | |
| `id` BIGINT(21) UNSIGNED NOT NULL AUTO_INCREMENT, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| echo -n "Max processes=X:Y" > /proc/`pidof mysqld`/limits | |
| X = soft limit | |
| Y = hard limit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| install perf | |
| install galera-debuginfo (if PXC) | |
| install PS/PXC debuginfo | |
| # collect 1 pid | |
| perf record -g -p 16004 | |
| # collect all procs | |
| perf record -a -g |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| global | |
| log 127.0.0.1 local0 | |
| log 127.0.0.1 local1 notice | |
| maxconn 4096 | |
| uid 99 | |
| gid 99 | |
| daemon | |
| defaults | |
| log global |