FormaLMS Database Connection Issue
FormaLMS Database Connection Issue
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.
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.
Re: FormaLMS Database Connection Issue
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.
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
Re: FormaLMS Database Connection Issue
Thanks for the suggestion, alfa24, Just curious—why do you recommend a shared host over a virtual host? Also, we're currently using Forma LMS 4.0.1 (Community Edition).
Re: FormaLMS Database Connection Issue
Hello, actually alfa24 said the opposite: he recommends a dedicated vhost and not a shared one.
---------------------
Massimiliano Ferrari
Elearnit - Elearning e Knowledge Management
https://www.elearnit.net
https://www.linkedin.com/in/massimilianoferrari
m.ferrari[at]elearnit.net
Skype: m_ferrari_it
Massimiliano Ferrari
Elearnit - Elearning e Knowledge Management
https://www.elearnit.net
https://www.linkedin.com/in/massimilianoferrari
m.ferrari[at]elearnit.net
Skype: m_ferrari_it
Re: FormaLMS Database Connection Issue
Sorry for missing that earlier, and thanks, Max, for pointing it out! Let me ask again—why would you recommend a virtual host over a shared one? Also, is there any way to fix the issue I mentioned while still using shared hosting?
Re: FormaLMS Database Connection Issue
I provided a possible fix.
Regarding why a dedicated (virtual or physical, is not the point) is better than a shared, it's not a forma related question: 1vhost -> 1app, this means no shared configs (yes, you can achieve that with containers), that is exactly your prolbem
Regarding why a dedicated (virtual or physical, is not the point) is better than a shared, it's not a forma related question: 1vhost -> 1app, this means no shared configs (yes, you can achieve that with containers), that is exactly your prolbem
Per supporto GRATUITO contattatemi in privato qui