- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在为一个带有 joomla CMS 的网站使用波纹管规范的专用服务器,该网站是基于新闻/博客的网站:Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz10 个内核,20 个线程内存:60GBSSD:250(操作系统和我认为是数据库)硬盘:2TB
PHP 7.3
MySQL 5.7
网站加载时间很慢,我优化了页面,但服务器响应时间很慢,所以我只安装了 Mysql-Tunner 来检查数据库状态。我只是查看报告,但我不知道是好事还是坏事。需要您宝贵的详细指南。
>> MySQLTuner 1.7.15 - Major Hayden <major@mhtx.net>
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.7.27
[OK] Operating on 64-bit architecture
-------- Log file Recommendations ------------------------------------------------------------------
[--] Log file: /var/log/mysqld.log(2M)
[OK] Log file /var/log/mysqld.log exists
[OK] Log file /var/log/mysqld.log is readable.
[OK] Log file /var/log/mysqld.log is not empty
[OK] Log file /var/log/mysqld.log is smaller than 32 Mb
[!!] /var/log/mysqld.log contains 2231 warning(s).
[!!] /var/log/mysqld.log contains 5891 error(s).
-------- Storage Engine Statistics -----------------------------------------------------------------
[--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MEMORY +MRG_MYISAM +MyISAM +PERFORMANCE_SCHEMA
[--] Data in MyISAM tables: 431.8K (Tables: 60)
[--] Data in InnoDB tables: 1.4G (Tables: 363)
[--] Data in MEMORY tables: 0B (Tables: 8)
[OK] Total fragmented tables: 0
-------- Analysis Performance Metrics --------------------------------------------------------------
[--] innodb_stats_on_metadata: OFF
[OK] No stat updates during querying INFORMATION_SCHEMA.
-------- CVE Security Recommendations --------------------------------------------------------------
[OK] NO SECURITY CVE FOUND FOR YOUR VERSION
-------- Performance Metrics -----------------------------------------------------------------------
[--] Up for: 12d 2h 14m 35s (153M q [146.876 qps], 4M conn, TX: 1441G, RX: 39G)
[--] Reads / Writes: 92% / 8%
[--] Binary logging is disabled
[--] Physical Memory : 55.5G
[--] Max MySQL memory : 8.2G
[--] Other process memory: 0B
[--] Total buffers: 8.1G global + 1.1M per thread (80 max threads)
[--] P_S Max memory usage: 0B
[--] Galera GCache Max memory usage: 0B
[OK] Maximum reached memory usage: 8.1G (14.59% of installed RAM)
[OK] Maximum possible memory usage: 8.2G (14.73% of installed RAM)
[OK] Overall possible memory usage with other process is compatible with memory available
[OK] Slow queries: 0% (0/153M)
[OK] Highest usage of available connections: 12% (10/80)
[OK] Aborted connections: 0.08% (3729/4397307)
[!!] Query cache may be disabled by default due to mutex contention.
[!!] Query cache efficiency: 0.0% (0 cached / 119M selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (23K temp sorts / 25M sorts)
[!!] Joins performed without indexes: 52200
[!!] Temporary tables created on disk: 92% (14M on disk / 15M total)
[OK] Thread cache hit rate: 99% (10 created / 4M connections)
[!!] Table cache hit rate: 1% (1K open / 101K opened)
[OK] Open file limit used: 0% (11/10K)
[OK] Table locks acquired immediately: 100% (107K immediate / 107K locks)
-------- Performance schema ------------------------------------------------------------------------
[--] Performance schema is disabled.
[--] Memory used by P_S: 0B
[--] Sys schema is installed.
-------- ThreadPool Metrics ------------------------------------------------------------------------
[--] ThreadPool stat is disabled.
-------- MyISAM Metrics ----------------------------------------------------------------------------
[!!] Key buffer used: 18.3% (1M used / 8M cache)
[OK] Key buffer size / total MyISAM indexes: 8.0M/221.0K
[OK] Read Key buffer hit rate: 99.2% (61K cached / 507 reads)
[!!] Write Key buffer hit rate: 65.7% (105 cached / 69 writes)
-------- InnoDB Metrics ----------------------------------------------------------------------------
[--] InnoDB is enabled.
[--] InnoDB Thread Concurrency: 0
[OK] InnoDB File per table is activated
[OK] InnoDB buffer pool / data size: 8.0G/1.4G
[!!] Ratio InnoDB log file size / InnoDB Buffer pool size (3.125 %): 128.0M * 2/8.0G should be equal to 25%
[OK] InnoDB buffer pool instances: 8
[--] Number of InnoDB Buffer Pool Chunk : 64 for 8 Buffer Pool Instance(s)
[OK] Innodb_buffer_pool_size aligned with Innodb_buffer_pool_chunk_size & Innodb_buffer_pool_instances
[OK] InnoDB Read buffer efficiency: 100.00% (426722546739 hits/ 426722621278 total)
[!!] InnoDB Write Log efficiency: 80.95% (42826081 hits/ 52905097 total)
[OK] InnoDB log waits: 0.00% (0 waits / 10079016 writes)
[--] AriaDB is disabled.
[--] TokuDB is disabled.
[--] XtraDB is disabled.
[--] Galera is disabled.
-------- Replication Metrics -----------------------------------------------------------------------
[--] Galera Synchronous replication: NO
[--] No replication slave(s) for this server.
[--] Binlog format: ROW
[--] XA support enabled: ON
[--] Semi synchronous replication Master: Not Activated
[--] Semi synchronous replication Slave: Not Activated
[--] This is a standalone server
-------- Recommendations ---------------------------------------------------------------------------
<b>General recommendations:</b>
Control warning line(s) into /var/log/mysqld.log file
Control error line(s) into /var/log/mysqld.log file
Adjust your join queries to always utilize indexes
When making adjustments, make tmp_table_size/max_heap_table_size equal
Reduce your SELECT DISTINCT queries which have no LIMIT clause
Increase table_open_cache gradually to avoid file descriptor limits
Read this before increasing table_open_cache over 64:
Read this before increasing for MariaDB https://mariadb.com/kb/en/library/optimizing-table_open_cache/
This is MyISAM only table_cache scalability problem, InnoDB not affected.
See more details here: https://bugs.mysql.com/bug.php?id=49177
This bug already fixed in MySQL 5.7.9 and newer MySQL versions.
Beware that open_files_limit (10000) variable
should be greater than table_open_cache (2000)
Performance schema should be activated for better diagnostics
Before changing innodb_log_file_size and/or innodb_log_files_in_group read this:
<b>Variables to adjust:</b>
query_cache_size (=0)
query_cache_type (=0)
query_cache_limit (> 1M, or use smaller result sets)
join_buffer_size (> 256.0K, or always use indexes with JOINs)
tmp_table_size (> 64M)
max_heap_table_size (> 64M)
table_open_cache (> 2000)
performance_schema = ON enable PFS
innodb_log_file_size should be (=1G) if possible, so InnoDB total log files size equals to 25% of buffer pool size.
和 my.cnf :
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
open_files_limit=10000
default-storage-engine=InnoDB
innodb_file_per_table=1
max_allowed_packet=268435456
wait_timeout = 18
interactive_timeout=18
thread_cache_size=10
skip-name-resolve=1
tmp_table_size=64M
max_heap_table_size=64M
innodb_buffer_pool_size=8G
innodb_flush_method = O_DIRECT
innodb_log_files_in_group = 2
innodb_log_file_size = 128M
innodb_flush_log_at_trx_commit = 1
最佳答案
关于 my.cnf [mysqld] 部分的建议
tmp_table_size=256M # from 64M to expand capacity
max_heap_table_size=256M # to expand and reduce created_tmp_disk_tables
innodb_flushing_avg_loops=5 # from 30 to reduce innodb_buffer_pool_pages_dirty
innodb_io_capacity=1900 # from 200 to enable additional SSD IOPS
innodb_buffer_pool_size=16G # from 8G to expand capacity
innodb_change_buffer_max_size=50 # from 25 percent to accommodate adding ROWS frequently
免责声明:我是我个人资料中提到的网站的内容作者,网络个人资料包括可下载的免费实用脚本、其他建议选项、联系信息。
关于MySQL 调谐器 : High ratio of temporary tables created on disk - Website Slow response,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57574637/
今天想测试一下PostgreSQL 9.1的一个新特性,就是unlogged table,结果报如下Error,谁能帮帮我? mydb=> CREATE UNLOGGED table testu (a
struct F { private: int* data; public: F( int n ) { data = new int; *dat
我创建了几个中间件类,现在想根据一些真实的 View 来测试它们。由于我的应用程序不包含任何 View 或 url conf 本身,我想知道是否有一种方法可以临时创建 View 和 url 配置,仅用
我正在使用 Spark,我想知道:如何通过对表 A 和 B 执行 sql 查询来创建名为 C 的临时表? sqlContext .read.json(file_name_A) .creat
我最近重新安装了 ubuntu 20.04.3,在做了一些设置后,我现在在运行 apt update 时总是收到以下错误.我一定是不小心删除了某种缓存文件或目录,但我不知道如何诊断或解决这个问题。 任
我的 Magento 版本是 2.2.3。我们使用的是第二代 Google Cloud SQL 实例。 运行索引命令时遇到错误 General error: 1787 Statement violat
此代码用于使用早期的 g++ 版本进行编译,例如5.3.使用 10.2 我得到以下结果(使用编译器选项 -std=c++11) tmp1.cpp: In function ΓÇÿint main(in
有没有办法不使用临时“结果”来编写以下代码? result = func(); if(result == -1) return func2(); else return res
我创建一个临时 NSManagedObject 并将其与主 NSManagedObjectContext 关联。我需要能够将其视为上下文中功能齐全的对象(执行获取请求等),因此无法在没有关联上下文的情
我一直在努力争取在 Azure 中实现角色内的同地缓存(非专用)。 在我的 MVC WebApi 2 项目的 web.config 中: ...
我写了一个类来使用它作为一个方便的 View ,例如基于范围的for s。总的来说,它只是一对带有边界检查的迭代器: template class Range { private: I begin
在运行我的代码(使用 gfortran 编译)时,我收到 Fortran 运行时警告“创建了临时数组”,我想知道是否有更好的方法来解决此警告。 我原来的代码是这样的: allocate(flx_est
经过长时间的研究,我正在写这篇文章,但我真的很难找到解决我问题的最佳方法。 我对 resKit 和 CoreData 都很陌生......无论如何,我正在映射并保存我从 Web 服务接收到的 JSON
我需要在java spring应用程序中实现像临时存储这样的东西。例如,当事件发生时,我放了一个值,但同时这个类正在被另一个监听器类监听,并且一旦需要的值到达此存储,监听器就会调用某些操作。在java
如果你查看MySql临时表的官方文档: http://dev.mysql.com/doc/refman/5.1/en/internal-temporary-tables.html 给出的理由是:
这个问题有点棘手。我正在使用将结果插入 DOM 的第三方库。 示例: $('#puthere').thirdpartyplugin(); 这将调用 thirdpartyplugin 并操作 HTML
这个查询非常简单,我想做的就是获取给定类别中按 last_updated 字段排序的所有文章: SELECT `articles`.* FROM `articles`, `ar
我已经制作了这个 C++ 代码: std::string const & Operand::toString() const { std::ostringstream convert
MySQL 文档说:“您不能在同一个查询中多次引用一个临时表。” 我知道之前有人问过这个问题。但我找不到针对以下内容的具体解决方案。 我正在对临时表进行预选 CREATE TEMPORARY TABL
我对使用 git 比较陌生。 最近我们从 master 分支了 +-10 个功能分支。我们称它们为 A、B、C 等。 我想将这些全部 merge 在一起进行测试。如果我创建一个新分支并 merge 我
我是一名优秀的程序员,十分优秀!