Fix chunk manager

This commit is contained in:
Ben Sarmiento
2023-11-14 16:55:24 +01:00
parent 16505ec33f
commit 4da9416bec
4 changed files with 24 additions and 25 deletions

View File

@@ -67,12 +67,12 @@ func main() {
log.Debugf("Initializing chunk manager, cores: %d", runtime.NumCPU())
// 64kb request size
chunkMgr, err := chunk.NewManager(
"",
1048576, // 1MB
1, // 1 chunk - load ahead (1MB total)
max(runtime.NumCPU()/2, 1), // check threads
max(runtime.NumCPU()/2, 1), // load threads
runtime.NumCPU()*2,
"", // in-memory chunk file
5242880, // 10MB
max((runtime.NumCPU()/2)-1, 1), // 1 chunk - load ahead (1MB total)
max(runtime.NumCPU()/2, 1), // check threads
max(runtime.NumCPU()/2, 1), // load threads
runtime.NumCPU()*4,
torrentMgr, // max chunks
config)
if nil != err {