Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 38 additions & 19 deletions cfg/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,18 @@ import (
var AllFlagOptimizationRules = map[string]shared.OptimizationRules{"file-system.congestion-threshold": {
BucketTypeOptimization: []shared.BucketTypeOptimization{
{
BucketType: "zonal",
Value: int64(DefaultCongestionThreshold()),
BucketType: "rapid",
Value: int64(BucketTypeRapid.DefaultCongestionThreshold()),
},
{
BucketType: "pirlo",
Value: int64(DefaultCongestionThreshold()),
BucketType: "non-rapid",
Value: int64(BucketTypeNonRapid.DefaultCongestionThreshold()),
},
},
}, "file-system.enable-kernel-reader": {
BucketTypeOptimization: []shared.BucketTypeOptimization{
{
BucketType: "zonal",
Value: bool(true),
},
{
BucketType: "pirlo",
BucketType: "rapid",
Value: bool(true),
},
},
Expand All @@ -69,6 +65,17 @@ var AllFlagOptimizationRules = map[string]shared.OptimizationRules{"file-system.
Value: bool(true),
},
},
}, "file-system.fuse-max-pages-limit": {
BucketTypeOptimization: []shared.BucketTypeOptimization{
{
BucketType: "rapid",
Value: int64(BucketTypeRapid.DefaultFuseMaxPagesLimit()),
},
{
BucketType: "non-rapid",
Value: int64(BucketTypeNonRapid.DefaultFuseMaxPagesLimit()),
},
},
}, "implicit-dirs": {
MachineBasedOptimization: []shared.MachineBasedOptimization{
{
Expand Down Expand Up @@ -100,23 +107,23 @@ var AllFlagOptimizationRules = map[string]shared.OptimizationRules{"file-system.
}, "file-system.max-background": {
BucketTypeOptimization: []shared.BucketTypeOptimization{
{
BucketType: "zonal",
Value: int64(DefaultMaxBackground()),
BucketType: "rapid",
Value: int64(BucketTypeRapid.DefaultMaxBackground()),
},
{
BucketType: "pirlo",
Value: int64(DefaultMaxBackground()),
BucketType: "non-rapid",
Value: int64(BucketTypeNonRapid.DefaultMaxBackground()),
},
},
}, "file-system.max-read-ahead-kb": {
BucketTypeOptimization: []shared.BucketTypeOptimization{
{
BucketType: "zonal",
Value: int64(16384),
BucketType: "rapid",
Value: int64(BucketTypeRapid.DefaultMaxReadAheadKb()),
},
{
BucketType: "pirlo",
Value: int64(16384),
BucketType: "non-rapid",
Value: int64(BucketTypeNonRapid.DefaultMaxReadAheadKb()),
},
},
}, "metadata-cache.negative-ttl-secs": {
Expand Down Expand Up @@ -300,6 +307,18 @@ func (c *Config) ApplyOptimizations(v *viper.Viper, input *OptimizationInput) ma
}
}
}
if !v.IsSet("file-system.fuse-max-pages-limit") {
rules := AllFlagOptimizationRules["file-system.fuse-max-pages-limit"]
result := getOptimizedValue(&rules, c.FileSystem.FuseMaxPagesLimit, profileName, machineType, input, machineTypeToGroupMap)
if result.Optimized {
if val, ok := result.FinalValue.(int64); ok {
if c.FileSystem.FuseMaxPagesLimit != val {
c.FileSystem.FuseMaxPagesLimit = val
optimizedFlags["file-system.fuse-max-pages-limit"] = result
}
}
}
}
if !v.IsSet("implicit-dirs") {
rules := AllFlagOptimizationRules["implicit-dirs"]
result := getOptimizedValue(&rules, c.ImplicitDirs, profileName, machineType, input, machineTypeToGroupMap)
Expand Down Expand Up @@ -1129,7 +1148,7 @@ func BuildFlagSet(flagSet *pflag.FlagSet) error {

flagSet.StringP("file-cache-include-regex", "", "", "Include file paths (in the format bucket_name/object_key) specified by this regex for file caching.")

flagSet.IntP("file-cache-max-parallel-downloads", "", DefaultMaxParallelDownloads(), "Sets an uber limit of number of concurrent file download requests that are made across all files.")
flagSet.IntP("file-cache-max-parallel-downloads", "", BucketTypeRapid.DefaultMaxParallelDownloads(), "Sets an uber limit of number of concurrent file download requests that are made across all files.")

flagSet.IntP("file-cache-max-size-mb", "", -1, "Maximum size of the file-cache in MiBs")

Expand Down Expand Up @@ -1157,7 +1176,7 @@ func BuildFlagSet(flagSet *pflag.FlagSet) error {

flagSet.BoolP("foreground", "", false, "Stay in the foreground after mounting.")

flagSet.IntP("fuse-max-pages-limit", "", DefaultFuseMaxPagesLimit(), "Sets the limit for the maximum number of pages that fuse can process in a single request. This is a global, machine-level configuration that applies across all mounts. To prevent lowering the limits of other FUSE filesystems, the host's limit is only updated if the specified value is greater than the current system limit.")
flagSet.IntP("fuse-max-pages-limit", "", BucketTypeRapid.DefaultFuseMaxPagesLimit(), "Sets the limit for the maximum number of pages that fuse can process in a single request. This is a global, machine-level configuration that applies across all mounts. To prevent lowering the limits of other FUSE filesystems, the host's limit is only updated if the specified value is greater than the current system limit.")

if err := flagSet.MarkHidden("fuse-max-pages-limit"); err != nil {
return err
Expand Down
Loading
Loading