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

Slow handling of cached files with largecache_file_limit #1352

Closed
materight opened this issue Nov 25, 2024 · 3 comments
Closed

Slow handling of cached files with largecache_file_limit #1352

materight opened this issue Nov 25, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@materight
Copy link
Contributor

Describe the bug

When the cache_file_limit is set to a large value, e.g. 10k, calls to StorageManager.get_local_copy gets extremely slow, even if all the files are already available in the cache.

By profiling, it seems that this call to iterdir() is the main bottleneck. If there are a lot of small files in cache, and get_local_copy is called for each of them, iterating over all the files on each call is too slow.

To reproduce

  • Set StorageManager.set_cache_file_limit(10_000)
  • Download multiple files with StorageManager.get_local_copy to fill up the cache
  • Run again

Expected behaviour

If all the files are already available in cache, the second run should almost be immediate. Instead it can take minutes.

Since iterating over the files seems to be needed only for deleting old files if the cache is full, maybe there could be a parameter to disable this logic and another method to trigger it manually.

Environment

  • Server type: self hosted
  • ClearML SDK Version: 1.16.5
  • ClearML Server Version: 1.16.2-502
  • Python Version: 3.11
  • OS: Debian 10
@materight materight added the bug Something isn't working label Nov 25, 2024
@ainoam
Copy link
Collaborator

ainoam commented Dec 2, 2024

@materight Thanks for reporting - We'll take a look on how to improve this behaviour. We should hopefully be able to provide a fix in a near release.

@pollfly
Copy link
Contributor

pollfly commented Dec 19, 2024

Hey @materight ! Just letting you know that this issue has been resolved in the recently released v1.17.0. Let us know if there are any issues :)

@materight
Copy link
Contributor Author

Thanks! Will try it out

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

3 participants