If you are getting that type of error, this is nothing you can do in terms of changing code that will help unless you stop using WordPress and move to a static site.
Your web host is limiting the amount of queries you can perform, WP has to connect to the database in order to work. If your host is cutting off access there is nothing you can do other than moving to a different host or upgrade your web hosting plan to handle more traffic.
I would contact your web host and see if they can diagnose what is causing you to hit your limit. It could be a plugin that is causing the issue or a theme setting.