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

✨ Reaper optimization. #676

Merged
merged 2 commits into from
Jun 26, 2024
Merged

✨ Reaper optimization. #676

merged 2 commits into from
Jun 26, 2024

Conversation

jortel
Copy link
Contributor

@jortel jortel commented Jun 26, 2024

The default reaper frequency is (1) minute.

The reapers are performing 3-4 queries for every file and bucket evaluated for reaping. With the addition of attaching files to tasks and task-reports, the number of files has increased substantially. The current algorithm will run 3-4 queries for each resource evaluated.

For example: A deployment with 2000 analyzed applications can have ~25,000 files. To evaluate 4 resources for references (Task, TaskGroup, Rule, Target) resulted in 100,000 queries each reaper run.

This PR each run (default: 1/ minute) :

  • FileReaper will run exactly 4 queries.
  • BucketReaper will run exactly 3 queries.

Signed-off-by: Jeff Ortel <jortel@redhat.com>
for _, m := range []any{
&model.Task{},
&model.TaskReport{},
&model.RuleSet{},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hint: RuleSet removed because it does not have file references.

Signed-off-by: Jeff Ortel <jortel@redhat.com>
Copy link
Collaborator

@mansam mansam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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