mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
refactor(client): Limit prefetching to use at most one-third of the memory. #1000160740
Signed-off-by: Victor1319 <zengxuewei@oppo.com>
This commit is contained in:
parent
fc05b1d503
commit
8385bf3e0c
@ -255,6 +255,8 @@ func NewSuper(opt *proto.MountOptions) (s *Super, err error) {
|
||||
NeedRemoteCache: true,
|
||||
}
|
||||
|
||||
log.LogWarnf("ahead info enable %+v, totalMem %+v, timeout %+v, winCnt %+v", opt.AheadReadEnable, opt.AheadReadTotalMem, opt.AheadReadBlockTimeOut, opt.AheadReadWindowCnt)
|
||||
|
||||
s.ec, err = stream.NewExtentClient(extentConfig)
|
||||
if err != nil {
|
||||
return nil, errors.Trace(err, "NewExtentClient failed!")
|
||||
|
||||
@ -1020,10 +1020,9 @@ func parseMountOption(cfg *config.Config) (*proto.MountOptions, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
available = int64((total - used) / 2)
|
||||
available = int64((total - used) / 3)
|
||||
if available < opt.AheadReadTotalMem {
|
||||
opt.AheadReadTotalMem = available
|
||||
syslog.Printf("available ahead read mem: %v\n", available)
|
||||
}
|
||||
}
|
||||
if opt.MountPoint == "" || opt.Volname == "" || opt.Owner == "" || opt.Master == "" {
|
||||
|
||||
@ -906,7 +906,7 @@ func (dp *DataPartition) PersistMetadata() (err error) {
|
||||
return
|
||||
}
|
||||
dp.metaAppliedID = dp.appliedID
|
||||
log.LogInfof("PersistMetadata DataPartition(%v) data(%v)", dp.partitionID, string(metaData))
|
||||
log.LogWarnf("PersistMetadata DataPartition(%v) data(%v)", dp.partitionID, string(metaData))
|
||||
err = os.Rename(fileName, path.Join(dp.Path(), DataPartitionMetadataFileName))
|
||||
return
|
||||
}
|
||||
|
||||
@ -26,7 +26,6 @@ import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/cubefs/cubefs/flashnode"
|
||||
"github.com/cubefs/cubefs/proto"
|
||||
"github.com/cubefs/cubefs/util"
|
||||
"github.com/cubefs/cubefs/util/auditlog"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user