The situation is this: There is a certain store engine, which is hosted, among other things, on my server and does not chronically close connections with MySQL. As a result, there are whole sheets of sleeping connections, growing with each new visitor, and the DB eats memory as if not in itself. It is clear that it is necessary to kick people who gave birth to this web development burp, and ideally change the engine, but I would like to make this situation impossible in principle.

Therefore questions:

  • What command kills connections to mysql?
  • How to get a list of connections opened more than N minutes ago?
  • Is it possible to configure the database so that it itself forcibly closes the old connections?

    1 answer 1

    1) MySQL: how to view the processes (connections) or "remove" a specific process (connection) . You can also see more: zombie processes in linux
    2) indicated above
    3) yes - google

    • 3) HINT: timeout keyword (: - MrClon
    • @Justicet, at least I have your link to MySQL ... not working. And where is the zombie? Zombies are an already completed process. - avp
    • 2
      @MrClon, @avp and what for? I closed the question. In particular, because he is almost a year old, like the answer. When I opened the links - they worked. - Risto