Repository navigation
Add Neo4j max_connection_pool_size and connection_acquisition_timeout in sample_config files - #958
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances Neo4j connection pool configuration by exposing max_connection_pool_size and connection_acquisition_timeout parameters, allowing users to tune connection pool behavior under high concurrent load similar to existing Postgres configuration options.
Changes:
- Added two new optional fields to
Neo4jConffor controlling connection pool size and acquisition timeout - Modified
async_get_neo4j_driverto conditionally pass these parameters to the Neo4j driver - Updated sample configuration files to include the new parameters with their default values
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/memmachine/common/configuration/database_conf.py | Added max_connection_pool_size and connection_acquisition_timeout fields to Neo4jConf class |
| src/memmachine/common/resource_manager/database_manager.py | Refactored driver initialization to conditionally include new configuration parameters |
| sample_configs/episodic_memory_config.gpu.sample | Added example configuration values for the new Neo4j pool parameters |
| sample_configs/episodic_memory_config.cpu.sample | Added example configuration values for the new Neo4j pool parameters |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jgong
approved these changes
Jan 16, 2026
… in sample_config files Signed-off-by: Steve Scargall <[email protected]>
jealous
approved these changes
Jan 16, 2026
o-love
pushed a commit
that referenced
this pull request
Jan 23, 2026
… in sample_config files (#958) Signed-off-by: Steve Scargall <[email protected]>
SarahScargall
pushed a commit
to SarahScargall/MemMachine
that referenced
this pull request
Jan 29, 2026
… in sample_config files (MemMachine#958) Signed-off-by: Steve Scargall <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose of the change
This is part of the ongoing performance improvements. This PR exposes Neo4j
max_connection_pool_sizeandconnection_acquisition_timeoutby adding them to the database_manager and sample config files. Users can tune the Neo4j connection pool size and timeout as we did for Postgres.Description
max_connection_pool_sizecontrols how many simultaneous connections the driver can keep open to a single Neo4j server (or per cluster member, depending on the driver). It should be increased when you see connection-acquisition timeouts under high concurrent load, and your Neo4j server and network have capacity for more connections, and decreased when the database is over-subscribed, or you want to limit its resource usage.connection_acquisition_timeoutcontrols how long a query waits for a free connection from the pool before failing with a client-side timeout error, and it only applies when the pool is already at its configured maximum size. It should be increased if you see sporadic timeouts during brief load spikes but do not want to grow the pool further, decreased (or set to fail fast) when you prefer immediate errors over waiting, or set to unlimited if you want the client to block until a connection is free.Fixes/Closes
Relates to #940
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.
Using this client connection script, and executing it in the project root, where the
configuration.ymlis:With no properties in
configuration.yml, I get--- Neo4j Driver Configuration for [my_storage_id] --- Max Connection Pool Size: 100 Connection Acquisition Timeout: 30.0sWhen I add the properties and set them to non-default values, then re-run the script above, I get the expected output
--- Neo4j Driver Configuration for [my_storage_id] --- Max Connection Pool Size: 200 Connection Acquisition Timeout: 120.0sChecklist
Maintainer Checklist
Screenshots/Gifs
N/A
Further comments
We will test and validate this PR using load-test scripts before merging to confirm that the issue reported in #940 is resolved.