Cong Sun
unread,Sep 11, 2015, 1:11:18 AM9/11/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pacer-users
We are trying to do a multithread graph traversal by using a connection pool. Currently, each thread has a new connection and we are having trouble closing the connection and reuse it after the thread is done. The number of connections therefore reaches to the maximum capacity in a very short time.
What we are using is a orient_factory pool; we get a new connection by calling pool.get and get the corresponding graph object by calling graph=Pacer.orient(pool.get). After the use, we try to reuse the graph object by calling pool.surrender(graph). However, the number of connections to my orientdb does not seem to reduce (it just keeps growing as we call more pool.get). We are not quite understanding how graph objects and connections are being reused in the pool.
Our guess is that we are not using the connection pool in a correct way. We also tried to kill the connection right away once the thread is done but it seems very inefficient and makes the pool seem meaningless. Additionally, the kill does not always work either :(
What we want to achieve is that we establish certain number of connections at the beginning in the pool. When a request comes, a connection is then assigned to the thread to do the graph traversal. If too many requests come at the same time, the requests that are not being able to be serviced can be placed in a queue to be further serviced.
I wonder if anybody can provide some help on how to do the multithread graph traversal correctly.
Thanks much!
Cong Sun