InnoDB存储引擎性能优化指南

需积分: 9 0 下载量 18 浏览量 更新于2024-07-20 收藏 817KB PDF 举报
"MySQL InnoDB存储引擎的性能优化指南,主要针对MySQL 5.6版本" 在MySQL数据库系统中,InnoDB存储引擎是最常用的引擎之一,以其事务处理能力、行级锁定以及对ACID(原子性、一致性、隔离性和持久性)的严格遵循而著名。本资源着重探讨了InnoDB性能优化的基础知识,包括文件格式、日志序列号(LSN)管理、以及MySQL 5.6中引入的InnoDB Memcached插件作为缓存层的使用。 第一章:InnoDB性能优化基础 这部分内容可能涵盖了如何调整InnoDB的配置参数,如缓冲池大小、事务日志文件大小、索引组织等,以提升查询速度和降低磁盘I/O。此外,可能会讲解如何合理设置锁粒度以减少并发冲突,以及如何通过优化查询语句来减少数据库负载。 第二章:InnoDB文件格式:避免的陷阱 本章可能深入解析InnoDB的不同文件格式(如Antelope和Barracuda),讨论它们的优缺点,并指导如何选择合适的文件格式以提高存储效率和性能。可能还会涉及压缩、页大小调整和空间利用率等方面的问题。 第三章:如何向前移动InnoDB的日志序列号(LSN) LSN是InnoDB事务日志的重要组成部分,用于追踪数据变化。本章可能解释了LSN的概念,以及如何在不丢失数据的情况下安全地跳过无效或重复的LSN,从而优化日志管理并提升系统性能。 第四章:MySQL 5.6 - InnoDB Memcached插件作为缓存层 MySQL 5.6引入了InnoDB Memcached插件,允许直接通过Memcached接口与InnoDB交互,提供了一种高效的数据缓存机制。这一章可能会详细介绍如何配置和使用这个插件,以及它如何帮助减少数据库访问压力,提高整体系统响应速度。 关于Percona: Percona是一家成立于2006年的专业MySQL服务公司,由Peter Zaitsev和Vadim Tkachenko共同创立,拥有超过100名全球专家团队。他们服务于各种规模的客户,包括财富500强企业、知名网站和初创公司。Percona提供了包括技术支持、咨询服务和培训在内的多种MySQL相关服务,如果你需要他们的专业知识,可以通过提供的联系方式进行咨询。
2016-03-14 上传
You don't have to accept slow Ruby or Rails performance. In this comprehensive guide to Ruby optimization, you'll learn how to write faster Ruby code--but that's just the beginning. See exactly what makes Ruby and Rails code slow, and how to fix it. Alex Dymo will guide you through perils of memory and CPU optimization, profiling, measuring, performance testing, garbage collection, and tuning. You'll find that all those "hard" things aren't so difficult after all, and your code will run orders of magnitude faster. This is the first book ever that consolidates all the Ruby performance optimization advice in one place. It's your comprehensive guide to memory optimization, CPU optimization, garbage collector tuning, profiling, measurements, performance testing, and more. You'll go from performance rookie to expert. First, you'll learn the best practices for writing Ruby code that's easy not only on the CPU, but also on memory, and that doesn't trigger the dreaded garbage collector. You'll find out that garbage collection accounts for 80% of slowdowns, and often takes more than 50% of your program's execution time. And you'll discover the bottlenecks in Rails code and learn how selective attribute loading and preloading can mitigate the performance costs of ActiveRecord. As you advance to Ruby performance expert, you'll learn how profile your code, how to make sense out of profiler reports, and how to make optimization decisions based on them. You'll make sure slow code doesn't creep back into your Ruby application by writing performance tests, and you'll learn the right way to benchmark Ruby. And finally, you'll dive into the Ruby interpreter internals to really understand why garbage collection makes Ruby so slow, and how you can tune it up. What You Need: Some version of Ruby. The advice from this book applies to all modern Ruby versions from 1.9 to 2.2. 80% of the material will also be useful for legacy Ruby 1.8 users, and there is 1.8-specific advice as well. Table of Contents Chapter 1. What Makes Ruby Code Fast Chapter 2. Fix Common Performance Problems Chapter 3. Make Rails Faster Chapter 4. Profile Chapter 5. Learn to Optimize with the Profiler Chapter 6. Profile Memory Chapter 7. Measure Chapter 8. Test Performance Chapter 9. Think Outside the Box Chapter 10. Tune Up the Garbage Collector
2023-07-15 上传
2023-07-15 上传

[root@QAQ ~]# sudo tail -n 50 /var/log/mysql/error.log 2023-07-14T02:45:21.370949Z 0 [Note] Shutting down plugin 'partition' 2023-07-14T02:45:21.370952Z 0 [Note] Shutting down plugin 'BLACKHOLE' 2023-07-14T02:45:21.370954Z 0 [Note] Shutting down plugin 'ARCHIVE' 2023-07-14T02:45:21.370956Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA' 2023-07-14T02:45:21.370993Z 0 [Note] Shutting down plugin 'MRG_MYISAM' 2023-07-14T02:45:21.370995Z 0 [Note] Shutting down plugin 'MyISAM' 2023-07-14T02:45:21.371003Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL' 2023-07-14T02:45:21.371011Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES' 2023-07-14T02:45:21.371013Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES' 2023-07-14T02:45:21.371015Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS' 2023-07-14T02:45:21.371017Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN' 2023-07-14T02:45:21.371018Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS' 2023-07-14T02:45:21.371020Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS' 2023-07-14T02:45:21.371022Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES' 2023-07-14T02:45:21.371024Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS' 2023-07-14T02:45:21.371026Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES' 2023-07-14T02:45:21.371028Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE' 2023-07-14T02:45:21.371030Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE' 2023-07-14T02:45:21.371032Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG' 2023-07-14T02:45:21.371033Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED' 2023-07-14T02:45:21.371035Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED' 2023-07-14T02:45:21.371037Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD' 2023-07-14T02:45:21.371039Z 0 [Note] Shutting down plugin 'INNODB_METRICS' 2023-07-14T02:45:21.371041Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO' 2023-07-14T02:45:21.371043Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS' 2023-07-14T02:45:21.371045Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU' 2023-07-14T02:45:21.371047Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE' 2023-07-14T02:45:21.371049Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET' 2023-07-14T02:45:21.371050Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX' 2023-07-14T02:45:21.371052Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET' 2023-07-14T02:45:21.371054Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM' 2023-07-14T02:45:21.371056Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET' 2023-07-14T02:45:21.371058Z 0 [Note] Shutting down plugin 'INNODB_CMP' 2023-07-14T02:45:21.371060Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS' 2023-07-14T02:45:21.371062Z 0 [Note] Shutting down plugin 'INNODB_LOCKS' 2023-07-14T02:45:21.371064Z 0 [Note] Shutting down plugin 'INNODB_TRX' 2023-07-14T02:45:21.371066Z 0 [Note] Shutting down plugin 'InnoDB' 2023-07-14T02:45:21.371100Z 0 [Note] InnoDB: FTS optimize thread exiting. 2023-07-14T02:45:21.371135Z 0 [Note] InnoDB: Starting shutdown... 2023-07-14T02:45:21.471280Z 0 [Note] InnoDB: Dumping buffer pool(s) to /www/server/data/ib_buffer_pool 2023-07-14T02:45:21.471421Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 230714 10:45:21 2023-07-14T02:45:22.992635Z 0 [Note] InnoDB: Shutdown completed; log sequence number 2767468 2023-07-14T02:45:22.993964Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1" 2023-07-14T02:45:22.993980Z 0 [Note] Shutting down plugin 'MEMORY' 2023-07-14T02:45:22.993985Z 0 [Note] Shutting down plugin 'CSV' 2023-07-14T02:45:22.993989Z 0 [Note] Shutting down plugin 'sha256_password' 2023-07-14T02:45:22.993991Z 0 [Note] Shutting down plugin 'mysql_native_password' 2023-07-14T02:45:22.994103Z 0 [Note] Shutting down plugin 'binlog' 2023-07-14T02:45:22.994915Z 0 [Note] /www/server/mysql/bin/mysqld: Shutdown complete

2023-07-20 上传

[root@QAQ ~]# sudo tail -n 50 /var/log/mysql/error.log 2023-07-14T02:43:01.816556Z 0 [Note] Shutting down plugin 'partition' 2023-07-14T02:43:01.816558Z 0 [Note] Shutting down plugin 'BLACKHOLE' 2023-07-14T02:43:01.816566Z 0 [Note] Shutting down plugin 'ARCHIVE' 2023-07-14T02:43:01.816568Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA' 2023-07-14T02:43:01.816594Z 0 [Note] Shutting down plugin 'MRG_MYISAM' 2023-07-14T02:43:01.816597Z 0 [Note] Shutting down plugin 'MyISAM' 2023-07-14T02:43:01.816605Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL' 2023-07-14T02:43:01.816608Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES' 2023-07-14T02:43:01.816610Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES' 2023-07-14T02:43:01.816612Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS' 2023-07-14T02:43:01.816614Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN' 2023-07-14T02:43:01.816616Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS' 2023-07-14T02:43:01.816618Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS' 2023-07-14T02:43:01.816620Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES' 2023-07-14T02:43:01.816622Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS' 2023-07-14T02:43:01.816624Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES' 2023-07-14T02:43:01.816626Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE' 2023-07-14T02:43:01.816628Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE' 2023-07-14T02:43:01.816630Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG' 2023-07-14T02:43:01.816632Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED' 2023-07-14T02:43:01.816634Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED' 2023-07-14T02:43:01.816636Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD' 2023-07-14T02:43:01.816638Z 0 [Note] Shutting down plugin 'INNODB_METRICS' 2023-07-14T02:43:01.816640Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO' 2023-07-14T02:43:01.816642Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS' 2023-07-14T02:43:01.816644Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU' 2023-07-14T02:43:01.816645Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE' 2023-07-14T02:43:01.816647Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET' 2023-07-14T02:43:01.816649Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX' 2023-07-14T02:43:01.816651Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET' 2023-07-14T02:43:01.816653Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM' 2023-07-14T02:43:01.816655Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET' 2023-07-14T02:43:01.816657Z 0 [Note] Shutting down plugin 'INNODB_CMP' 2023-07-14T02:43:01.816659Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS' 2023-07-14T02:43:01.816661Z 0 [Note] Shutting down plugin 'INNODB_LOCKS' 2023-07-14T02:43:01.816664Z 0 [Note] Shutting down plugin 'INNODB_TRX' 2023-07-14T02:43:01.816666Z 0 [Note] Shutting down plugin 'InnoDB' 2023-07-14T02:43:01.816703Z 0 [Note] InnoDB: FTS optimize thread exiting. 2023-07-14T02:43:01.816748Z 0 [Note] InnoDB: Starting shutdown... 2023-07-14T02:43:01.916861Z 0 [Note] InnoDB: Dumping buffer pool(s) to /www/server/data/ib_buffer_pool 2023-07-14T02:43:01.917024Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 230714 10:43:01 2023-07-14T02:43:03.438469Z 0 [Note] InnoDB: Shutdown completed; log sequence number 2767449 2023-07-14T02:43:03.439797Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1" 2023-07-14T02:43:03.439814Z 0 [Note] Shutting down plugin 'MEMORY' 2023-07-14T02:43:03.439819Z 0 [Note] Shutting down plugin 'CSV' 2023-07-14T02:43:03.439823Z 0 [Note] Shutting down plugin 'sha256_password' 2023-07-14T02:43:03.439825Z 0 [Note] Shutting down plugin 'mysql_native_password' 2023-07-14T02:43:03.439939Z 0 [Note] Shutting down plugin 'binlog' 2023-07-14T02:43:03.440752Z 0 [Note] /www/server/mysql/bin/mysqld: Shutdown complete

2023-07-15 上传