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

feat(ihe): stream responses to response endpoints + epic bigger doc r… #2306

Merged
merged 6 commits into from
Jun 21, 2024

Conversation

jonahkaye
Copy link
Member

@jonahkaye jonahkaye commented Jun 19, 2024

Refs: #1667

Downstream

Description

  • stream responses back to api
  • increase number of doc refs to send for epic from 5 to 10 per DR

Testing

  • Local
    • unit tests
  • Staging
    • staging

Release Plan

  • Merge this

@jonahkaye jonahkaye self-assigned this Jun 19, 2024
@@ -17,7 +17,7 @@ dayjs.extend(duration);
const SLEEP_IN_BETWEEN_DOCUMENT_RETRIEVAL_REQUESTS = dayjs.duration({ seconds: 1 });
const MAX_GATEWAYS_BEFORE_CHUNK = 1000;
const MAX_DOCUMENT_QUERY_REQUESTS_PER_INVOCATION = 20;
const MAX_DOCUMENT_RETRIEVAL_REQUESTS_PER_INVOCATION = 20;
const MAX_DOCUMENT_RETRIEVAL_REQUESTS_PER_INVOCATION = 10;
Copy link
Member Author

Choose a reason for hiding this comment

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

we are upping docRefs per req from 5-10 (only for epic but thats 98% of our docs so lets just treat it like that for everything) so to make sure we stay under the lambda payload size limit lets half the number of gateways per request.

Copy link
Contributor

Choose a reason for hiding this comment

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

Might make sense to ultimately flatten this logic so that there's a single request count per lambda invocation.

Copy link
Member

Choose a reason for hiding this comment

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

I think this would be especially good for DR, yeah.

I see the benefit of grouping a bunch of XCPDs in a single lambda request (no much memory/timeout issue), but to download a file, a single lambda invocation seem to make sense.

Copy link
Member Author

Choose a reason for hiding this comment

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

ok I think this concern needs more consideration and is beyond the scope of the PR. There are a bunch of other considerations to take into account:

  1. cost
  2. concurrency limits
  3. complete reworking of querrying architecture to be queue based

Copy link
Member

@leite08 leite08 Jun 20, 2024

Choose a reason for hiding this comment

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

Moving DRs to individual ones has nothing to do with (3) and (2).

For (2), we have 1,000 concurrent lambda executions and we can ask to increase this limit to 10's of 1,000 (source).

For (3), there's no requirement to add queues in order to break them down.

For. (1)/cost, this might impact, but it would make each single invocation shorter - and lambdas are cheap, it doesn't even make it to the top 10 costs we have.

Not saying we have to do it here, just addressing the justifications.

Refs: #1667
Signed-off-by: Jonah Kaye <[email protected]>
Refs: #1667
Signed-off-by: Jonah Kaye <[email protected]>
Refs: #1667
Signed-off-by: Jonah Kaye <[email protected]>
@jonahkaye jonahkaye marked this pull request as ready for review June 20, 2024 16:57
@@ -16,4 +16,4 @@ export const namespaces = {
xsiType: "xsd:string",
};

export const expiresIn = 5;
export const expiresIn = 20;
Copy link
Member Author

Choose a reason for hiding this comment

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

need saml timestamp to last longer!
5 mins too short if we are doing retries with the same request

@@ -17,7 +17,7 @@ dayjs.extend(duration);
const SLEEP_IN_BETWEEN_DOCUMENT_RETRIEVAL_REQUESTS = dayjs.duration({ seconds: 1 });
const MAX_GATEWAYS_BEFORE_CHUNK = 1000;
const MAX_DOCUMENT_QUERY_REQUESTS_PER_INVOCATION = 20;
const MAX_DOCUMENT_RETRIEVAL_REQUESTS_PER_INVOCATION = 20;
const MAX_DOCUMENT_RETRIEVAL_REQUESTS_PER_INVOCATION = 10;
Copy link
Contributor

Choose a reason for hiding this comment

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

Might make sense to ultimately flatten this logic so that there's a single request count per lambda invocation.

@@ -17,7 +17,7 @@ dayjs.extend(duration);
const SLEEP_IN_BETWEEN_DOCUMENT_RETRIEVAL_REQUESTS = dayjs.duration({ seconds: 1 });
const MAX_GATEWAYS_BEFORE_CHUNK = 1000;
const MAX_DOCUMENT_QUERY_REQUESTS_PER_INVOCATION = 20;
const MAX_DOCUMENT_RETRIEVAL_REQUESTS_PER_INVOCATION = 20;
const MAX_DOCUMENT_RETRIEVAL_REQUESTS_PER_INVOCATION = 10;
Copy link
Member

Choose a reason for hiding this comment

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

I think this would be especially good for DR, yeah.

I see the benefit of grouping a bunch of XCPDs in a single lambda request (no much memory/timeout issue), but to download a file, a single lambda invocation seem to make sense.

Copy link
Member

@leite08 leite08 left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

It'd be good to keep the convo about single lambda invocation for DR somewhere else (it would be bad to lose a large XML file w/ lots of resources b/c the lambda ran out of memory from downloading multiple files in a single invocation.

@jonahkaye jonahkaye added this pull request to the merge queue Jun 21, 2024
Merged via the queue into develop with commit 3ed64a6 Jun 21, 2024
13 checks passed
@jonahkaye jonahkaye deleted the 1667-stream-flow-epic-larger-chunks branch June 21, 2024 00:50
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.

None yet

3 participants