moodle database overloaded error

moodle database overloaded error

by Mahendra Kumar -
Number of replies: 2

What is reason of below error and how we can resolve it? Any solution? 

"Error: Database connection failed.
It is possible that the database is overloaded or otherwise not running properly.
The site administrator should also check that the database details have been correctly specified in config.php."


This error is coming when around 25 to 60 or more student participating in online test on moodle website. Please anybody can suggest any quick solution. 



Attachment error.jpg
Average of ratings: -
In reply to Mahendra Kumar

Re: moodle database overloaded error

by Ken Task -
Picture of Particularly helpful Moodlers

In the error, probably the first suggestion ... DB is overloaded.

The quiz is the most intensive module when it comes to hits on DB server.

Check your apache (assuming apache as you have not shared that info) error logs for things like 'Server has gone away' or other clues.

Suggest at least one setting probably need bumping upwards in the config file for the DB server.

max_connections ...

https://dev.mysql.com/doc/refman/5.7/en/too-many-connections.html

Default is 150 and probably needs to be a higher number.

If you can, install mysltuner

https://www.google.com/search?q=mysqltuner

and run it.   It will provide suggestions for database config tweaks.

'spirit of sharing', Ken


In reply to Mahendra Kumar

Re: moodle database overloaded error

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Hi Mahendra, this is, unfortunately, a generic message produced by the Moodle error trapping code for the database. For more specific information, you might want to go and look at the PHP logs. 

The question I am now asking here is is what is your installation? Is it a LAMP, a MAMP, a WAMP, a WIMP, a XAMPP? Is it a MoodleCloud free site? you haven't included any information about what your site is. Could it be a Drupoodle? A Joomdle? Perhaps an Amazoodle? a GoDaddy? Shared or self hosted? All this is important for us to help you narrow it all down. 

EDIT(after Ken's reply): Always look at the error logs first, see what information you can get from them. If you don't have access to them, if hosted, your host won't always let you have access, but they will inform you of errors around your site, if you ask nicely.