Hi everyone. Just start playing with seafile, and I really like it. I have a question on seadrive though, especially on the cache cleaning algo used.
I’m using seadrive on CentOS 7 to expose my music collection to ampache, among other things. The seadrive cache is smaller than the total collection, but that shouldn’t be a problem I guess. I’ve 25GB available, and have limited seadrive cache_size to 10GB, with cache cleaning every 2 minutes
[cache]
size_limit = 10GB
clean_cache_interval = 2
So, everything is working fine, except when accessing quickly to much files. Every night, a cron job scans the whole library for new/removed files. This process should take 2 or 3 hours in total. At the begining, seadrive correctly cleans his cache, but just not quicly enough. Step by step, the cache grows, until it saturates the whole 25GB. See here a part of my log file:
[02/06/18 01:58:29] file-cache-mgr.c(2562): Cleaning cache space.
[02/06/18 01:58:29] file-cache-mgr.c(2564): 1854 files in cache, total size is 10129 MB
[02/06/18 01:58:29] file-cache-mgr.c(2585): Cache cleaning done.
[02/06/18 01:58:29] file-cache-mgr.c(2587): Removed 99 files, cleaned up 3652 MB
[02/06/18 02:10:29] file-cache-mgr.c(2562): Cleaning cache space.
[02/06/18 02:10:29] file-cache-mgr.c(2564): 3232 files in cache, total size is 10603 MB
[02/06/18 02:10:30] file-cache-mgr.c(2585): Cache cleaning done.
[02/06/18 02:10:30] file-cache-mgr.c(2587): Removed 762 files, cleaned up 2607 MB
[02/06/18 02:16:30] file-cache-mgr.c(2562): Cleaning cache space.
[02/06/18 02:16:30] file-cache-mgr.c(2564): 3200 files in cache, total size is 10051 MB
[02/06/18 02:16:30] file-cache-mgr.c(2585): Cache cleaning done.
[02/06/18 02:16:30] file-cache-mgr.c(2587): Removed 177 files, cleaned up 596 MB
[02/06/18 02:18:30] file-cache-mgr.c(2562): Cleaning cache space.
[02/06/18 02:18:30] file-cache-mgr.c(2564): 3263 files in cache, total size is 10108 MB
[02/06/18 02:18:31] file-cache-mgr.c(2585): Cache cleaning done.
[02/06/18 02:18:31] file-cache-mgr.c(2587): Removed 29 files, cleaned up 85 MB
[02/06/18 02:20:31] file-cache-mgr.c(2562): Cleaning cache space.
[02/06/18 02:20:31] file-cache-mgr.c(2564): 3431 files in cache, total size is 10719 MB
[02/06/18 02:20:31] file-cache-mgr.c(2585): Cache cleaning done.
[02/06/18 02:20:31] file-cache-mgr.c(2587): Removed 14 files, cleaned up 60 MB
[02/06/18 02:22:31] file-cache-mgr.c(2562): Cleaning cache space.
[02/06/18 02:22:31] file-cache-mgr.c(2564): 3670 files in cache, total size is 11372 MB
[02/06/18 02:22:31] file-cache-mgr.c(2585): Cache cleaning done.
[02/06/18 02:22:31] file-cache-mgr.c(2587): Removed 82 files, cleaned up 194 MB
[02/06/18 02:24:32] file-cache-mgr.c(2562): Cleaning cache space.
[02/06/18 02:24:32] file-cache-mgr.c(2564): 3813 files in cache, total size is 11865 MB
[02/06/18 02:24:32] file-cache-mgr.c(2585): Cache cleaning done.
[02/06/18 02:24:32] file-cache-mgr.c(2587): Removed 60 files, cleaned up 147 MB
[...]
[02/06/18 02:52:33] file-cache-mgr.c(2585): Cache cleaning done.
[02/06/18 02:52:33] file-cache-mgr.c(2587): Removed 66 files, cleaned up 160 MB
[02/06/18 02:54:33] file-cache-mgr.c(2562): Cleaning cache space.
[02/06/18 02:54:33] file-cache-mgr.c(2564): 6654 files in cache, total size is 20143 MB
[...]
[02/06/18 03:12:35] file-cache-mgr.c(2562): Cleaning cache space.
[02/06/18 03:12:35] file-cache-mgr.c(2564): 8315 files in cache, total size is 24895 MB
[02/06/18 03:12:35] file-cache-mgr.c(2585): Cache cleaning done.
[02/06/18 03:12:35] file-cache-mgr.c(2587): Removed 89 files, cleaned up 254 MB
Shouldn’t the cache cleaning be more agressive when over the size limit ? How does seadrive decide which files to remove from the cache ? Is it a simple LRU ? Unfortunately, as the source is not open (yet ?) I can’t check