- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 Ubuntu 16.04.1 LTS 上使用 5.7.16-10-log Percona Server。
我最近将我的 AWS ec2 实例从 m4.2xlarge 实例类型升级到 m4.4xlarge。升级后我的 mysql 错误日志定期填充以下行:
2017-09-15T17:10:30.678258+05:30 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 4460ms. The settings might not be optimal. (flushed=140, during the time.)
2017-09-15T17:14:31.048443+05:30 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 6047ms. The settings might not be optimal. (flushed=107, during the time.)
2017-09-15T17:15:06.312119+05:30 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 8262ms. The settings might not be optimal. (flushed=64, during the time.)
当 Percona Innobackupex 按照完全备份和增量备份的计划运行时,这些情况很常见。在这种时候,这里是根据 iostat 的磁盘使用情况:
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
xvda 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
xvdf 0.00 10.00 0.00 2.00 0.00 48.00 48.00 0.00 0.00 0.00 0.00 0.00 0.00
xvdb 21.00 0.00 672.00 816.00 63328.00 104448.00 225.51 30.65 20.74 19.28 21.94 0.67 100.00
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
xvda 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
xvdf 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
xvdb 0.00 4.95 630.69 802.97 62875.25 102677.23 230.95 30.27 21.11 19.80 22.14 0.69 99.01
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
xvda 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
xvdf 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
xvdb 23.00 153.00 988.00 668.00 94888.00 72104.00 201.68 26.84 16.21 14.57 18.62 0.59 98.40
即使在将 lru 扫描深度从默认值 1024 降低后,我仍然在 mysql 错误日志中收到这些消息,我发现网络上的一些类似帖子推荐了这种深度。
SET GLOBAL innodb_lru_scan_depth=256;
根据某人的建议,我还尝试通过以下方法找出问题是出在 LRU 列表还是刷新列表:
SHOW ENGINE INNODB STATUS\G
在下面的输出中,在某些情况下,我能够在待处理写入中看到大于零的刷新列表:
----------------------
BUFFER POOL AND MEMORY
----------------------
Total large memory allocated 50300190720
Dictionary memory allocated 18819582
Internal hash tables (constant factor + variable factor)
Adaptive hash index 3805993024 (764908736 + 3041084288)
Page hash 5976584 (buffer pool 0 only)
Dictionary cache 210046766 (191227184 + 18819582)
File system 1570552 (812272 + 758280)
Lock system 119847848 (119530904 + 316944)
Recovery system 0 (0 + 0)
Buffer pool size 2948760
Buffer pool size, bytes 0
Free buffers 417019
Database pages 2346130
Old database pages 866201
Modified db pages 60127
Pending reads 0
Pending writes: LRU 0, flush list 10, single page 0
Pages made young 5082, not young 0
0.17 youngs/s, 0.00 non-youngs/s
Pages read 2139505, created 206625, written 1680831
1323.32 reads/s, 0.70 creates/s, 21.87 writes/s
Buffer pool hit rate 1000 / 1000, young-making rate 0 / 1000 not 0 / 1000
Pages read ahead 1314.62/s, evicted without access 0.00/s, Random read ahead 0.00/s
LRU len: 2346130, unzip_LRU len: 0
I/O sum[0]:cur[128], unzip sum[0]:cur[0]
这是我使用的 my.cnf 的一个片段:
[mysqld]
# GENERAL #
user = mysql
default-storage-engine = InnoDB
socket = /var/run/mysqld/mysqld.sock
pid-file = /var/run/mysqld/mysqld.pid
basedir = /usr
tmpdir = /var/tmp
lc-messages-dir = /usr/share/mysql
explicit_defaults_for_timestamp
log_timestamps = SYSTEM
skip-name-resolve
net-write-timeout = 600
net-read-timeout = 600
innodb-page-cleaners = 8
performance-schema = OFF
# MyISAM #
key-buffer-size = 32M
# SAFETY #
max-allowed-packet = 16M
max-connect-errors = 1000000
sysdate-is-now = 1
# DATA STORAGE #
datadir = /var/lib/mysql/
# BINARY LOGGING #
server-id = 2
log-bin = /var/lib/mysql/mysql-bin
expire-logs-days = 14
sync-binlog = 1
max_binlog_size = 1G
max_binlog_files = 20
# CACHES AND LIMITS #
tmp-table-size = 32M
max-heap-table-size = 32M
query-cache-type = 0
query-cache-size = 0
max-connections = 500
thread-cache-size = 50
open-files-limit = 4510
table-definition-cache = 4096
table-open-cache = 4096
# INNODB #
innodb-flush-method = O_DIRECT
innodb-log-files-in-group = 2
innodb-log-file-size = 512M
innodb-flush-log-at-trx-commit = 1
innodb-file-per-table = 1
innodb-buffer-pool-size = 45G
innodb-print-all-deadlocks = ON
# LOGGING #
log-error = /var/log/mysql/mysql-error.log
slow-query-log-file = /var/log/mysql/mysql-slow.log
lower-case-table-names = 1
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_general_ci
#Slow query queries
slow-query-log = 1
long-query-time = 10
slow-query-log-always-write-time = 15 #Slow query queries
log-slow-verbosity = full
log-slow-rate-type = query
log-slow-rate-limit = 100 #queries logged/sec
log-queries-not-using-indexes = 1
任何解决和解决此问题的建议/帮助/指标都会有很大帮助。
这是我的产品中的限制 -a :
$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 257583
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 257583
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
最佳答案
您打开的文件数限制为 1024,请将其提高到 90000。每个文件的操作系统成本在 RAM 中几乎为零。在实现时验证您的更改。然后在你的配置部分要做的事情只有 1 改变,监控如果没有负面影响,请在下一个工作日再更改一次。许多可以动态更改,请参阅用户指南。
thread_cache_size=100 # from 50 to minimize
threads_created
open_files_limit=30000 # from 4510
table_definition_cache=10000 # from 4096
table_open_cache=10000 # from 4096
这几天的修改/监控将改进您的实例。
在另一天(或一个小时)针对不使用索引的单个查询
slow_query_log=1 # for ON
min_examined_row_limit=1 # to eliminate useless chatter
log_queries_not_using_indexes=1
long_query_time=5000 # for 5000 seconds which will be RARE
避免慢速查询和不使用索引信息的查询混合在一起
当你完成这个单一的焦点时,
min_examined_row_limit=0 for useless chatter in the slow query log
log_queries_not_using_indexes=0
long_query_time=10 or less depending on your need to monitor.
为了进一步分析,您有多少 RAM,您使用的是 SSD 还是旋转硬盘?请发布 A) SHOW GLOBAL STATUS 的 TEXT 结果; B) 显示全局变量;
关于mysql - InnoDB : page_cleaner: 1000ms intended loop took xxx ms. 设置可能不是最佳的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46242531/
自从我学习 Espresso 以来已经 2 周了,我无法理解 intending 和 intended。什么时候使用 intending 和 intended?提供的示例和在线教程没有帮助,研究网络对
我一直在学习汇编,并且我了解到四个主要的 x86 通用寄存器(eax、ebx、ecx 和 edx)每个都有一个预期或建议的用途。例如,eax是累加器寄存器,ecx用作循环的计数器,等等。大多数编译器是
我正在尝试使用 LINQ 表达式将 DataTable 中的每一行转换为 List 对象中的条目。 我的代码: DataTable dataTable = dataSet.Tables[0]; var
这个问题的部分灵感来自 this one . alias foo='ls -1 $1' foo /etc 显示/etc 的内容,每行一项。 ls -1 /etc | tail 显示/etc 中的最后十
我已经开始尝试 APC 在每个网络服务器上存储一些特定的数据,作为对 memcached 的补充。 但是,下面的代码片段让我很头疼: echo apc_store('key', 'value'); e
This article声称每个寄存器都有一个预期的目的,更重要的是, When the engineers at Intel designed the original 8086 processor
我想要完成的是当我将鼠标悬停在一个链接上时,它将使其他链接成为 opacity: .1同时保持该链接颜色相同。 我尝试做的是 a:hover ~ a ,但它不起作用。我用基本的 创建了一个新的 js
这个问题对我来说真的很奇怪。我正在创建并写入一个简单的文件。当我阅读这段代码时: return_chars = new char[10]; file.read(return_chars, 10); 结
所以首先我点击运行模块 然后就出现了 我的代码 import time print("First we need to know you.") print("Enter your name p
我想通过名称获取路由值并将其存储在变量中。 原因是,我想使用 Redirect::intended($url) 方法将用户重定向到路由,而不是仅仅将 url 放在那里。 基本上,我希望具有与 Redi
我刚刚在读大卫的文章 HERE 并决定尝试使用 flexbox,因此我自己制作了以下示例: CSS .wrpr {
我总是对 CSS 中的 clear: left、clear: right 和 clear: both 感到困惑。我知道 clear: both 意味着它不允许在其自身的两侧有 float 元素。 我做
关闭。这个问题是not reproducible or was caused by typos .它目前不接受答案。 这个问题是由于错别字或无法再重现的问题引起的。虽然类似的问题可能是on-topi
我正在构建一个评论应用程序。我正在使用 json-server 进行发布请求。我的数据库看起来像这样 [{ "id": 5, "name": "Tom Cruise", "im
我是一名文凭学生,正在制作一个基于处理的游戏,这是一款塔防游戏,女主角将向冲向城堡的僵尸射箭。我对此有多个问题。 充电器僵尸被击杀后不会重生。 当我只射杀一只充电器僵尸时,所有充电器僵尸都一起死了。
我已经定义了一个 html 表,我需要 CSS 在 IE 9 和 IE 7 中工作(有或没有 hack)。我的 CSS 描述如下: .grid { border: 1px solid #C3C3C3;
所以,我有一个包裹在 div 中的图像 (.indexWrap):
我正在尝试对通过 Sequelize 创建的模型执行 beforeCreate 操作。我试图在创建用户之前保存密码和盐。但是,创建的用户没有加密的密码或盐。我对 Node.JS 不太熟悉,但我认为这与
在维基百科上,有关于如何根据随机方法初始化 kmeans 簇位置的描述。 在 pyclustering ,一个python集群库,各种集群都是用高性能c核实现的。这个核心比 numpy/sklearn
我们正在学习我的人工智能游戏类(class)中的转向行为,我想我会尝试实现其中的一些行为。我主要是在阅读 The Nature of Code熟悉主题。 Here是我的 Unity 项目的存储库。相关
我是一名优秀的程序员,十分优秀!