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

Set up 2-tier cache for multi-align #1110

Open
tonydisera opened this issue Sep 19, 2024 · 2 comments
Open

Set up 2-tier cache for multi-align #1110

tonydisera opened this issue Sep 19, 2024 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@tonydisera
Copy link
Collaborator

There are currently over ~500,000 files in the persist_cache directory. @anderspitman recommends that we change to a 2-tier caching scheme:

I recommend converting this to a tiered cache with 2 levels. So for example, if you have the hash b6b842c0d9572a0cd68888f7425b652f, it would be stored in cache/b6/b8/b6b842c0d9572a0cd68888f7425b652f. The reason I recommend 2 levels is because you currently have ~2000 files that start with b6 (and ~2000 for every other prefix). So if you only did one level you'd still have too many files per directory. But there are only 7 files that start with b6b8, so you should have plenty of room to grow.

@tonydisera tonydisera added this to the 4.11.3 milestone Sep 19, 2024
@tonydisera tonydisera self-assigned this Sep 19, 2024
@tonydisera
Copy link
Collaborator Author

@anderspitman, the node js multialign server currently uses the npm packaged node-cache, which does not support multiple levels. I searched for multi-level cache packages, and NPM shows multi-level-cache in the top 10 for popularity, quality, and performance. And it looks like the port will require minimal changes.

https://www.npmjs.com/package/multi-level-cache

Is there a package you recommend?

@anderspitman
Copy link
Member

Not sure if that's what we want. They don't mention anything about how they store a large number of files on disk. Probably what we're looking for is a key value (kv) store with support for persisting to the filesystem and handling large numbers of keys.

@tonydisera tonydisera modified the milestones: 4.11.3, 5.1 Sep 26, 2024
@tonydisera tonydisera added the bug Something isn't working label Nov 14, 2024
@tonydisera tonydisera modified the milestones: 5.1, 4.11.4 Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants