Site is slow sometimes

I use wordpress for my site which is very slow and I always take database connection error. I use cache pluging for speed and use some plugins in my wp. This problem is general problem? But speed of site is very good simetimes. Why is site always speedly?