Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cap concurrent requests to get Neptune schema #58

Merged

Conversation

danielfinke
Copy link
Contributor

Issue #, if available: #20

Description of changes:

Previously, for a graph with n nodes or edges, there would be n concurrent requests made to Neptune via queryNeptune. Depending on your instance class or VPC settings, you could hit errors such as MemoryLimitExceededException or connection limits/sockets abruptly closing, with increasing likelihood as the size of the graph increased. Initially observed abrupt socket closing just like #20.

Now, the concurrent request Promises are resolved in batches using mapAll. For now, the batch size is hardcoded to 20. For very small instance classes (e.g. from the "Development and testing" template), MemoryLimitExceededExceptions are still likely.

Further improvements could include:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Previously, for a graph with `n` nodes or edges, there would be `n`
concurrent requests made to Neptune via `queryNeptune`. Depending on
your instance class or VPC settings, you could hit errors such as
`MemoryLimitExceededException` or connection limits/sockets abruptly
closing, with increasing likelihood as the size of the graph increased.
Initially observed abrupt socket closing just like
aws#20.

Now, the concurrent request Promises are resolved in batches using
`mapAll`. For now, the batch size is hardcoded to 20. For very small
instance classes (e.g. from the "Development and testing" template),
`MemoryLimitExceededException`s are still likely.

Further improvements could include:
- relating the batch size to the instance class
- allowing the user to specify the batch size in the process args
- exponential/dynamic backoff on transient errors as indicated in
  https://docs.aws.amazon.com/neptune/latest/userguide/errors-engine-codes.html#errors-query
@andreachild
Copy link
Contributor

LGTM

Copy link
Contributor

@Cole-Greer Cole-Greer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution @danielfinke. LGTM

@Cole-Greer Cole-Greer merged commit 983c338 into aws:main Jan 24, 2025
2 checks passed
@danielfinke danielfinke deleted the cap-concurrent-requests-to-get-neptune-schema branch January 25, 2025 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants