0

I use shared hosting and it's pretty good but semi-often the MYSQL server hangs - thereby hanging the entire site - the site just tries to load (different render in IE vs. Chrome (IE loads some HTML, chrome loads nothing and it's a whitepage).

I would like to be able to display a notification to the user if the page does not load within a certin time (say 7 seconds) saying - "we're having some issues, email us at blah blah" - consider it a "aww snap" script on load-time rather than a 404 or definitive error code.

Any ideas for existing resources?

A.

  • You should be able to set a timeout. The way to set it will vary based on the driver you are using. – chris85 Jul 12 '16 at 16:26
  • There most likely already is a timeout, you can just decrease it. Check out [this question](http://stackoverflow.com/questions/9629566/how-to-increase-apache-timeout-directive-in-htaccess), but decrease instead of increase. – Don't Panic Jul 12 '16 at 16:28
  • But I think you _should_ send a definitive error code, because there has been an error. – Don't Panic Jul 12 '16 at 16:30
  • You could also do this in your script by setting a [timeout on your connection object](http://stackoverflow.com/questions/21403082/setting-a-connect-timeout-with-pdo). – Don't Panic Jul 12 '16 at 16:33

0 Answers0