- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
服务器专用 128 GB RAM 的推荐配置是什么
my.cnf
[mysqld]
datadir="/home/mysql"
default-storage-engine=MyISAM
innodb_file_per_table=1
max_allowed_packet=268435456
innodb_buffer_pool_size = 94G
innodb_buffer_pool_instances = 12
innodb_open_files=20000
innodb_io_capacity=10000
innodb_io_capacity_max=25000
innodb_read_io_threads=8
innodb_write_io_threads=8
innodb_flush_log_at_trx_commit=2
innodb_max_dirty_pages_pct = 90
open_files_limit=100000
interactive_timeout=60
wait_timeout=60
max_connections=20000
max_connect_errors=20000
tmp_table_size=1G
max_heap_table_size=1G
# MyISAM
key_buffer_size = 1G
join_buffer_size = 10M
sort_buffer_size=256K
read_buffer_size=64K
read_rnd_buffer_size=256K
slow-query-log
table_open_cache = 5000
query_cache_type = 1
query_cache_limit = 10M
query_cache_min_res_unit = 1M
query_cache_size = 256M
thread_cache_size = 4
skip_name_resolve=ON
MySQL调整:
>> MySQLTuner 1.4.0 - Major Hayden <major@mhtx.net>
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering
[!!] Currently running unsupported MySQL version 10.0.17-MariaDB-log
[OK] Operating on 64-bit architecture
-------- Storage Engine Statistics -------------------------------------------
[--] Status: +ARCHIVE +Aria +BLACKHOLE +CSV +FEDERATED +InnoDB +MRG_MyISAM
[--] Data in MyISAM tables: 603M (Tables: 470)
[--] Data in InnoDB tables: 93G (Tables: 563)
[--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 52)
[--] Data in MEMORY tables: 60K (Tables: 3)
[!!] Total fragmented tables: 216
-------- Performance Metrics -------------------------------------------------
[--] Up for: 16h 58m 38s (22M q [366.226 qps], 920K conn, TX: 8B, RX: 1B)
[--] Reads / Writes: 35% / 65%
[--] Total buffers: 96.1G global + 10.8M per thread (20000 max threads)
[!!] Maximum possible memory usage: 307.9G (244% of installed RAM)
[OK] Slow queries: 0% (0/22M)
[OK] Highest usage of available connections: 0% (106/20000)
[OK] Key buffer size / total MyISAM indexes: 1.0G/589.3M
[OK] Key buffer hit rate: 99.7% (28M cached / 74K reads)
[OK] Query cache efficiency: 22.8% (1M cached / 6M selects)
[!!] Query cache prunes per day: 1568144
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 46K sorts)
[OK] Temporary tables created on disk: 5% (3K on disk / 66K total)
[OK] Thread cache hit rate: 98% (14K created / 920K connections)
[OK] Table cache hit rate: 104% (1K open / 1K opened)
[OK] Open file limit used: 1% (1K/100K)
[OK] Table locks acquired immediately: 99% (14M immediate / 14M locks)
[OK] InnoDB buffer pool / data size: 94.0G/93.2G
[OK] InnoDB log waits: 0
我有一个很大的数据库,我的CPU使用情况:
http://i.stack.imgur.com/4azch.png
http://i.stack.imgur.com/mm7oZ.png
并拥有 5000 名用户
查询:
SELECT * FROM users ORDER BY RAND();
非常慢,用户中有超过 900k 行
最佳答案
该值是假的。它是根据最坏情况的组合计算得出的。而且它甚至没有包括所有的情况!
然而,这是荒谬的:
max_connections = 20000 [OK] Highest usage of available connections: 0% (106/20000)
2000 很少是一个合理的数字。降低它。如果你确实达到了 max_connections,那么其他地方就会出现问题。无论如何,请注意 Max_used_connections 只有 106。(106 有点高,但不一定是问题。)
tmp_table_size=1G max_heap_table_size=1G
如果您正在运行 20K 个 SELECT,每个 SELECT 都需要 3 个临时表,那么可能需要多达 60TB 的 RAM!因此,降低这两个设置作为防止 RAM 耗尽的额外保护。对于 MySQL 来说,交换是可怕。
[!!] Total fragmented tables: 216
忽略这一点;表通常是碎片化的;采取行动是不值得的。
[OK] Slow queries: 0% (0/22M)
将 long_query_time 降低到 2(秒)。
[!!] Query cache prunes per day: 1568144
听起来好像打开查询缓存 (1) 会造成伤害。
[OK] Key buffer size / total MyISAM indexes: 1.0G/589.3M
认真考虑更改为 InnoDB。
关于mysql - 最大可能内存使用量 : 307. 9G(已安装 RAM 的 244%),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28868926/
我希望有人能解释为什么我的应用程序在加载时使用不同数量的 RAM。我说的是直接使用 exe 的编译版本。这是一个非常基本的应用程序,在应用程序的启动中没有条件分支。然而,每次我启动它时,RAM 量都在
我有一个 inode 使用率为 100% 的磁盘驱动器(使用 df -i 命令)。但是在大量删除文件后,使用率仍然是 100%。 那么正确的做法是什么? 磁盘空间使用量较少的磁盘驱动器怎么可能有Ino
假设我与分支有一个智能合约,其中每个分支都有不同数量的操作。 if (someCondition) { // do operations costing 10 gas } else { //d
是否有一种工具可以在提交到 NEAR 网络之前估算合约调用将产生多少 gas? 最佳答案 目前最好的估计是用runtime-standalone ,它可以处理交易而不必担心共识/网络。这意味着您可以创
我正在使用最新的 SDK 开发适用于 Windows Azure 的应用程序。 目前我正在使用缓存实现 session 提供程序,但模拟器完全不成比例: 缓存被实现为“非常小的”辅助角色(最大 768
我正在为我的 Logstash RAM 问题寻找答案,因为它几乎是 100%。我为它做了很多搜索,但他们没有为我工作。下面的代码是我的 logstash.conf 文件。我认为它需要一些小改动。 Lo
我已经阅读了这里有关此问题的所有其他问题以及互联网其他地方的许多文章。根据this site ,最大内存使用量遵循以下公式: Max memory = [-Xmx] + [-XX:MaxPermSiz
我需要以编程方式增加 Android 中的 RAM 使用量,以观察它随时间的变化。我该怎么做? 我尝试生成很多自定义对象,但生成后意外地 RAM 使用量减少了...我更改了对象数量、结构等,但没有任何
我们使用带有 MMFiles 存储引擎的 ArangoDB 3.3.14(社区版)来处理相对较大的数据集(备份时会超过 30 GB)。我们使用 ECS 在 Docker 容器内运行它。我们的主机虚拟机
我收到了 Hostgator 发来的一条说明,表明他们限制了我对 MYSQL 的访问,因为我的网站使用了太多资源。 通常,在这种情况下,我只会恢复备份以查看最近的更改是否会产生错误。但是,除了写了一些
我使用 TMimeMess 来解码基于 SMTP 服务器的传入电子邮件在突触上。 我发现用于解码 50MB MIME 消息(带有附件),TMimeMess 使用了 600-800MB 的内存。 在这里
我正在打包适用于 iOS 和 Android 的 Adobe Air 应用程序,并且我的 (RAM) 内存使用量超过 100MB。我的游戏(RPG)中有大量 Assets 。 Assets 的数量
我是一名优秀的程序员,十分优秀!