Would anyone be interested in connection pooling? If I'm understanding the Neo class correctly, each time Neo.db is called it creates a new connection. I've got connection pooling working in my branch, should I send a pull request?
I'm not sure if using a global is a good idea in this case, but it got me loading data much faster last night. Before I made this change my sidekiq workers were loading about 20 nodes per second(one node per job), right now they are loading about 100.
Maybe instead of checking if a global named $db is defined I could check if any instances of the ConnectionPool class exist?
Would anyone be interested in connection pooling? If I'm understanding the Neo class correctly, each time Neo.db is called it creates a new connection. I've got connection pooling working in my branch, should I send a pull request?
https://github.com/chrisgogreen/active_node
I added some readme to my branch for using the connection pool. I wrapped
@db
in an if else to check for a globally defined db connection.If you define
$db
when your application initializes you can use a configurable connection pool:I'm not sure if using a global is a good idea in this case, but it got me loading data much faster last night. Before I made this change my sidekiq workers were loading about 20 nodes per second(one node per job), right now they are loading about 100.
Maybe instead of checking if a global named $db is defined I could check if any instances of the ConnectionPool class exist?