idleConnectionTimeout in Gremlin driver

时间:2019-04-17 02:47:16

标签: gremlin tinkerpop tinkerpop3 gremlin-server

I have an application running on my localhost (which the gremlin driver runs on), a gremlin server running on the remote host, and a load balancer in between.

I have setup the keepAliveInterval of the Gremlin driver to keep the connection between my localhost and the load balancer open, but somehow the connection still get dropped. (The timeout interval in the load balancer is larger than the keepAliveInterval I configured in Gremlin driver).

I checked the log and find out that after connection get dropped, the Gremlin driver is still sending keep alive message to the load balancer, but it didn't get any response and it couldn't detect it as well.

I'm wondering are there any ways I can find out the keep alive response isn't been received or are there some configurations I can do like the IdleConnectionTimeout in the Gremlin server to let the gremlin driver realize the keep alive request is not getting any response?

1 个答案:

答案 0 :(得分:0)

驱动程序的keep-alive过程并不十分健壮,因为它对于服务器端的keep-alive来说是一个冗余。驱动程序会吞下与发送自己的保持活动消息相关的异常,并且只会记录一条WARN消息,因此您必须在日志中查找该消息以确定是否失败。

我不确定是什么使您的环境进入负载平衡器失去连接的状态。服务器和驱动程序都可以共同维护连接。当驱动程序空闲时,它将在超过keepAliveInterval之后发送保持活动状态,这将为驱动程序和服务器重置空闲状态。在服务器上,读写空闲状​​态受到监视(分别由idleConnectionTimeoutkeepAliveInterval监视),并将向客户端发送保持活动状态。从“ ping”(服务器或客户端)的任一端应返回“ pong”。我想知道,如果“ ping”不是来自客户端,那么负载均衡器的状态是否会终止连接?