TraversalOpProcessor Cache
I have following log in my gremlin server -
INFO org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor - Initialized cache for TraversalOpProcessor with size 1000 and expiration time of 600000 ms
I can understand expiration time is in millisecond.
Can some one help me understand how size "1000" is quantified ? (kb/mb)
7 Replies
What version of TinkerPop are you using?
INFO org.apache.tinkerpop.gremlin.server.GremlinServer - 3.4.6
Note that this cache was removed in 3.5.x and is no longer relevant in later versions. https://tinkerpop.apache.org/docs/current/upgrade/#_graph_driver_providers that said, i think that number just refers to the number of entries possible in the cache so they could have been of any size in bytes. in any event, it was not a useful cache really because side-effects are rarely used in Gremlin. you typically just use the result and if you need a side-effect you would just
cap()
it out into the result. given that recommended approach, it seemed best to just remove that functionality.Ok got it. Is there a cache present to improve performance for repeated fired query ?
for bytecode, no. only for scripts because of the cost of Groovy compilation.
When we say script here - we are stating about - "org.apache.tinkerpop.gremlin.groovy.jsr223.GroovyCompilerGremlinPlugin: {classMapCacheSpecification: "initialCapacity=1000,maximumSize=10000"} " ?
and 1000 and 10000 are quantified as ?
Is above plugin supported for 3.4.6 ?
One more question - I have a remote gremlin setup. From my java application when I query the gremlin server, in first query returns me response in 60 sec. If execute same query within 30 sec I get response within 10 sec. But if I send query after 30sec-1min I get response again in 60 sec. Any clue why so ?
the
classMapCacheSpecification
are all settings from Caffeine: https://github.com/ben-manes/caffeine/wiki/Specification and i think they refer to count of items in the cache. it appears that the configuration is available there in 3.4.6 - https://github.com/apache/tinkerpop/blob/3.4.6/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyCompilerGremlinPlugin.java
as for your question on the query times, i'm not sure why you would get that sort of behavior. maybe it has something to do with the graph database you are using. you're also using a really old version of TinkerPop, so it's hard to remember what behaviors were back then as so many changes have dropped in over the last 4 years. is there any reason you're using such an old version?