Gremlin Query to count Edges - MemoryLimitExceededException AWS Neptune

0

Gremlin Query on Neptune to count no of edges for vertexes with certain label results in MemoryLimitExceededException. Error only occurs a few times i.e. if i run query 10 times, succeeds twice.

Neptune writer is setup with db.r5.xlarge.

Query

g.V().hasLabel('MyVertex').has('myLabel',1234).outE().hasLabel('MY_EDGE_LABEL').count().next()
There are over 3 million vertices with label MyVertex and 1 million edges matching MY_EDGE_LABEL edge label.

Error:

{
"code": "MemoryLimitExceededException",
"requestId": "123456-abcd-1234-1234-11aa221122ab",
"detailedMessage": "Query cannot be completed due to memory limitations."
}

My Questions:
Is there any setting like memory limit for a query on Neptune that can be increased?
Is there anything in the query that can be adjusted to get same result but consumes less memory.

Edited by: BaluVV on Mar 7, 2021 8:04 PM

Edited by: BaluVV on Mar 7, 2021 8:07 PM

Edited by: BaluVV on Mar 7, 2021 8:07 PM

BaluVV
質問済み 3年前1340ビュー
3回答
0

Hi,
is it possible to reach us via a ticket (TT). That way we have access to your instance and we can investigate deeper. For example it would be interesting to know what would be the size of the result approximately.

As an alternative for now I wonder if you can split the query in multiple steps, each of them retrieving a subset of the data.

Gremlin also has support for query profiling but this is only useful when query completes: https://docs.aws.amazon.com/neptune/latest/userguide/gremlin-profile-api.html

--Gabriel

回答済み 3年前
0

Adding limit(1) fixed it, not sure how though.

g.V().hasLabel('MyVertex').has('myLabel',1234).outE().hasLabel('MY_EDGE_LABEL').count().limit(1).next()

BaluVV
回答済み 3年前
0

Hi BaluVV,

Neptune engine for Gremlin processes solutions in chunks and specifying a limit(1) has the behavior of hinting the engine to process one solution at a time at each query step (node) instead of processing a chunk at a time. Setting a lower chunk size has a proportional effect on latency. You can observe the same indicated using "chunkSize" attribute in the query profile or explain output. If you need more assistance, please reach out through a support ticket.

Thanks.

AWS
回答済み 3年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ