tiered caching

1/4 for small less than 1MB files. 1/4 for 1~4MB files, 1/2 for bigger than 4MB files
This commit is contained in:
Chris Lu
2020-04-13 22:19:27 -07:00
parent f282ed444b
commit 2b5c4fbbf3
5 changed files with 41 additions and 21 deletions

View File

@@ -84,7 +84,7 @@ func NewSeaweedFileSystem(option *Option) *WFS {
},
}
if option.CacheSizeMB > 0 {
wfs.chunkCache = chunk_cache.NewChunkCache(256, option.CacheDir, option.CacheSizeMB, 4)
wfs.chunkCache = chunk_cache.NewChunkCache(256, option.CacheDir, option.CacheSizeMB)
util.OnInterrupt(func() {
wfs.chunkCache.Shutdown()
})