benholness Posted July 2, 2009 Share Posted July 2, 2009 Hi, I have a website that occasionally gets stuck when particular queries are run. The queries are big, selecting and left joining over 30 million plus rows of data and sometimes take 60-120 seconds to run. The system comprises of four satellite servers replicating one master db. I would like to be able to detect a long query while it is happening, so that any queries made while that one is running are redirected to one of the satellite servers. Are there any known methods of achieving this, or will I need to (for example) write to a file the timestamp and details of all queries running to determine if a long query is in progress? Cheers, Ben Link to comment https://forums.phpfreaks.com/topic/164558-detecting-a-long-mysql-query/ Share on other sites More sharing options...
benholness Posted July 2, 2009 Author Share Posted July 2, 2009 Oh forgot to say - MySQL 5.0.45, PHP 5.1.6 Link to comment https://forums.phpfreaks.com/topic/164558-detecting-a-long-mysql-query/#findComment-867977 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.