FormaLMS Database Connection Issue

Backend functionalities: user management, course management, reports, certificates, etc.
Post Reply
gudiya
Newbie
Posts: 1
Joined: Mon Mar 03, 2025 11:57 am

FormaLMS Database Connection Issue

Post by gudiya »

Hey,

We are a team of three working on FormaLMS and have been configuring it to meet our requirements. Recently, we encountered a database error stating "max_connections_per_hour exceeded" (currently set to 500).

Since we cannot modify this resource limit as it may affect other employees' work, we are looking for a solution within the FormaLMS codebase itself. Could you please guide us on how to resolve this issue? Additionally, let us know which code files we should check to address this problem.

Below is the attached screenshot with its stack trace. Please let me know if it helps.

P.S. We have already verified that database connections are being properly closed.
alfa24
Senior Boarder
Posts: 2208
Joined: Fri Nov 24, 2017 8:45 am

Re: FormaLMS Database Connection Issue

Post by alfa24 »

Hi,
I strongly encourage to host your forma instance in a dedicated vhost, not a shared one.
Anyway, you could try to alter the variable at runtime if your configuration allows such a thing.
To do that, based on your forma version, you could try to call the setting as follows:

sql_query("SET GLOBAL max_connections_per_hour = x");

where x is the wanted number.

Where to add the code?
Well, as I wrote above, it depends on your forma version, but generally it should be done at bootstrap.
Per supporto GRATUITO contattatemi in privato qui
Post Reply