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

Cache DescribeInstanceTypes and DescribeInstanceTypeOfferings #74

Closed
bwagner5 opened this issue Feb 22, 2021 · 0 comments
Closed

Cache DescribeInstanceTypes and DescribeInstanceTypeOfferings #74

bwagner5 opened this issue Feb 22, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@bwagner5
Copy link
Contributor

When using ec2-instance-selector as a library in an always running application, it would be nice to have DescribeInstanceTypes and DescribeInstanceTypeOfferings calls cached. EC2 instance types don't change too often, so this cache is probably safe to stick around for hours but even moderate caching on the order of minutes could save many API calls.


I would envision the cache to be on by default with a conservative TTL of 15 minutes. A public method will need to be defined to clear the cache and to refresh the cache. The lib consumer could use the refresh in a ticker go routine to periodically refresh the cache without taking the cache miss latency hit. ec2-instance-selector could also providethe function that a user could kick off in a go routine for refresh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant