-
Notifications
You must be signed in to change notification settings - Fork 35
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(130): Introduces SEQREPO_FD_CACHE_MAXSIZE env var #131
feat(130): Introduces SEQREPO_FD_CACHE_MAXSIZE env var #131
Conversation
…ternal fd_cache_size to allow for increased performance with forcing code changes to any SeqRepo clients.
SEQREPO_FD_CACHE_MAXSIZE sets the lru_cache size for file handler caching during FASTA sequence retrievals. | ||
It defaults to 0 to disable any caching, but can be set to a specific value or "none" to be unlimited. Using | ||
a moderate value (>10) will greatly increase performance of sequence retrieval. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the downside of increasing this value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the only downside is in the potential for resource exhaustion on the system? But I'd defer to the discussion in #112 for additional information. Should I add a statement that states if the value is too large, there is a risk for exhaustion?
I think the mentioned setup issue will require a change similar to this. That appears to be a problem we need to fix across all biocommons packages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM
Introduces
SEQREPO_FD_CACHE_MAXSIZE
env var to override the internalfd_cache_size
to allow for increased performance without forcing code changes to any SeqRepo clients.Example:
We are using SeqRepo in an internal library and noticed a 10x decrease in performance with seqrepo 0.6.6 because the internal
fd_cache_size
is being set to 0 ( no caching ). Rather than forcing clients of SeqRepo to set this value in code and release new versions, it'd be nice to control this value via an env var likeSEQREPO_LRU_CACHE_MAXSIZE
Note:
Now that there are two env vars, the old var
SEQREPO_LRU_CACHE_MAXSIZE
feels incorrectly named as it's unclear which LRU cache it's controlling. I didn't want to introduce any changes to existing code, but maybe this should be renamed to something likeSEQREPO_DB_CACHE_MAXSIZE
or something to indicate what is being cached and deprecateSEQREPO_LRU_CACHE_MAXSIZE
or allow the one env to control all the caches?Also is it worth providing a better default other than 0 (no cache)? Something small'ish like ~25 or so would at least give a significant performance boost without risking resource exhaustion