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?
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.