scheduling optimization

This commit is contained in:
unknown
2022-05-20 17:04:51 +08:00
parent effee8ce1f
commit c4cfb7a296
8 changed files with 114 additions and 0 deletions
+8
View File
@@ -4,6 +4,7 @@ import (
"fmt"
_ "net/http/pprof"
"os"
"strconv"
"github.com/filecoin-project/lotus/api/v1api"
@@ -49,6 +50,11 @@ var runCmd = &cli.Command{
Usage: "manage open file limit",
Value: true,
},
&cli.IntFlag{
Name: "parallel-p1-limit",
Usage: "maximum pre commit1 operations to run in parallel",
Value: -1,
},
},
Action: func(cctx *cli.Context) error {
if !cctx.Bool("enable-gpu-proving") {
@@ -58,6 +64,8 @@ var runCmd = &cli.Command{
}
}
os.Setenv("PARALLEL_P1_LIMIT", strconv.Itoa(cctx.Int("parallel-p1-limit")))
ctx, _ := tag.New(lcli.DaemonContext(cctx),
tag.Insert(metrics.Version, build.BuildVersion),
tag.Insert(metrics.Commit, build.CurrentCommit),
+6
View File
@@ -152,6 +152,12 @@ func workersCmd(sealing bool) *cli.Command {
for _, gpu := range stat.Info.Resources.GPUs {
fmt.Printf("\tGPU: %s\n", color.New(gpuCol).Sprintf("%s, %sused", gpu, gpuUse))
}
plConfig, ok := stat.Info.TaskLimits[sealtasks.TTPreCommit1]
if ok && plConfig.LimitCount > 0 {
fmt.Printf("\tP1LIMIT: [%s] %d/%d tasks are running\n",
barString(float64(plConfig.LimitCount), 0, float64(plConfig.RunCount)), plConfig.RunCount, plConfig.LimitCount)
}
}
return nil
+8
View File
@@ -9,6 +9,7 @@ import (
"net/http"
"os"
"path/filepath"
"strconv"
"strings"
"time"
@@ -208,6 +209,11 @@ var runCmd = &cli.Command{
Usage: "used when 'listen' is unspecified. must be a valid duration recognized by golang's time.ParseDuration function",
Value: "30m",
},
&cli.IntFlag{
Name: "parallel-p1-limit",
Usage: "maximum precommit1 operations to run in parallel",
Value: -1,
},
},
Before: func(cctx *cli.Context) error {
if cctx.IsSet("address") {
@@ -228,6 +234,8 @@ var runCmd = &cli.Command{
}
}
os.Setenv("PARALLEL_P1_LIMIT", strconv.Itoa(cctx.Int("parallel-p1-limit")))
limit, _, err := ulimit.GetLimit()
switch {
case err == ulimit.ErrUnsupported: