lotus/resources.go

252 lines
4.9 KiB
Go
Raw Normal View History

2020-03-23 11:40:02 +00:00
package sectorstorage
import (
"github.com/filecoin-project/specs-actors/actors/abi"
2020-03-27 23:21:36 +00:00
"github.com/filecoin-project/sector-storage/sealtasks"
"github.com/filecoin-project/sector-storage/stores"
2020-03-23 11:40:02 +00:00
)
2020-03-26 02:50:56 +00:00
var FSOverheadSeal = map[stores.SectorFileType]int{ // 10x overheads
stores.FTUnsealed: 10,
stores.FTSealed: 10,
stores.FTCache: 70, // TODO: confirm for 32G
2020-03-23 11:40:02 +00:00
}
2020-03-26 02:50:56 +00:00
var FsOverheadFinalized = map[stores.SectorFileType]int{
stores.FTUnsealed: 10,
stores.FTSealed: 10,
stores.FTCache: 2,
2020-03-23 11:40:02 +00:00
}
type Resources struct {
MinMemory uint64 // What Must be in RAM for decent perf
2020-03-24 23:37:40 +00:00
MaxMemory uint64 // Memory required (swap + ram)
2020-03-23 11:40:02 +00:00
Threads int // -1 = multithread
CanGPU bool
2020-03-23 11:40:02 +00:00
BaseMinMemory uint64 // What Must be in RAM for decent perf (shared between threads)
}
func (r Resources) MultiThread() bool {
return r.Threads == -1
}
2020-03-23 11:40:02 +00:00
const MaxCachingOverhead = 32 << 30
var ResourceTable = map[sealtasks.TaskType]map[abi.RegisteredProof]Resources{
sealtasks.TTAddPiece: {
abi.RegisteredProof_StackedDRG32GiBSeal: Resources{ // This is probably a bit conservative
MaxMemory: 32 << 30,
MinMemory: 32 << 30,
Threads: 1,
2020-03-23 11:40:02 +00:00
BaseMinMemory: 1 << 30,
},
abi.RegisteredProof_StackedDRG512MiBSeal: Resources{
MaxMemory: 1 << 30,
MinMemory: 1 << 30,
Threads: 1,
2020-03-23 11:40:02 +00:00
BaseMinMemory: 1 << 30,
},
abi.RegisteredProof_StackedDRG2KiBSeal: Resources{
2020-04-01 21:24:09 +00:00
MaxMemory: 2 << 10,
MinMemory: 2 << 10,
Threads: 1,
2020-04-01 21:24:09 +00:00
BaseMinMemory: 2 << 10,
},
abi.RegisteredProof_StackedDRG8MiBSeal: Resources{
2020-04-01 23:26:47 +00:00
MaxMemory: 8 << 20,
MinMemory: 8 << 20,
Threads: 1,
2020-04-01 23:26:47 +00:00
BaseMinMemory: 8 << 20,
},
2020-03-23 11:40:02 +00:00
},
sealtasks.TTPreCommit1: {
abi.RegisteredProof_StackedDRG32GiBSeal: Resources{
MaxMemory: 64 << 30,
MinMemory: 32 << 30,
Threads: 1,
2020-03-23 11:40:02 +00:00
BaseMinMemory: 30 << 30,
},
abi.RegisteredProof_StackedDRG512MiBSeal: Resources{
MaxMemory: 3 << 29, // 1.5G
MinMemory: 1 << 30,
Threads: 1,
2020-03-23 11:40:02 +00:00
BaseMinMemory: 1 << 30,
},
abi.RegisteredProof_StackedDRG2KiBSeal: Resources{
2020-04-01 21:24:09 +00:00
MaxMemory: 2 << 10,
MinMemory: 2 << 10,
Threads: 1,
2020-04-01 21:24:09 +00:00
BaseMinMemory: 2 << 10,
},
abi.RegisteredProof_StackedDRG8MiBSeal: Resources{
2020-04-01 23:26:47 +00:00
MaxMemory: 8 << 20,
MinMemory: 8 << 20,
Threads: 1,
2020-04-01 23:26:47 +00:00
BaseMinMemory: 8 << 20,
},
2020-03-23 11:40:02 +00:00
},
sealtasks.TTPreCommit2: {
abi.RegisteredProof_StackedDRG32GiBSeal: Resources{
MaxMemory: 96 << 30,
MinMemory: 64 << 30,
Threads: -1,
2020-03-23 11:40:02 +00:00
BaseMinMemory: 30 << 30,
},
abi.RegisteredProof_StackedDRG512MiBSeal: Resources{
MaxMemory: 3 << 29, // 1.5G
MinMemory: 1 << 30,
Threads: -1,
2020-03-23 11:40:02 +00:00
BaseMinMemory: 1 << 30,
},
abi.RegisteredProof_StackedDRG2KiBSeal: Resources{
2020-04-01 21:24:09 +00:00
MaxMemory: 2 << 10,
MinMemory: 2 << 10,
Threads: -1,
2020-04-01 21:24:09 +00:00
BaseMinMemory: 2 << 10,
},
abi.RegisteredProof_StackedDRG8MiBSeal: Resources{
2020-04-01 23:26:47 +00:00
MaxMemory: 8 << 20,
MinMemory: 8 << 20,
Threads: -1,
2020-04-01 23:26:47 +00:00
BaseMinMemory: 8 << 20,
},
2020-03-23 11:40:02 +00:00
},
sealtasks.TTCommit1: { // Very short (~100ms), so params are very light
abi.RegisteredProof_StackedDRG32GiBSeal: Resources{
MaxMemory: 1 << 30,
MinMemory: 1 << 30,
Threads: 0,
2020-03-23 11:40:02 +00:00
BaseMinMemory: 1 << 30,
},
abi.RegisteredProof_StackedDRG512MiBSeal: Resources{
MaxMemory: 1 << 30,
MinMemory: 1 << 30,
Threads: 0,
2020-03-23 11:40:02 +00:00
BaseMinMemory: 1 << 30,
},
abi.RegisteredProof_StackedDRG2KiBSeal: Resources{
2020-04-01 21:24:09 +00:00
MaxMemory: 2 << 10,
MinMemory: 2 << 10,
Threads: 0,
2020-04-01 21:24:09 +00:00
BaseMinMemory: 2 << 10,
},
abi.RegisteredProof_StackedDRG8MiBSeal: Resources{
2020-04-01 23:26:47 +00:00
MaxMemory: 8 << 20,
MinMemory: 8 << 20,
Threads: 0,
2020-04-01 23:26:47 +00:00
BaseMinMemory: 8 << 20,
},
2020-03-23 11:40:02 +00:00
},
sealtasks.TTCommit2: { // TODO: Measure more accurately
abi.RegisteredProof_StackedDRG32GiBSeal: Resources{
MaxMemory: 110 << 30,
MinMemory: 60 << 30,
Threads: -1,
CanGPU: true,
2020-03-23 11:40:02 +00:00
BaseMinMemory: 64 << 30, // params
},
abi.RegisteredProof_StackedDRG512MiBSeal: Resources{
MaxMemory: 3 << 29, // 1.5G
MinMemory: 1 << 30,
Threads: 1, // This is fine
CanGPU: true,
2020-03-23 11:40:02 +00:00
BaseMinMemory: 10 << 30,
},
abi.RegisteredProof_StackedDRG2KiBSeal: Resources{
2020-04-01 21:24:09 +00:00
MaxMemory: 2 << 10,
MinMemory: 2 << 10,
Threads: 1,
CanGPU: true,
2020-03-23 11:40:02 +00:00
2020-04-01 21:24:09 +00:00
BaseMinMemory: 2 << 10,
},
abi.RegisteredProof_StackedDRG8MiBSeal: Resources{
2020-04-01 23:26:47 +00:00
MaxMemory: 8 << 20,
MinMemory: 8 << 20,
Threads: 1,
CanGPU: true,
2020-03-23 11:40:02 +00:00
2020-04-01 23:26:47 +00:00
BaseMinMemory: 8 << 20,
},
},
sealtasks.TTFetch: {
abi.RegisteredProof_StackedDRG32GiBSeal: Resources{
MaxMemory: 1 << 20,
MinMemory: 1 << 20,
Threads: 0,
CanGPU: false,
BaseMinMemory: 0,
},
abi.RegisteredProof_StackedDRG512MiBSeal: Resources{
MaxMemory: 1 << 20,
MinMemory: 1 << 20,
Threads: 0,
CanGPU: false,
BaseMinMemory: 0,
},
abi.RegisteredProof_StackedDRG2KiBSeal: Resources{
MaxMemory: 1 << 20,
MinMemory: 1 << 20,
Threads: 0,
CanGPU: false,
BaseMinMemory: 0,
},
abi.RegisteredProof_StackedDRG8MiBSeal: Resources{
MaxMemory: 1 << 20,
MinMemory: 1 << 20,
Threads: 0,
CanGPU: false,
BaseMinMemory: 0,
},
},
2020-03-23 11:40:02 +00:00
}