-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parent/Child AJAX generates too many DB connections #145
Comments
I feel like someone made an attempt to fix this issue previously. I remember someone making changes to the number of mysql connections that were being opened. Perhaps that was a different module that was changed? |
I think the main problem is that a connection is opened for every object instantiated. More than the resources/resource.php page, it's the way we use Objects and database connections that needs to be changed imho. |
I did a small patch that turns the DBService class into a singleton, for the connection to be reused. If you want to try it to see if it improves performances, it's here: biblibre@18d0172 On my instance, it reduces the processing time for a resource with 3000 children from 5+ seconds to roughly 2 seconds. |
(Moreover, this patch would allow to momentarily change database, allowing us to use objects from other modules, instead of writing SQL statements to gather informations from other modules) |
I'm tagging this issue for 2.1.0 beta milestone. I think we should seriously try to get it in then. I suspect many longterm CORAL users have already changed their |
The following report comes from Josh Myles:
No luck with persistent database connections since I believe the code
is explicitly opening and closing connections. I tried prepending the
database server host name with "p:" in all configuration.ini files.
I ended up raising the MySQL connection limit (max_connections=10000)
as well as ulimits for the HTTPd user (nofile nproc both to 10000) and
the large resources loaded.
/resources/resource.php just needs to be refactored. The issue is just
a side effect of the AJAX way in which the page is built. It doesn't
scale for large resources.
The resource we've been testing has 1384 children, which results in
2785 database connections being opened when resource.php is loaded.
The text was updated successfully, but these errors were encountered: