From be2588b3ee6457d8cda2aae2487c4c27053b32da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=B5=AB=E7=84=B6?= Date: Wed, 22 Jan 2025 16:01:33 +0800 Subject: [PATCH] Set fs cache limit to 4G by default --- fileserver/option/option.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fileserver/option/option.go b/fileserver/option/option.go index 9e89b2d0..967a1111 100644 --- a/fileserver/option/option.go +++ b/fileserver/option/option.go @@ -79,7 +79,7 @@ func initDefaultOptions() { WebTokenExpireTime = 7200 ClusterSharedTempFileMode = 0600 DefaultQuota = InfiniteQuota - FsCacheLimit = 2 << 30 + FsCacheLimit = 4 << 30 VerifyClientBlocks = true FsIdListRequestTimeout = -1 DBOpTimeout = 60 * time.Second @@ -207,6 +207,10 @@ func parseFileServerSection(section *ini.Section) { FsCacheLimit = fsCacheLimit * 1024 * 1024 } } + // The ratio of physical memory consumption and fs objects is about 4:1, + // and this part of memory is generally not subject to GC. So the value is + // divided by 4. + FsCacheLimit = FsCacheLimit / 4 if key, err := section.GetKey("fs_id_list_request_timeout"); err == nil { fsIdListRequestTimeout, err := key.Int64() if err == nil {