Skip to content

Commit f3c70a9

Browse files
committed
chore(memory-reclaimer): use saner defaults
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
1 parent e3e5f59 commit f3c70a9

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

core/application/startup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ func loadRuntimeSettingsFromFile(options *config.ApplicationConfig) {
278278
options.WatchDogInterval = dur
279279
} else {
280280
log.Warn().Err(err).Str("interval", *settings.WatchdogInterval).Msg("invalid watchdog interval in runtime_settings.json")
281-
options.WatchDogInterval = 10 * time.Second
281+
options.WatchDogInterval = model.DefaultWatchdogInterval
282282
}
283283
}
284284
}

pkg/model/watchdog_options.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import (
44
"time"
55
)
66

7+
const DefaultWatchdogInterval = 500 * time.Millisecond
8+
79
// WatchDogOptions contains all configuration for the WatchDog
810
type WatchDogOptions struct {
911
processManager ProcessManager
@@ -105,12 +107,12 @@ func DefaultWatchDogOptions() *WatchDogOptions {
105107
return &WatchDogOptions{
106108
busyTimeout: 5 * time.Minute,
107109
idleTimeout: 15 * time.Minute,
108-
watchdogInterval: 2 * time.Second,
110+
watchdogInterval: DefaultWatchdogInterval,
109111
busyCheck: false,
110112
idleCheck: false,
111113
lruLimit: 0,
112114
memoryReclaimerEnabled: false,
113-
memoryReclaimerThreshold: 0.95,
115+
memoryReclaimerThreshold: 0.80,
114116
}
115117
}
116118

0 commit comments

Comments
 (0)