Skip to content

Commit

Permalink
LOTUS_DAGSTORE_COPY_CONCURRENCY for controlling copy concurrency.
Browse files Browse the repository at this point in the history
  • Loading branch information
raulk committed Jul 29, 2021
1 parent 88efbfa commit f648a72
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion node/modules/storageminer.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"os"
"path"
"path/filepath"
"strconv"
"strings"
"time"

Expand Down Expand Up @@ -615,13 +616,23 @@ func DagStoreWrapper(
return nil, err
}

var maxCopies = 10
// TODO replace env with config.toml attribute.
v, ok := os.LookupEnv("LOTUS_DAGSTORE_COPY_CONCURRENCY")
if ok {
concurrency, err := strconv.Atoi(v)
if err == nil {
maxCopies = concurrency
}
}

cfg := dagstore.MarketDAGStoreConfig{
TransientsDir: filepath.Join(dagStoreDir, "transients"),
IndexDir: filepath.Join(dagStoreDir, "index"),
Datastore: dagStoreDS,
GCInterval: 1 * time.Minute,
MaxConcurrentIndex: 5,
MaxConcurrentCopies: 2,
MaxConcurrentCopies: maxCopies,
}

dsw, err := dagstore.NewDagStoreWrapper(cfg, lotusAccessor)
Expand Down

0 comments on commit f648a72

Please sign in to comment.