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

Evict spare, idle resources after a configurable time #2

Open
10 tasks
cressie176 opened this issue Aug 24, 2023 · 0 comments
Open
10 tasks

Evict spare, idle resources after a configurable time #2

cressie176 opened this issue Aug 24, 2023 · 0 comments

Comments

@cressie176
Copy link
Member

cressie176 commented Aug 24, 2023

Some users may wish to reduce the pool size during periods of low activity. We can achieve this by implementing an eviction policy

  • Support an optional configurable eviction threshold, specified in milliseconds
  • Validate the eviction threshold
    • Assert that the eviction threshold is a number
    • Assert that the minimum eviction threshold is 1 millisecond
  • Evict resources that have been idle for longer than the eviction threshold
  • Do not evict resources if...
    • The pool will fall below the minimum size
    • The candidate resource is not spare (i.e. number of queued requests is lower than the number of idle resources)
  • If a resource cannot be evicted immediately consider it at a later date if it does not end up being acquired
  • Destroy / quarantine evicted resources in the usual way
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

No branches or pull requests

1 participant