Skip to content

Improve memory usage with streaming of AWS requests#10

Merged
rtyley merged 1 commit into
mainfrom
use-updated-aws-sdk-that-streams-requests
Dec 9, 2021
Merged

Improve memory usage with streaming of AWS requests#10
rtyley merged 1 commit into
mainfrom
use-updated-aws-sdk-that-streams-requests

Conversation

@rtyley

@rtyley rtyley commented Dec 8, 2021

Copy link
Copy Markdown
Member

AWS SDK v2.17.97 includes aws/aws-sdk-java-v2#2848, which lowers memory consumption by streaming request data, rather than loading the entire request into memory before sending it, which can make a large difference to consumption of memory when uploading large files to S3.

In the case of the geoip-db-refresher, it's actually economical to run with more RAM than we need (we're billed for fewer GB-seconds when specifying a MemorySize of 1536MB than 1024MB, as AWS Lambdas are given more CPU to match increased memory) so this is no longer a serious issue for the 134MB file uploaded here!

See also:

AWS SDK v2.17.97 includes aws/aws-sdk-java-v2#2848,
which lowers memory consumption by streaming request data, rather than
loading the entire request into memory before sending it, which can make
a large difference to consumption of memory when uploading large files
to S3.

In the case of the `geoip-db-refresher`, it's actually economical to
run with _more_ RAM than we need (we're billed for fewer GB-seconds
when specifying a `MemorySize` of 1536MB than 1024MB, as AWS Lambdas
are given more CPU to match increased memory) so this is no longer a
serious issue for the 134MB file uploaded here!

See also:

* #7
* #8
* 1de50ef
* https://aws.amazon.com/lambda/pricing/
* https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-memory-console
@rtyley rtyley merged commit b79ce25 into main Dec 9, 2021
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.

1 participant