-
Notifications
You must be signed in to change notification settings - Fork 423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability for aggro cache cleanup to only consider Kraken's disk usage #386
base: master
Are you sure you want to change the base?
Conversation
testStats := tally.NewTestScope("", map[string]string{}) | ||
m.clean(testStats, config, op) | ||
snapshot := testStats.Snapshot() | ||
usageGauge, ok := snapshot.Gauges()["disk_usage+"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure where the +
comes from. Could this be a bug?
c332836
to
af94237
Compare
af94237
to
59471a7
Compare
|
||
// calculateDiskUtil calculates the disk space utilization based on the config. | ||
// If 'ExcludeOtherServices' is turned on, only this op's utilization of the filesystem is considered. | ||
func calculateDiskUtil(op base.FileOp, config CleanupConfig) (int, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How could I test this?
Interval time.Duration `yaml:"interval"` // How often cleanup runs. | ||
TTI time.Duration `yaml:"tti"` // Time to idle based on last access time. | ||
TTL time.Duration `yaml:"ttl"` // Time to live regardless of access. If 0, disables TTL. | ||
ExcludeOtherServices bool `yaml:"exclude_other_services"` // Whether to exclude other services from the disk util calculation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Anton-Kalpakchiev why are we making this config-driven?
In my opinion, Kraken's cache cleanup should always exclude other services from the disk utilization calculation. I don’t see a scenario where including other services’ disk utilization would improve the cache cleanup behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The biggest reason is backward compatibility. Other than that, I agree that we don't need the option.
As described in #385, the aggressive cache cleanup must be configurable to only consider how much % disk only Kraken uses, when deciding whether to clean the cache.
exclude_other_services
config option