PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, April 20, 2022

[FIXED] What could cause all the MySQL connections to sleep?

 April 20, 2022     connection, mysql, sleep     No comments   

Issue

For some reason,the connections to my local database are put to sleep, even though the database is not actually doing anything:

mysql> SHOW FULL PROCESSLIST;
+-----+------+-----------+-----+---------+------+-------+-----------------------+
| Id  | User | Host      | db  | Command | Time | State | Info                  |
+-----+------+-----------+-----+---------+------+-------+-----------------------+
|  85 | root | localhost | *** | Sleep   |  810 |       | NULL                  |
|  88 | root | localhost | *** | Sleep   |  662 |       | NULL                  |
|  89 | root | localhost | *** | Sleep   |  586 |       | NULL                  |
|  93 | root | localhost | *** | Sleep   |  692 |       | NULL                  |
|  98 | root | localhost | *** | Sleep   |  719 |       | NULL                  |
| 102 | root | localhost | *** | Sleep   |  545 |       | NULL                  |
| 182 | root | localhost | *** | Query   |    0 | init  | SHOW FULL PROCESSLIST |
| 263 | root | localhost | *** | Sleep   |  809 |       | NULL                  |
| 275 | root | localhost | *** | Sleep   |  660 |       | NULL                  |
| 279 | root | localhost | *** | Sleep   |  584 |       | NULL                  |
| 282 | root | localhost | *** | Sleep   |    1 |       | NULL                  |
| 283 | root | localhost | *** | Sleep   |  544 |       | NULL                  |
+-----+------+-----------+-----+---------+------+-------+-----------------------+
12 rows in set (0.00 sec)

No new connections are being made and there's no lock, but somehow the requests are not being processed. Any idea what could be causing this?


Solution

In this context Sleep simply means that the thread is idle. Here's the definition from the manual:

  • Sleep

The thread is waiting for the client to send a new statement to it.



Answered By - Ike Walker
Answer Checked By - Timothy Miller (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing