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.
This PR introduces stability improvements for (very) large number of concurrent goroutines executing neo4j queries;
gobolt
now has two different connection implementations -workerConnection
s or the originalseaboltConnection
s. Original connections call seabolt functions directly on the executing goroutine, whereas worker connections are schedules calls in dedicated workers which are the only goroutines that call seabolt functions (and limiting the number of goroutines that are tied to native threads).The default connection implementation is changed to be worker connections and this behaviour can be changed through
BOLTWORKERS
environment variable (0
to revert to original mode,1
(default) to enable worker connections). Worker pool sizing can be controlled through the following environment variables;BOLTWORKERS
(default:1
): Whether to enable worker pool or use original implementation.BOLTWORKERSMIN
(default:0
): Number of workers to pre-start on construction.BOLTWORKERSMAX
(default:MaxPoolSize*1.2
): Number of workers to create at most. Requests will be blocked until a worker finishes its execution.BOLTWORKERSKEEPALIVE
(default:5m
): When a worker has been idle this many amount of time, it will be terminated.Expect an overhead in execution times due to seabolt calls' being scheduled on a worker and blocking the executing goroutine until worker completes the scheduled job. However, stability and throughput will improve when there are too many goroutines executing concurrent neo4j requests.