Skip to content

[feature] Space out checks over time, to avoid CPU- and memory-usage spikes #3178

Open
@dnngll

Description

@dnngll

Version and OS
changedetection.io:0.49.7 and sockpuppetbrowser:0.0.1 on Rocky Linux/Docker

Is your feature request related to a problem? Please describe.
Yes. When restarting the container, all (due) watches are checked right away and at the same time (until FETCH_WORKERS is reached). This leads to CPU- and memory-usage spikes:

Image

Describe the solution you'd like
I would love to have an option like "space out checks over time". Maybe only affecting the watches, that are using the default "Time Between Check"? Or even adjustable per watch? Or randomly, but within the "Time Between Check"?

Describe the use-case and give concrete real-world examples
To avoid the above, right now I am setting FETCH_WORKERS=1. My default "Time Between Check" is at 10 minutes. After (re)starting the service, all due checks are done at the beginning, one after another. This doesn't slow down the system to much, but is still not optimal: There will be a problem, once the sum of the duration of all checks is greater than the "Time Between Check".

A better solution would be an option like "space out checks over time":

Example 1. Assuming:

  • The default "Time Between Check" is set to 10 minutes
  • 10 watches use the default "Time Between Check"
  • FETCH_WORKERS=1
    One check would start at the beginning of minute 1, 2, 3, 4, 5, 6, 7, 8, 9 and 10

Example 2. Assuming:

  • The default "Time Between Check" is set to 10 minutes
  • 10 watches use the default "Time Between Check"
  • FETCH_WORKERS=2
    Two checks would start at the beginning of minute 1, 3, 5, 7, and 9

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions