0

I have a cakephp website hosted on hostgator shared server. I got an email from hostgator stating that a temporary block has been placed on the database and that the database associated with the script was found to be consuming an inordinate amount of processor time.

During the chat they told me to add some caching mechanism and that they do not have any specific recommendations for this script. The Cakephp already has its caching mechanism. Running processes showed "/home1/site/public_html/app/webroot/index.php" called again and again.

This is the third time it has happened. There is no traffic on the site. The database is optimized. I have changed the database to innoDB so as to avoid possibility of table lock last time but this has happened again.

Any help appreciated!

cartina
  • 1,409
  • 13
  • 21
  • Have you had a look at your SQL dump when loading your front page ? Maybe you have more requests than you think (find() calls with recursive > 0 for example). Robots crawling the site will trigger the index.php but will not show a visit on your site... – Chris Jul 26 '13 at 13:06
  • @chris yes I have aroud 140 sql queries on home page. Is that the reason? – cartina Jul 26 '13 at 13:12
  • @chris There are queries with recursive > 0. What should I do to resolve this issue? – cartina Jul 26 '13 at 13:20
  • 140 queries is nowhere near enough they should be blocking it. You likely have some kind of repeat-look that's getting stuck and running queries in it. – Dave Jul 26 '13 at 13:59
  • @Dave Thanks for the comments. I do not seem to have a repeat-loop. Any hint on how to go about finding the cause? – cartina Jul 29 '13 at 13:12
  • Using recursive > 0 should be avoided in most cases. It's better to have recursive set to -1 in your AppModel and use the Containable behavior in your find() operations. That will reduce the number of queries anyway, possibly solving your problem. – Chris Aug 26 '13 at 14:24

0 Answers0