Very slow performance when opening a new session


Roy Reznik <reznik.roy@...>
 

I'm seeing very slow performance when opening a new session in JanusGraph.
The message I'm sending is this:
{"requestId":"02a58ee3-e4d3-11eb-bd29-04d4c4eaf347","op":"eval","processor":"session","args":{"bindings":{},"evaluationTimeout":120000,"gremlin":"g.V().limit(1).id()","language":"gremlin-groovy","rebindings":{},"session":"50052633-079b-4500-bc29-a3eacb1f0dba"}}

Basically, the inner query doesn't really matter. When I use the session processor with a new session id that's never been used it takes ~1.2s for JanusGraph to respond.
Queries afterwards, with the same session id are much quicker.
Why is the overhead of starting a new session so large? Can it be reduced somehow by configuration?

Thanks,
Roy.


hadoopmarc@...
 

Hi Roy,

I can confirm your observation using the standard 'bin/janusgraph.sh start' from the full janusgraph distribution.
I just used the the gremlin console with:

:remote connect tinkerpop.server conf/remote.yaml session
:remote console
a = 3

Although there is no logical reason for it in hindsight, I checked whether the delay was not due to class loading in gremlin console, using:
export JAVA_OPTIONS='-verbose:class'

I can also confirm that the delay does not happen with a non-sessioned connection.
I can also confirm that the delay occurs for the gremlin server and gremlin console of the Apache TinkerPop distribution (version 3.4.8).

I guess the initial delay is due to the additional overhead of sessions as described in:
https://tinkerpop.apache.org/docs/current/reference/#sessions

Best wishes,     Marc