aboutsummaryrefslogtreecommitdiff
path: root/weed/command
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2016-11-16 07:09:57 -0800
committerChris Lu <chris.lu@gmail.com>2016-11-16 07:09:57 -0800
commitdcaf1796fe0e41e39ac5c9602cb190cf150e7849 (patch)
treee437a5a9c6eee42be162d329adefb5c57c347a4a /weed/command
parentf54f530ada119f9bfe45d087c5474a2c70e2b9a1 (diff)
downloadseaweedfs-dcaf1796fe0e41e39ac5c9602cb190cf150e7849.tar.xz
seaweedfs-dcaf1796fe0e41e39ac5c9602cb190cf150e7849.zip
add option to enable caching
Diffstat (limited to 'weed/command')
-rw-r--r--weed/command/server.go2
-rw-r--r--weed/command/volume.go3
2 files changed, 5 insertions, 0 deletions
diff --git a/weed/command/server.go b/weed/command/server.go
index eed7dcae4..027ba191d 100644
--- a/weed/command/server.go
+++ b/weed/command/server.go
@@ -72,6 +72,7 @@ var (
volumeFixJpgOrientation = cmdServer.Flag.Bool("volume.images.fix.orientation", true, "Adjust jpg orientation when uploading.")
volumeReadRedirect = cmdServer.Flag.Bool("volume.read.redirect", true, "Redirect moved or non-local volumes.")
volumeServerPublicUrl = cmdServer.Flag.String("volume.publicUrl", "", "publicly accessible address")
+ volumeEnableBytesCache = cmdServer.Flag.Bool("volume.cache.enable", false, "direct cache instead of OS cache, cost more memory.")
isStartingFiler = cmdServer.Flag.Bool("filer", false, "whether to start filer")
serverWhiteList []string
@@ -259,6 +260,7 @@ func runServer(cmd *Command, args []string) bool {
volumeNeedleMapKind,
*serverIp+":"+strconv.Itoa(*masterPort), *volumePulse, *serverDataCenter, *serverRack,
serverWhiteList, *volumeFixJpgOrientation, *volumeReadRedirect,
+ *volumeEnableBytesCache,
)
glog.V(0).Infoln("Start Seaweed volume server", util.VERSION, "at", *serverIp+":"+strconv.Itoa(*volumePort))
diff --git a/weed/command/volume.go b/weed/command/volume.go
index 21369cbe9..ba498b8e4 100644
--- a/weed/command/volume.go
+++ b/weed/command/volume.go
@@ -36,6 +36,7 @@ type VolumeServerOptions struct {
indexType *string
fixJpgOrientation *bool
readRedirect *bool
+ enableBytesCache *bool
}
func init() {
@@ -54,6 +55,7 @@ func init() {
v.indexType = cmdVolume.Flag.String("index", "memory", "Choose [memory|leveldb|boltdb] mode for memory~performance balance.")
v.fixJpgOrientation = cmdVolume.Flag.Bool("images.fix.orientation", true, "Adjust jpg orientation when uploading.")
v.readRedirect = cmdVolume.Flag.Bool("read.redirect", true, "Redirect moved or non-local volumes.")
+ v.enableBytesCache = cmdVolume.Flag.Bool("cache.enable", false, "direct cache instead of OS cache, cost more memory.")
}
var cmdVolume = &Command{
@@ -132,6 +134,7 @@ func runVolume(cmd *Command, args []string) bool {
*v.master, *v.pulseSeconds, *v.dataCenter, *v.rack,
v.whiteList,
*v.fixJpgOrientation, *v.readRedirect,
+ *v.enableBytesCache,
)
listeningAddress := *v.bindIp + ":" + strconv.Itoa(*v.port)