Database connections
This topic describes how to configure the number of database connections and how to shut down connections to an instance.
Connection limits
The Gremlin client and server interact through a thread pool. By default, connections support a maximum of 32 concurrent operations. If you require more than 32 concurrent operations, you can modify the connectionPool configuration in the file that Gremlin uses to connect to Graph Database (GDB), such as remote-objects.yaml. In the connectionPool configuration, set this value to 512 or less.
connectionPool: {
maxSize: 8,
maxInProcessPerConnection: 4
}Shut down a Graph Database connection
Graph Database (GDB) performs a keepalive probe on your instance connectivity about every 300 seconds. This probe retains active connections and closes inactive ones to improve the interactive experience. Therefore, shut down the connection to your GDB instance when you no longer need to access it.
# Query the list
gremlin> :remote list
==>0 - Gremlin Server - [localhost/127.0.0.1:3002]
==>1 - Gremlin Server - [localhost/127.0.0.1:3002]
==>*2 - Gremlin Server - [localhost/127.0.0.1:3002]
# Shut down connection pool 2
gremlin> :remote close 2
==>Removed - Gremlin Server - [localhost/127.0.0.1:3002]
gremlin> :remote list
==>*0 - Gremlin Server - [localhost/127.0.0.1:3002]
==>1 - Gremlin Server - [localhost/127.0.0.1:3002]