# Getting "Too many connections" yet not consuming 50% of max\_connections

**URL:** <https://forums.percona.com/t/getting-too-many-connections-yet-not-consuming-50-of-max-connections/29982>\
**Category:** MySQL & MariaDB\
**Created:** [April 30, 2024, 7:10pm UTC](https://forums.percona.com/t/getting-too-many-connections-yet-not-consuming-50-of-max-connections/29982 "2024-04-30T19:10:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbolin](https://avatars.discourse-cdn.com/v4/letter/j/e56c9b/32.png) [@jbolin](https://forums.percona.com/u/jbolin)\
**Post date:** [April 30, 2024, 7:10pm UTC](https://forums.percona.com/t/getting-too-many-connections-yet-not-consuming-50-of-max-connections/29982/1 "2024-04-30T19:10:28Z")

</div>

We are running into an issue where the MySQL instance is returning “Too many connections”. The only resolution is a restart of MySQL. When it happened the second time I was logged into MySQL and the show processlist command listed 136 connections and max\_connections is set to 500. Max\_user\_connections is not set for any user. We were not even hitting 50% of max\_connections and this was happening for all users in the database including root connecting locally through a socket.

Sample of error.log  
2024-04-29T16:47:34.642514Z 0 [Warning] [MY-000000] [Server] Too many connections  
2024-04-29T16:47:35.345191Z 0 [Warning] [MY-000000] [Server] Too many connections  
2024-04-29T16:47:36.015070Z 0 [Warning] [MY-000000] [Server] Too many connections  
2024-04-29T16:47:36.015137Z 0 [Warning] [MY-000000] [Server] Too many connections  
2024-04-29T16:47:38.825593Z 0 [Warning] [MY-000000] [Server] Too many connections  
2024-04-29T16:47:38.903911Z 0 [Warning] [MY-000000] [Server] Too many connections  
2024-04-29T16:47:38.903981Z 0 [Warning] [MY-000000] [Server] Too many connections  
2024-04-29T16:47:39.426766Z 0 [Warning] [MY-000000] [Server] Too many connections  
2024-04-29T16:47:39.853798Z 0 [Warning] [MY-000000] [Server] Too many connections  
2024-04-29T16:47:40.403982Z 0 [Warning] [MY-000000] [Server] Too many connections  
2024-04-29T16:47:40.404253Z 0 [Warning] [MY-000000] [Server] Too many connections  
2024-04-29T16:47:41.971452Z 0 [Warning] [MY-000000] [Server] Too many connections  
2024-04-29T16:47:42.880956Z 0 [Warning] [MY-000000] [Server] Too many connections  
2024-04-29T16:47:43.889567Z 0 [Warning] [MY-000000] [Server] Too many connections

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [May 1, 2024, 1:14am UTC](https://forums.percona.com/t/getting-too-many-connections-yet-not-consuming-50-of-max-connections/29982/2 "2024-05-01T01:14:26Z")

</div>

Can you try FLUSH HOSTS next time? This may be an incorrect message due to a particular host causing too many auth failures getting black-flagged.

---

<div class="post-metadata">

**Author:** ![jbolin](https://avatars.discourse-cdn.com/v4/letter/j/e56c9b/32.png) [@jbolin](https://forums.percona.com/u/jbolin)\
**Post date:** [May 1, 2024, 6:56pm UTC](https://forums.percona.com/t/getting-too-many-connections-yet-not-consuming-50-of-max-connections/29982/3 "2024-05-01T18:56:54Z")

</div>

Ran flush hosts and the process hung.

---

<div class="post-metadata">

**Author:** ![jbolin](https://avatars.discourse-cdn.com/v4/letter/j/e56c9b/32.png) [@jbolin](https://forums.percona.com/u/jbolin)\
**Post date:** [May 1, 2024, 7:26pm UTC](https://forums.percona.com/t/getting-too-many-connections-yet-not-consuming-50-of-max-connections/29982/4 "2024-05-01T19:26:59Z")

</div>

It was also happening on multiple host including remote and connecting locally through a socket. It is a very odd error.

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [May 1, 2024, 8:02pm UTC](https://forums.percona.com/t/getting-too-many-connections-yet-not-consuming-50-of-max-connections/29982/5 "2024-05-01T20:02:31Z")

</div>

are you running with `skip-name-resolve`?

---

<div class="post-metadata">

**Author:** ![jbolin](https://avatars.discourse-cdn.com/v4/letter/j/e56c9b/32.png) [@jbolin](https://forums.percona.com/u/jbolin)\
**Post date:** [May 2, 2024, 2:12pm UTC](https://forums.percona.com/t/getting-too-many-connections-yet-not-consuming-50-of-max-connections/29982/6 "2024-05-02T14:12:41Z")

</div>

skip\_name\_resolve = OFF
