|
@@ -284,6 +284,11 @@ type Config struct {
|
|
|
// to drop below the limit.
|
|
// to drop below the limit.
|
|
|
// The default, 0 is no limit.
|
|
// The default, 0 is no limit.
|
|
|
MaxConcurrentSSHHandshakes int
|
|
MaxConcurrentSSHHandshakes int
|
|
|
|
|
+
|
|
|
|
|
+ // PeriodicGarbageCollectionSeconds turns on periodic calls to runtime.GC,
|
|
|
|
|
+ // every specified number of seconds, to force garbage collection.
|
|
|
|
|
+ // The default, 0 is off.
|
|
|
|
|
+ PeriodicGarbageCollectionSeconds int
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// RunWebServer indicates whether to run a web server component.
|
|
// RunWebServer indicates whether to run a web server component.
|
|
@@ -296,6 +301,11 @@ func (config *Config) RunLoadMonitor() bool {
|
|
|
return config.LoadMonitorPeriodSeconds > 0
|
|
return config.LoadMonitorPeriodSeconds > 0
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// RunPeriodicGarbageCollection indicates whether to run periodic garbage collection.
|
|
|
|
|
+func (config *Config) RunPeriodicGarbageCollection() bool {
|
|
|
|
|
+ return config.PeriodicGarbageCollectionSeconds > 0
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// LoadConfig loads and validates a JSON encoded server config.
|
|
// LoadConfig loads and validates a JSON encoded server config.
|
|
|
func LoadConfig(configJSON []byte) (*Config, error) {
|
|
func LoadConfig(configJSON []byte) (*Config, error) {
|
|
|
|
|
|