OJS on shared server

Our OJS is hosted on a shared server. Many connections are in sleep and leaves the connection open, so it drains resources.

Is it possible to close the connections at the end of the query or when it expires after a certain time?

Any suggestion to fix this will be highly welcome

If you’re using apache you need to look smth like this


The MaxKeepAliveRequests directive limits the number of requests allowed per connection when KeepAlive is on. If it is set to “0”, unlimited requests will be allowed. We recommend that this setting be kept to a high value for maximum server performance. In Apache 1.1, this is controlled through an option to the KeepAlive directive.

Hi @peppermit,

What version of OJS are you using? (Please include this with your posts.)

Are you seeing open connections to the web server, or the database? If it’s the database, check and ensure that the persistent setting in config.inc.php is turned to Off.

Alec Smecher
Public Knowledge Project Team

Thanks Alec for your prompt and kind response.
We are running an old version (ojs-2_4_8-0). Attempts to update have somehow resulted in a significant loss of published information, so we have decided to keep what we have before a new attempt to upgrade.
Regarding your suggestion, in fact:
; Enable persistent connections
persistent = Off

Thanks again

Thanks redurk,
Let me have a look

I still have not been able to resolve the issue.
How can I temporarily deactivate the OJS DB in MyQSL?
Thanks in advance

Any help on this issue?


Hi @peppermit,

To stop OJS from opening connections, you’ll need to disable it completely. I’d recommend temporarily putting a different index.php file in place of the one in the installation directory.

Note that it’s not normal for OJS to leave connections open, and OJS 2.4.8 is a very mature application with a lot of use on shared servers, so there is something unusual about your situation. Maybe you have locked tables/rows blocking subsequent connections or something similar. This is something you’d probably have to investigate in MySQL.

Alec Smecher
Public Knowledge Project Team

Thanks Alec, I will follow your advice until I verify what the problem is.