Hostgator keeps crashing my server when i use piwik

every few months Ill try to access piwik and then it will make my server crash. The sites will say “Error establishing database connection”. Then i need to contact hostgator and tell them its not working and then they fix it but I never know what they do.

Everytime that happens I lose money because i lose traffic. Whats wrong?

HG has really low resource limits on their shared hosting accounts (eg 8M memory limit).

Next time ask if they know the cause. We can try to mitigate.

what kind of upgrade should i ask for if i want this to never happen again?

would it be expensive?

It would depend on why the server is unable to establish a database connection. If you’re on a shared hosting server, then the maximum number of concurrent mysql connections is going to be shared by all the websites hosted on that box, and their visitors. The quick fix is to increase the maximum limit (which would have to be done by the HG sysadmins).

To help with Piwik’s scalability, I believe there’s a plan to log to an intermediate file, and then (periodically or on demand?) bulk load those into the database. This would probably also help in your case.