Too many connections” error,

Too many connections” error

max_connections

By default 151 is the maximum permitted number of simultaneous client connections in MySQL 5.5.

If you reach the limit of max_connections you will get the “Too many connections” error when you to try to connect to your MySQL server. This means all available connections are in use by other clients.

MySQL permits one extra connection on top of the max_connections limit

which is reserved for the database user having SUPER privilege in order to diagnose connection problems. Normally the administrator user has this SUPER privilege. You should avoid granting SUPER privilege to app users.

It depends on the amount of RAM available and memory usage for each connection.

Increasing max_connections value increases the number of file descriptors that mysqld requires.

Note: there is no hard limit to setting up maximum max_connections value.

So, you have to choose max_connections wisely as per your workload, number of simultaneous connections to MySQL server etc. In general, allowing too high of a max_connections value is not recommended because in case of some locking conditions or slowdowns if all those connections running huge contention issue may raise.

In the case of active connections using temporary/memory tables, memory usage can go even higher.

On systems with small RAM or with a hard number of connections control on the application side,

we can use small max_connections values like 100-300. Systems with 16G RAM or higher max_connections=1000 is a good idea,

and per-connection buffer should have good/default values while on some systems we can see up to 8k max connections, but such systems usually became down in case of load spikes.

MySQL uses one thread per client connection and many active threads are performance killer.(性能杀手: 降低性能)

per thread per client connection

太多的活跃线程就是性能杀手。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值