diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-06-06 13:13:33 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-06-06 13:13:33 -0700 |
| commit | 9cba5cca0be43553f7aae1ab5477a0366765ff02 (patch) | |
| tree | 01890425e91c5a20721d0f0d84fdfcd63abe3262 | |
| parent | 21ad9a4ac29fad0794369cc05d1f29fa91340c34 (diff) | |
| download | seaweedfs-9cba5cca0be43553f7aae1ab5477a0366765ff02.tar.xz seaweedfs-9cba5cca0be43553f7aae1ab5477a0366765ff02.zip | |
optionally disable concurrent upload limit
| -rw-r--r-- | weed/server/filer_server_handlers.go | 4 | ||||
| -rw-r--r-- | weed/server/volume_server_handlers.go | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/weed/server/filer_server_handlers.go b/weed/server/filer_server_handlers.go index ed6bbb6f6..56a47c860 100644 --- a/weed/server/filer_server_handlers.go +++ b/weed/server/filer_server_handlers.go @@ -1,6 +1,7 @@ package weed_server import ( + "github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/util" "net/http" "strings" @@ -53,7 +54,8 @@ func (fs *FilerServer) filerHandler(w http.ResponseWriter, r *http.Request) { // wait until in flight data is less than the limit contentLength := getContentLength(r) fs.inFlightDataLimitCond.L.Lock() - for atomic.LoadInt64(&fs.inFlightDataSize) > fs.option.ConcurrentUploadLimit { + for fs.option.ConcurrentUploadLimit != 0 && atomic.LoadInt64(&fs.inFlightDataSize) > fs.option.ConcurrentUploadLimit { + glog.V(4).Infof("wait because inflight data %d > %d", fs.inFlightDataSize, fs.option.ConcurrentUploadLimit) fs.inFlightDataLimitCond.Wait() } atomic.AddInt64(&fs.inFlightDataSize, contentLength) diff --git a/weed/server/volume_server_handlers.go b/weed/server/volume_server_handlers.go index 4527add44..8ac3c0d90 100644 --- a/weed/server/volume_server_handlers.go +++ b/weed/server/volume_server_handlers.go @@ -46,7 +46,8 @@ func (vs *VolumeServer) privateStoreHandler(w http.ResponseWriter, r *http.Reque // wait until in flight data is less than the limit contentLength := getContentLength(r) vs.inFlightDataLimitCond.L.Lock() - for atomic.LoadInt64(&vs.inFlightDataSize) > vs.concurrentUploadLimit { + for vs.concurrentUploadLimit != 0 && atomic.LoadInt64(&vs.inFlightDataSize) > vs.concurrentUploadLimit { + glog.V(4).Infof("wait because inflight data %d > %d", vs.inFlightDataSize, vs.concurrentUploadLimit) vs.inFlightDataLimitCond.Wait() } atomic.AddInt64(&vs.inFlightDataSize, contentLength) |
