neo4j/gremlin-plugin — Issue #9: Change to the ScriptCountingEngineReplacementDecision or make it configurable
Author: espeed
Created: 2012-03-07 14:00:09+00:00
State: open

As per https://groups.google.com/d/msg/neo4j/YeaT5LOMCdk/qnS1yhtKX1gJ ...

There are two versions of the EngineReplacementDecision:

https://github.com/neo4j/gremlin-plugin/tree/master/src/main/java/org/neo4j/server/plugin/gremlin

CountingEngineReplacementDecision restarts the engine after every X rquests:
https://github.com/neo4j/gremlin-plugin/blob/master/src/main/java/org/neo4j/server/plugin/gremlin/CountingEngineReplacementDecision.java

ScriptCountingEngineReplacementDecision restarts when the number of scripts in the cache grows to X:
https://github.com/neo4j/gremlin-plugin/blob/master/src/main/java/org/neo4j/server/plugin/gremlin/ScriptCountingEngineReplacementDecision.java

The plugin is currently using the CountingEngineReplacementDecision and restarting it after every 500 requests:
https://github.com/neo4j/gremlin-plugin/blob/master/src/main/java/org/neo4j/server/plugin/gremlin/GremlinPlugin.java#L61

It looks like it would be simple to switch to ScriptCounting and so if Heroku users only use a few unique scripts, then it won't restart unless the actual server restarts.

Change to the ScriptCountingEngineReplacementDecision so that it's the default or make it configurable in Heroku.