我有一些django应用程序正在杀死我的mysql服务器 有些查询正在运行,没有超时并堵塞我的mysql服务器
如何以正确的方式解决此问题需要帮助 不确定这是django的设计方式,还是我需要添加超时设置 我认为django默认情况下应该这样做,不确定因为没有超时
没有意义以下是未超时或关闭的查询
MySQL on localhost (5.7.19) load 5.27 4.81 4.69 4/2383 41852 up 0+00:18:41 [19:13:16]
Queries: 8.6k qps: 8 Slow: 0.0 Se/In/Up/De(%): 61/01/02/00
Sorts: 0 qps now: 5 Slow qps: 0.0 Threads: 99 ( 99/ 1) 44/00/00/00
Key Efficiency: 98.9% Bps in/out: 839.8/22.3k Now in/out: 566.3/22.5k
Id User Host/IP DB Time Cmd State Query
-- ---- ------- -- ---- --- ----- ----------
6 webapp_user localhost webapp_db 1096 Query Sending SELECT COUNT(*) FROM `django_session` WHERE `django_session`.`last_login` >= '2017-09-19 18:44:56'
9 webapp_user localhost webapp_db 1086 Query Sending SELECT COUNT(*) FROM `django_session` WHERE `django_session`.`last_login` >= '2017-09-19 18:45:09'
11 webapp_user localhost webapp_db 1085 Query Sending SELECT COUNT(*) FROM `django_session` WHERE `django_session`.`last_login` >= '2017-09-19 18:45:10'
15 webapp_user localhost webapp_db 1067 Query Sending SELECT COUNT(*) FROM `django_session` WHERE `django_session`.`last_login` >= '2017-09-19 18:45:28'
16 webapp_user localhost webapp_db 1056 Query Sending SELECT COUNT(*) FROM `django_session` WHERE `django_session`.`last_login` >= '2017-09-19 18:45:39'
20 webapp_user localhost webapp_db 1053 Query Sending SELECT COUNT(*) FROM `django_session` WHERE `django_session`.`last_login` >= '2017-09-19 18:45:42'
25 webapp_user localhost webapp_db 1037 Query Sending SELECT COUNT(*) FROM `django_session` WHERE `django_session`.`last_login` >= '2017-09-19 18:45:58'
28 webapp_user localhost webapp_db 1025 Query Sending SELECT COUNT(*) FROM `django_session` WHERE `django_session`.`last_login` >= '2017-09-19 18:46:11'
29 webapp_user localhost webapp_db 1022 Query Sending SELECT COUNT(*) FROM `django_session` WHERE `django_session`.`last_login` >= '2017-09-19 18:46:14'
32 webapp_user localhost webapp_db 1006 Query Sending SELECT COUNT(*) FROM `django_session` WHERE `django_session`.`last_login` >= '2017-09-19 18:46:29'
35 webapp_user localhost webapp_db 994 Query Sending SELECT COUNT(*) FROM `django_session` WHERE `django_session`.`last_login` >= '2017-09-19 18:46:42'
36 webapp_user localhost webapp_db 990 Query Sending SELECT COUNT(*) FROM `django_session` WHERE `django_session`.`last_login` >= '2017-09-19 18:46:45'
这只是我目前所拥有的副本,这些查询一直运行很长时间,直到我重新启动mysql服务器并且它们再次启动并继续运行,最终它们阻塞了服务器上的cpu和i / o / p>
我该怎么做才能解决这个问题?
由于