- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
我遇到了一个问题,我通过编辑my.cnf将其设置为1000后,mysql中max_connction的值为214,如下所示:
hadoop@node1:~$ mysql -V
mysql Ver 14.14 Distrib 5.7.15, for Linux (x86_64) using EditLine wrapper
MySQL 版本:5.7
操作系统版本:ubuntu 16.04LTS
mysql> show variables like 'max_connections';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 151 |
+-----------------+-------+
1 row in set (0.00 sec)
我们可以看到,max_connections的变量值为151。然后,我编辑MySQL的配置文件。
yang2@node1:~$ sudo vi /etc/mysql/my.cnf
[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci
max_connections=1000
保存配置后重启MySQL服务。
yang2@node1:~$ service mysql restart
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to restart 'mysql.service'.
Multiple identities can be used for authentication:
1. yangqiang,,, (yang2)
2. ,,, (hadoop)
Choose identity to authenticate as (1-2): 1
Password:
==== AUTHENTICATION COMPLETE ===
yang2@node1:~$
现在,我们猜测 max_connection 是 1000,真的吗?
mysql> show variables like 'max_connections';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 214 |
+-----------------+-------+
1 row in set (0.00 sec)
是214,这个结果我不太明白,谁能帮帮我?谢谢!
最佳答案
您可以手动设置该值,例如
set global max_connections=500;
但是,在 MySQL 重新启动后,该值会重置为 214。
解决方案取决于操作系统(版本)和 MySQL 版本。在 Ubuntu 16.04 和 MySQL >= 5.7.7 下可以使用:
systemctl 编辑 mysql
输入
[Service]
LimitNOFILE=8000
保存,这将创建一个新文件
/etc/systemd/system/mysql.service.d/override.conf
然后重启服务器:
systemctl daemon-reload
systemctl restart mysql
对于其他环境:Can not increase max_open_files for Mysql max-connections in Ubuntu 15
关于mysql - MySQL 5.7 中的 max_connections,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39976756/
我的小公司已构建并托管了 300 多个网站。只选择了少数,由于 max_connections 设置太低,实际上有 2 或 3 个无法加载。我的问题是, max_connections 是基于每个页面
我正在尝试为共享主机上所需的 MySQL 和资源设置理想的性能设置。 我的问题是,max_connections 的真正含义是什么? 是向服务器发出的唯一并发请求数吗?因此,如果有两个用户,1 个打开
在 mysql 中,如何强制执行 max_connections 变量?也就是说,我的问题是——当达到最大连接数时——(a) 新连接是否被拒绝,或者 (b) mysql 会首先尝试关闭旧连接和/或空闲
我有一个多线程进程,其中 36 个线程随机写入数据库,平均每 10 秒一次,每个线程有 99% 的空闲时间( sleep )。 我不确定这是否意味着我有 36 个事件连接,或者实际上只有一两个,因为每
如何将变量 max_connection 更改为高于 214 的值。我在 my.cnf 上尝试了这个,但不起作用 max_connections = 2000 MySql的版本是5.6.24,我已经重
我已经设置max_connections=2000在/etc/my.conf并重新启动mysqld 但仍然max_connections似乎被困在 412 mysql> SHOW VARIABLES
我的简单问题:如何增加我的 Amazon RDS 数据库的可能连接数?我在我设置的地方使用了一个参数组 max_connections = 30000 这似乎是第一手的工作,因为 SHOW VARIA
在 MySQL 上,有什么理由不将 max_connections 设置为最大值 (100000)? 这种方法的副作用是什么? 最佳答案 来自docs:- Too many connections :
我的 postgres 服务器限制在 100 个 max_connections 上,并且在应用程序大量使用的某个时刻达到了限制,所以我尝试增加该数量并且当我尝试重新启动 postgres 时,不会启
我刚刚安装了 apache 2.2.3 并且已经出现“太多连接”的错误。我去 my.cnf 增加 max_connections 但它不存在! 里面唯一的内容是: [mysqld] datadir=/
我想知道在阅读世界场景中,连接池大小是否有意义!= max_connections ? 最佳答案 连接池大小 是始终可用连接的大小,而max connections 是最大连接数。 彻底地,当 max
我正在使用带有 Sequelize 的 Postgres作为 ORM/查询接口(interface)。最近我们开始遇到一些错误: SequelizeConnectionError: remaining
使用Varnish 3.0.4,我们看到了很多backend_busy,但是在任何后端中都没有设置max_connection设置。 我试图找出原因,因为似乎某些客户端请求被中止了。 什么会导致bac
我们在创建 MySQL 连接、查询然后关闭连接(通过 PHP)的页面上使用 ab (apachebench) 对我们的一个网站进行基准测试。 我们对 my.cnf 进行了硬编码,最大连接数限制为 50
我有一个指向 MySQL 5.7 的应用程序,它在启动时需要的不仅仅是默认的 MySQL max_connections(151)。但是,它会在服务器启动几分钟后逐渐减少(大约 20 个连接)。因此,
遗憾的是,我在任何地方都找不到对此查询的任何直接解释,甚至在 MySQL 文档中也找不到。 各种论坛上有人说 max_user_connections 永远不能大于 max_connections?例
我在 Linux Centos 上使用 MySQL 5.1.35 数据库。 Linux 服务器有 2GB RAM 和 14GB 磁盘空间。 我使用 Java 中的 ReSTLet 框架创建了网络服务,
我有一个服务器,很多用户都会连接到它并在那里使用数据库,而我正在使用 MySQL。我知道 MySQL 中 max_connections 的默认数量是 100 或 150,但我确信我需要超出该数量,因
MySQL 数据库的每个套接字的默认连接数为 100,但我正在寻找任何方法来增加 MySQL 数据库的套接字连接的可能连接数 > 100。 最佳答案 如果您需要在不重启 MySQL 的情况下增加 My
我正在使用这个网站分析工具:Umami 我目前正在查看 postgresql.conf文件,我看到 max_connections设置为 100。 在高峰期,我的网站可能有 1000 并发用户。 Po
我是一名优秀的程序员,十分优秀!