mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
speeding up loading volumes
This commit is contained in:
parent
de97ba94c3
commit
26313060a3
|
@ -4,6 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
@ -206,7 +207,11 @@ func (l *DiskLocation) concurrentLoadingVolumes(needleMapKind NeedleMapKind, con
|
||||||
|
|
||||||
func (l *DiskLocation) loadExistingVolumes(needleMapKind NeedleMapKind) {
|
func (l *DiskLocation) loadExistingVolumes(needleMapKind NeedleMapKind) {
|
||||||
|
|
||||||
l.concurrentLoadingVolumes(needleMapKind, 10)
|
workerNum := runtime.NumCPU()
|
||||||
|
if workerNum <= 10 {
|
||||||
|
workerNum = 10
|
||||||
|
}
|
||||||
|
l.concurrentLoadingVolumes(needleMapKind, workerNum)
|
||||||
glog.V(0).Infof("Store started on dir: %s with %d volumes max %d", l.Directory, len(l.volumes), l.MaxVolumeCount)
|
glog.V(0).Infof("Store started on dir: %s with %d volumes max %d", l.Directory, len(l.volumes), l.MaxVolumeCount)
|
||||||
|
|
||||||
l.loadAllEcShards()
|
l.loadAllEcShards()
|
||||||
|
|
Loading…
Reference in a new issue