博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
InnoDB Status Output – Buffer Pool and Spin Rounds
阅读量:7051 次
发布时间:2019-06-28

本文共 4501 字,大约阅读时间需要 15 分钟。

InnoDB has a good source of information about its status which can be requested every time you need to know “what’s up” with that in your environment. The SHOW ENGINE INNODB STATUS will inform you the last x seconds of its operation, leveraging system or database administrator with the best – as possible – position about what is happening with data pages which are being manipulated in a sense of maintain those in the Buffer Pool as more as possible.

$ mysql -u  -p -e 'SHOW ENGINE INNODB STATUS\G' > file

Buffer Pool is the privileged main memory area where InnoDB will maintain all the last recently used data pages, regardless of the page’s size, in rotation, based on LRU algorithm. This area will serve well for SELECT, UPDATE and DELETE, SQL commands which will use more data from memory than that on disk. Pages will be cycling between young and old status, more used and less used, respectively…

----------------------BUFFER POOL AND MEMORY----------------------Total memory allocated 79121448960; in additional pool allocated 0Dictionary memory allocated 776119Buffer pool size   4718590Free buffers       4682063Database pages     36395Old database pages 13627Modified db pages  23223Pending reads 0Pending writes: LRU 0, flush list 0, single page 0Pages made young 672, not young 02.90 youngs/s, 0.00 non-youngs/sPages read 36066, created 329, written 32375.09 reads/s, 1.50 creates/s, 0.00 writes/sBuffer pool hit rate 985 / 1000, young-making rate 0 / 1000 not 0 / 1000Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 5.00/sLRU len: 36395, unzip_LRU len: 0I/O sum[0]:cur[80], unzip sum[0]:cur[0]

As you can see above, the total allocated main memory for Buffer Pool is 79121448960, with some space for the InnoDB’s dictionary, the actual size of the buffer pool, the amount of space, that is, 4682063, what is 292629 in terms of data pages, considering 16kb pages, the amount of old pages the remains in the buffer pool and all the modified or dirty pages – those that were modified by an UPDATE, for example, and haven’t flushed to disk yet. Pending reads and writes indicates the amount of pages which were written to the buffer pool and haven’t flushed yet as the flush list and the amount in terms of pages.

A good point that called my attention was the read ahead and evictions noticed by the output above. “The read ahead request is an I/O request to prefetch multiple pages in the buffer pool asynchronously, in anticipation that these pages will be needed soon”. This will tell us how many pages were copied into the buffer pool and were evicted without being accessed anytime. I think it costs a little bit to get more pages than necessary into the buffer pool as the mechanism must discard pages which are not being accessed, even being this process asynchronous.

Recently, I’ve got very curious about the spin rounds behavior and I realized that if you have many transactions in sleep state inside InnoDB, waiting to be executed, perhaps it may be a spin round problem. The output of SHOW ENGINE INNODB STATUS will show you that…

----------SEMAPHORES----------OS WAIT ARRAY INFO: reservation count 13701--Thread 140549419812608 has waited at log0log.ic line 321 for 0.00 seconds the semaphore:Mutex at 0x7c10f4b8 created file log0log.cc line 737, lock var 1waiters flag 1OS WAIT ARRAY INFO: signal count 15206Mutex spin waits 607605, rounds 3114855, OS waits 8383RW-shared spins 9396, rounds 101453, OS waits 1626RW-excl spins 6569, rounds 137971, OS waits 3191Spin rounds per wait: 5.13 mutex, 10.80 RW-shared, 21.00 RW-excl

What does it mean, so?

• Mutex spin waits 607605 is the number of times a thread tried to get a mutex and it wasn’t available, so it waited in a spin-wait;

• rounds 3114855 is the number of times threads looped in the spin-wait cycle, checking the mutex.
• OS waits 8383 is the number of times the thread gave up spin-waiting and went to sleep state instead.

In the SEMAPHORES output above we can observe a case of a fine tuning is needed to avoid context switches. It costs lots of computational resources to maintain information about the actual executing status to restore it as soon as possible. The RW-shared is high, but this is not the real problem. The real problem is happening around RW-excl which acquires locks and make the amount of rounds higher even on the OS level. The final result, 21 waits in the last five seconds.

转自:http://wagnerbianchi.com/blog/?p=376 

转载于:https://www.cnblogs.com/sunss/p/5189228.html

你可能感兴趣的文章
zabbix监控网络的出入口流量
查看>>
webstorm 破解方式
查看>>
动画综合练习(延迟进入+页面向导+文本框抖动)
查看>>
Notepad++ JSON关键字自动提示
查看>>
全息科普1 【转】
查看>>
Git 撤消操作(分布式版本控制系统)
查看>>
WPF 海康威视网络摄像头回调方式实现断连提示,降低时延
查看>>
深入理解JavaScript系列(30):设计模式之外观模式
查看>>
女子黃带案
查看>>
Android实现推送方式解决方案
查看>>
第十节 1ASP.Net简介及学习方法
查看>>
导出表中数据为insert语句
查看>>
mysql中如何更新一个字段的值为它本身的值连接上一个字符串
查看>>
在Telerik for silverlight控件radtreeview中如何通过路径得到节点(转载)
查看>>
图像处理之拼接---图像拼接opencv
查看>>
【分享】博客美化(2)自定义博客样式细节
查看>>
字节对齐导致的iOS EXC_ARM_DA_ALIGN崩溃
查看>>
TCHAR和CHAR类型的互转
查看>>
HtmlAgilityPack 处理通配的contains
查看>>
hadoop和spark搭建记录
查看>>