当前位置:网站首页>【MySQL 15】Could not increase number of max_open_files to more than 10000 (request: 65535)
【MySQL 15】Could not increase number of max_open_files to more than 10000 (request: 65535)
2022-07-06 02:02:00 【Rusty well began】
1、阅读8.4.3.1 MySQL 如何打开和关闭表
https://dev.mysql.com/doc/refman/5.6/en/table-cache.html
其中指出: “table_open_cache 和 max_connections 系统变量会影响服务器保持打开的最大文件数。如果您增加其中一个或两个值,您可能会遇到操作系统对每个进程打开文件描述符的数量施加的限制。许多操作系统允许您增加打开文件的限制,尽管方法因系统而异。请查阅您的操作系统文档,以确定是否可以增加限制以及如何增加限制。”
2、阅读 MySQL 的open_files_limit 文档,
https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_open_files_limit
其中指出:“操作系统允许 mysqld 打开的文件数。此变量在运行时的值是系统允许的实际值,可能与您在服务器启动时指定的值不同。在 MySQL 无法更改打开文件数的系统上,该值为 0。…有效的 open_files_limit 值基于系统启动时指定的值(如果有)以及 max_connections 和 table_open_cache的值. 服务器尝试使用这三个值中的最大值来获取文件描述符的数量。如果无法获取那么多描述符,服务器会尝试获取系统允许的尽可能多的描述符。”
3、 检查 Opened_tables状态变量,该变量指示自服务器启动以来的开表操作数:
mysql> SHOW GLOBAL STATUS LIKE 'Opened_tables';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Opened_tables | 43618 |
+---------------+-------+
1 row in set (0.00 sec)
mysql>
4、解决方案
如果 MySQL 以下警告开头:
Could not increase number of max_open_files to more than 10000 (request: 65535)
这意味着某个地方正在达到极限。让我们通过编辑任何配置的限制来解决这个问题。查看以下文件:
linux-2dk8:/ # find -name mysql.service
./etc/systemd/system/multi-user.target.wants/mysql.service
find: File system loop detected; ‘./.snapshots/1/snapshot’ is part of the same file system loop as ‘.’.
./usr/lib/systemd/system/mysql.service
./sys/fs/cgroup/pids/system.slice/mysql.service
./sys/fs/cgroup/devices/system.slice/mysql.service
./sys/fs/cgroup/systemd/system.slice/mysql.service
linux-2dk8:/ # cat /usr/lib/systemd/system/mysql.service
在mysql.service文件中查找配置
linux-2dk8:/ # cat /usr/lib/systemd/system/mysql.service
# Sets open_files_limit
LimitNOFILE = 10000
请不要使用无穷大作为值;它默认为 65535。因此,如果您看到值 infinity,请将其替换为所需的限制。
修改之后的为:
# Sets open_files_limit
LimitNOFILE = 65535
完成此操作后,您现在应该重新加载系统守护程序并重新启动 MySQL 服务:
systemctl daemon-reload
systemctl restart mysql
通过 MySQL 命令行检查新限制。您可以使用以下查询,确保设置了新限制:
mysql> SHOW VARIABLES LIKE 'open_files_limit';
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| open_files_limit | 65535 |
+------------------+-------+
1 row in set (0.01 sec)
边栏推荐
- Kubernetes stateless application expansion and contraction capacity
- Leetcode3, implémenter strstr ()
- Sword finger offer 12 Path in matrix
- Global and Chinese market of commercial cheese crushers 2022-2028: Research Report on technology, participants, trends, market size and share
- National intangible cultural heritage inheritor HD Wang's shadow digital collection of "Four Beauties" made an amazing debut!
- Jisuanke - t2063_ Missile interception
- 论文笔记: 图神经网络 GAT
- How to improve the level of pinduoduo store? Dianyingtong came to tell you
- Use Scrollview and tabhost to realize vertical scrollbars and tabs
- 论文笔记: 极限多标签学习 GalaXC (暂存, 还没学完)
猜你喜欢

Tensorflow customize the whole training process

Computer graduation design PHP part-time recruitment management system for College Students

安装php-zbarcode扩展时报错,不知道有没有哪位大神帮我解决一下呀 php 环境用的7.3

Jisuanke - t2063_ Missile interception

数据工程系列精讲(第四讲): Data-centric AI 之样本工程

Open source | Ctrip ticket BDD UI testing framework flybirds
![[Clickhouse] Clickhouse based massive data interactive OLAP analysis scenario practice](/img/3a/63f3e89ddf84f23f950ed9620b4405.jpg)
[Clickhouse] Clickhouse based massive data interactive OLAP analysis scenario practice
![[depth first search] Ji Suan Ke: Betsy's trip](/img/b5/f24eb28cf5fa4dcfe9af14e7187a88.jpg)
[depth first search] Ji Suan Ke: Betsy's trip

同一个 SqlSession 中执行两条一模一样的SQL语句查询得到的 total 数量不一样
![抓包整理外篇——————状态栏[ 四]](/img/1e/2d44f36339ac796618cd571aca5556.png)
抓包整理外篇——————状态栏[ 四]
随机推荐
Computer graduation design PHP college classroom application management system
Kubernetes stateless application expansion and contraction capacity
Install redis
TrueType字体文件提取关键信息
genius-storage使用文档,一个浏览器缓存工具
Sword finger offer 12 Path in matrix
SPI communication protocol
Concept of storage engine
SQL statement
Blue Bridge Cup embedded_ STM32_ New project file_ Explain in detail
Regular expressions: examples (1)
Gbase 8C database upgrade error
02. Go language development environment configuration
[depth first search] Ji Suan Ke: Betsy's trip
[depth first search notes] Abstract DFS
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
抓包整理外篇——————状态栏[ 四]
RDD creation method of spark
Global and Chinese markets of general purpose centrifuges 2022-2028: Research Report on technology, participants, trends, market size and share
Shutter doctor: Xcode installation is incomplete