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: add a configuration for lambda #708

Merged
merged 2 commits into from
Aug 11, 2023
Merged

feat: add a configuration for lambda #708

merged 2 commits into from
Aug 11, 2023

Conversation

nand4011
Copy link
Contributor

@nand4011 nand4011 commented Aug 9, 2023

Make the number of data clients a cache client creates configurable. 6 is likely too many for lambdas as the extra latency for the first 6 calls isn't worth it in a short-lived environment.

Create a new configuration, InRegion.Lambda, for use inside lambdas. It only creates 1 data client instead of 6.

static v1(
loggerFactory: MomentoLoggerFactory = defaultLoggerFactory
): CacheConfiguration {
const deadlineMillis = 1100;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I copied the InRegionDefault here. Should we use this timeout or the low latency timeout?

Copy link
Contributor

Choose a reason for hiding this comment

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

definitely not LowLatency. If we were going to change it from InRegion.Default I think it would be to increase it, not decrease it, but my gut is to go with the same value we use for InRegion.Default.

@eaddingtonwhite lmk if you have any super strong opinions here.

@nand4011 nand4011 force-pushed the lambda-config branch 2 times, most recently from 04eb3b5 to 2b1c63a Compare August 9, 2023 22:35
Copy link
Contributor

@cprice404 cprice404 left a comment

Choose a reason for hiding this comment

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

minor nits but looking very good, thanks for knocking this out!

packages/client-sdk-nodejs/src/config/configurations.ts Outdated Show resolved Hide resolved
static v1(
loggerFactory: MomentoLoggerFactory = defaultLoggerFactory
): CacheConfiguration {
const deadlineMillis = 1100;
Copy link
Contributor

Choose a reason for hiding this comment

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

definitely not LowLatency. If we were going to change it from InRegion.Default I think it would be to increase it, not decrease it, but my gut is to go with the same value we use for InRegion.Default.

@eaddingtonwhite lmk if you have any super strong opinions here.

Make the number of data clients a cache client creates configurable.
6 is likely too many for lambdas as the extra latency for the first 6
calls isn't worth it in a short-lived environment.

Create a new configuration, InRegion.Lambda, for use inside lambdas.
It only creates 1 data client instead of 6.
Move the lambda config out of InRegion.

Get rid of the v1 config since it isn't set in stone yet. We will make
one in the future.

Make the numClients unique in the various tests.

Add a test showing numClients can be overridden.
@nand4011 nand4011 merged commit 0a5ea06 into main Aug 11, 2023
10 checks passed
@nand4011 nand4011 deleted the lambda-config branch August 11, 2023 22:16
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.

2 participants