diff options
| author | chrislu <chris.lu@gmail.com> | 2023-08-16 23:39:21 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2023-08-16 23:39:21 -0700 |
| commit | 6c7fa567d4b94790f213d0546b365a4e989a0e3d (patch) | |
| tree | dac7877f97a0efbcb6162c87c40e2265aa600f2c /weed/command | |
| parent | b05ab1e0926a675c2da76caeab2e83971145f294 (diff) | |
| download | seaweedfs-6c7fa567d4b94790f213d0546b365a4e989a0e3d.tar.xz seaweedfs-6c7fa567d4b94790f213d0546b365a4e989a0e3d.zip | |
add separate cache directory for write buffers
Diffstat (limited to 'weed/command')
| -rw-r--r-- | weed/command/fuse.go | 2 | ||||
| -rw-r--r-- | weed/command/mount.go | 2 | ||||
| -rw-r--r-- | weed/command/mount_std.go | 1 |
3 files changed, 5 insertions, 0 deletions
diff --git a/weed/command/fuse.go b/weed/command/fuse.go index 5beeb3b1f..23055c84d 100644 --- a/weed/command/fuse.go +++ b/weed/command/fuse.go @@ -153,6 +153,8 @@ func runFuse(cmd *Command, args []string) bool { } else { panic(fmt.Errorf("cacheCapacityMB: %s", err)) } + case "cacheDirWrite": + mountOptions.cacheDirWrite = ¶meter.value case "dataCenter": mountOptions.dataCenter = ¶meter.value case "allowOthers": diff --git a/weed/command/mount.go b/weed/command/mount.go index 64c8c754d..bb4325b1a 100644 --- a/weed/command/mount.go +++ b/weed/command/mount.go @@ -18,6 +18,7 @@ type MountOptions struct { chunkSizeLimitMB *int concurrentWriters *int cacheDir *string + cacheDirWrite *string cacheSizeMB *int64 dataCenter *string allowOthers *bool @@ -56,6 +57,7 @@ func init() { mountOptions.concurrentWriters = cmdMount.Flag.Int("concurrentWriters", 32, "limit concurrent goroutine writers") mountOptions.cacheDir = cmdMount.Flag.String("cacheDir", os.TempDir(), "local cache directory for file chunks and meta data") mountOptions.cacheSizeMB = cmdMount.Flag.Int64("cacheCapacityMB", 0, "file chunk read cache capacity in MB") + mountOptions.cacheDirWrite = cmdMount.Flag.String("cacheDirWrite", os.TempDir(), "buffer writes mostly for large files") mountOptions.dataCenter = cmdMount.Flag.String("dataCenter", "", "prefer to write to the data center") mountOptions.allowOthers = cmdMount.Flag.Bool("allowOthers", true, "allows other users to access the file system") mountOptions.umaskString = cmdMount.Flag.String("umask", "022", "octal umask, e.g., 022, 0111") diff --git a/weed/command/mount_std.go b/weed/command/mount_std.go index dff53f25e..86c3e521e 100644 --- a/weed/command/mount_std.go +++ b/weed/command/mount_std.go @@ -227,6 +227,7 @@ func RunMount(option *MountOptions, umask os.FileMode) bool { ConcurrentWriters: *option.concurrentWriters, CacheDir: *option.cacheDir, CacheSizeMB: *option.cacheSizeMB, + CacheDirWrite: *option.cacheDirWrite, DataCenter: *option.dataCenter, Quota: int64(*option.collectionQuota) * 1024 * 1024, MountUid: uid, |
