Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Anton-Kalpakchiev
Copy link
Collaborator

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.

  • Add this ability through the exclude_other_services config option
  • In addition to the already present metrics on the abs amount of bytes used by Kraken, emit metrics on the disk util %

testStats := tally.NewTestScope("", map[string]string{})
m.clean(testStats, config, op)
snapshot := testStats.Snapshot()
usageGauge, ok := snapshot.Gauges()["disk_usage+"]
Copy link
Collaborator Author

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?


// 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) {
Copy link
Collaborator Author

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.
Copy link
Collaborator

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.

Copy link
Collaborator Author

@Anton-Kalpakchiev Anton-Kalpakchiev Nov 29, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants