0

I have found some good articles about optimizing queries on Gremlin, but I still don't know how to get the memory consumption and time of execution of a query.

Some places that I found talking about query optimization: https://github.com/tinkerpop/gremlin/wiki/Traversal-Optimization https://academy.datastax.com/content/dse-gremlin-queries-good-better-best https://medium.com/@jayanta.mondal/analyzing-and-improving-the-performance-azure-cosmos-db-gremlin-queries-7f68bbbac2c

Thiago Mata
  • 2,825
  • 33
  • 32
  • Adding a .profile() at the end of the query shows the time and the count but not the memory consumption. Since my current problem is related to memory, I would like to know the memory consumption. – Thiago Mata Aug 16 '19 at 07:38

1 Answers1

0

This link

https://github.com/tinkerpop/gremlin/wiki/Traversal-Optimization

explicitly states that it refers to "an outdated version of the TinkerPop framework and Gremlin language documentation" - please ignore that...it is for TinkerPop 2.x.

That said, the profile() step is the best that Gremlin directly offers and it can tel you a lot about query execution as you can identify which steps are running slowest and if you are seeing the expected number of traversers at specific parts of your query.

If you need memory consumption information you will either need to use tools specific to the graph database that you are using to get that information (if they offer such things) or you will need to use standard profiling tools like Java Flight Recorder, VisualVM, etc.

stephen mallette
  • 45,298
  • 5
  • 67
  • 135
  • My current problem is related to make the optimisation on the AWS Neptune. So far I could see, they don't provide enough metrics to monitor the memory consumption of one particular query. – Thiago Mata Sep 06 '19 at 01:29
  • what tells you that your problem is memory consumption if Neptune doesn't give you enough metrics on memory consumption? or are you saying it gives you some information but not enough? – stephen mallette Sep 06 '19 at 10:14
  • MemoryLimitExceededException, code: 500, description: "The request processing did not succeed due to lack of memory, but can be retried when the server is less busy." https://docs.aws.amazon.com/neptune/latest/userguide/errors-engine-codes.html – Thiago Mata Sep 09 '19 at 00:46
  • Interesting - I wasn't aware that Neptune threw an error like that. You still should be able to get some hints on where you're query is using the most memory by using `profile()`. Steps with the highest traverser counts might put you on the right track to solving the problem. – stephen mallette Sep 09 '19 at 10:23