MySQL: Are sleep connections an issue?

June 23, 2023 | by dbsnoop

sleep connections

Sleep Connections right? Also called idle connections. One used to call the annoying connections.

First of all, we have the max_connections variable. This defines the maximum number of manageable connections your server will allow. If you set max_connections to 100, for example, no connection beyond the 100th will be permitted. If the server keeps open connections that are never used again, that’s a problem that needs to be addressed. Too many database connections usually indicate that the application has issues or was poorly designed. Very specific applications may indeed need to open several connections. Come on! Use connection pools for God’s sake!

Keep in mind that each idle connection has a minimum consumption of resources such as memory for example. The minimum memory connection is about 192kb to 256kb. But it depends on what happens when the connection is broken.

What can lead to a sleep connection?

  • Bad handshaking
  • Network failure
  • Application failure
  • Falha no gerenciador de;
  • Programming misconception

If you notice many connections in a sleep state on your MySQL server, it’s important to take some time to investigate. The dbsnOOp Flightdeck provides ways to track them and offers useful tools to deal with inactive ones.

Have a look on our website and discover a complete platform for your needs.

Give it a try for 14 days, no burocracy, no credit card

Learn more about Flightdeck!

Share

Read more

MONITOR YOUR ASSETS WITH FLIGHTDECK

NO INSTALL – 100% SAAS

Complete the form below to proceed

*Mandatory