Database connection failed error

Database connection failed error

by Shakir Gill -
Number of replies: 4

We have set back up at 5am in the morning, when the back up initiates on our moodle page some users see the error "Database connection failed. it is possible that the database is overloaded or otherwise not running properly"

however, there is no issue with the back up, the back up is created. however, during that time if a user is on moodle they may get this error off and on.

please suggest how to solve this issue.


we are using Moodle 3.5 deployed on windows server 2012R2

database is mariadb

Average of ratings: -
In reply to Shakir Gill

Re: Database connection failed error

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I would check that your database isn't running out of connections. 

show processlist in the mysql client should do it (assuming you know what your limit is)
Average of ratings: Useful (1)
In reply to Howard Miller

Re: Database connection failed error

by Shakir Gill -

Hi Howard,


Thank you very much for your kind reply. 

At 5am, when db backup initiates we get maximum of 20 concurrent users. This is the only time we get the error, that is when we are running back up. we get upto 2000 concurrent users during the day, however, back up is not running at that time and we do not get this error. 

I may be missing something can you kindly guide 


Thank you so much

In reply to Shakir Gill

Re: Database connection failed error

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I'm not talking about users. I'm talking about database connections. You can't guess... you have to go and "ask" the database.

Ideally, you should be monitoring your server. I know nothing about Windows but there should be software that plots all sorts of server parameters over time. These things are incredibly useful for this sort of problem.
In reply to Shakir Gill

Re: Database connection failed error

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

Apparently the db backup blocks the site. Could you give more details of this db backup process? Is it just the program mysqldump running, or do you use other (graphical) programs? Which ones? How are they programmed to run at 5 am? The Windows OS is an obstacle for me, since I never use it. But those details will help people knowledgeable in Windows to understand the problem.

Also it is important to know whether the machine hits some limit at 5 am. For that you need to run a monitoring program which records critical parameters like CPU load, memory usage, I/O wait times, ... for you to analyze later. This is what Howard is talking about. But again OS dependent, so can't tell you how exactly to do it on Windows.