tsung 正在
10 years ago
Make MySQL a Better MySQL - the tips of optimize the database performance - Ryusuke Kajiyama (Kaji)
latest #89
elleryq
10 years ago
有連結嗎?
tsung
10 years ago
還沒開場耶. XD
elleryq
10 years ago
ok :-)
立即下載
Tombear
10 years ago
我睡過頭了 交給你啦
tsung
10 years ago
Tombear 現在來還來得及
tsung
10 years ago
7/22 18:00~20:00 oracle meeting room, Taiwan MySQL Group
tsung
10 years ago
Oracle
tsung
10 years ago
MySQL Performance Tuning
tsung
10 years ago
MySQL Global Business Unit Sales Consulting Senior Manager, JAPAC
tsung
10 years ago
MySQL 5.5, 5.6, MySQL Cluster 7.3, MySQL Utilities, MySQL Enterprise, MySQL Applier for Hadoop
tsung
10 years ago
Oracle 定位: Database Platform for Next Gen Web Apps
tsung
10 years ago
MySQL 5.5 -> 5.6: 234% Performance Gain
tsung
10 years ago
SysBench (Read Write)
tsung
10 years ago
Replication: Binary Log Group Commit
tsung
10 years ago
10% overhead when configuring: sync_binlog=0
tsung
10 years ago
Additional 5% when configuring: sync_binlog=1
tsung
10 years ago
Save option: sync=1, 危險方案 Sync=0
tsung
10 years ago
Master perforamance
tsung
10 years ago
MySQL5.6: InnoDB - NoSQL Key Value Access to InnoDB
tsung
10 years ago
實作 Memcached Protocol
tsung
10 years ago
Key-value access to InnoDB via familiar Memcached API
tsung
10 years ago
Performance Tuning
tsung
10 years ago
Defining Performance
tsung
10 years ago
Main objective: Users should be satisfied
tsung
10 years ago
定義 Performance
tsung
10 years ago
performnce metrics
tsung
10 years ago
Throughput、Latency / Response time、Scalability、Combined metrics
tsung
10 years ago
Main objective: Users (direct or indirect) should be satisfied
tsung
10 years ago
User response time = queueing delay + service time
tsung
10 years ago
Service Time: Key to the hotspot
tsung
10 years ago
Indirect measurements: CPU、Disk IO、Network traffic、Load Average
tsung
10 years ago
Benchmark Tests
tsung
10 years ago
tsung
10 years ago
SysBench: sysbench sourceforge
tsung
10 years ago
SQL 慢的問題: Is this the largest risk/bottleneck?
tsung
10 years ago
Check configuration:
tsung
10 years ago
system variables: show variables like 'auto%';
tsung
10 years ago
Check Status of Server
tsung
10 years ago
status variables: show status like 'innodb_buf%';
tsung
10 years ago
Flush status; <run query>; show status;
tsung
10 years ago
mysqladmin -u -p ... ex -i 15 -r | grep -v 0
tsung
10 years ago
MySQL Server Architecture 圖
tsung
10 years ago
Connection Thread Pool: Single process, multi thread
tsung
10 years ago
Storage Engines:InnoDB Thread engine 直接寫入 DB
tsung
10 years ago
Server connections & threads
tsung
10 years ago
max_connections (151): per connections memory usage, thread_cache_size(8): max_connections / 3
tsung
10 years ago
thread_cache_size(8): Keep up to this amount of thread "cached" after discounnect
tsung
10 years ago
mysql> show status;
tsung
10 years ago
Max_used_connections
tsung
10 years ago
Threads_created: thread_cache misses should be low.
tsung
10 years ago
Connection Thread work buffers
tsung
10 years ago
soft_buffer_size(2M): often fine at 512K or 1M
tsung
10 years ago
other buffers, read, read_rnd, etc...: smaller defaults often OK
tsung
10 years ago
mysql> show status; Sort_merge_passes - number of passes made during file merge sort.
tsung
10 years ago
check if file sort needs to the done at all
tsung
10 years ago
use index if possible
tsung
10 years ago
"Server Query Cache"
tsung
10 years ago
query_cache_size(0): Amount of memory to use for query cache
tsung
10 years ago
Typically 32M is fine, some database need 128M
tsung
10 years ago
query_cache_type (ON): Worst case performance overhead is aboue 15%-20%
tsung
10 years ago
Favor servers with higher SELECT/WRITE ratios
tsung
10 years ago
"Storage Engines": InnoDB Performace Tips
tsung
10 years ago
innodb_buffer_pool_size: 80% of memory on Innodb only system, caches data & indexes unlike MyISAM
tsung
10 years ago
innodb_log_file_size: A key parameter for wrtie performance
tsung
10 years ago
innodb_flush_log_at_trx_commit: 1 (slow) Truly ACID, 2(fase) OS cache on commit, sync to disk once/sec. 0 (fastest) will flush (fsync) log every second or so
tsung
10 years ago
innodb_file_per_table: always good choice to distribute i/o, Default ON from 5.6
tsung
10 years ago
show engine Innodb status;
tsung
10 years ago
Geat Way to see what is going on inside InnoDB, hard to parse: FILE IO / Buffer Pool / Log activity / Row activity
tsung
10 years ago
innodb_flush_method = O_DIRECT
tsung
10 years ago
innodb_buffer_pool_instances (5.5+)
tsung
10 years ago
innodb_io_capactity(5.5+)
tsung
10 years ago
innodb_read_io_threads / innodb_write_io_thrads(5.5+)
tsung
10 years ago
innodb_io_capactity: default 200 is good for 2 disks striped
tsung
10 years ago
innodb_read_io_threads / innodb_write_io_thrads: default 4 is usually good enough
tsung
10 years ago
Monitoring Queries: Slow Query Log
tsung
10 years ago
Query_time, 重點看 Lock_time.
tsung
10 years ago
"mysqldumpslow" helps
tsung
10 years ago
show full processlist
tsung
10 years ago
Fixing Problem Queries - EXPLAIN
tsung
10 years ago
Analyize: How indes are being used, required file sorts, what tables, columns are being queried
tsung
10 years ago
MySQL Workbench
tsung
10 years ago
MySQL Query Analyzer
tsung
10 years ago
MySQL Thread Pool
tsung
10 years ago
1024 之後就會往下調.
tsung
10 years ago
MySQL Enterprise Edition Whth Thread Pool 1024 以上可以正常運作, MySQL Community Server Without Thread Pool 就會往下調
tsung
10 years ago
MySQL 5.7 95% Faster than MySQL 5.6/
tsung
10 years ago
MySQL 5.6, 57 速度 > Percona 5.6 > Maria DB 5.6
back to top