Skip to content
This repository was archived by the owner on Nov 29, 2021. It is now read-only.

Queue wait time - #401

Merged
bjoernricks merged 7 commits into
greenbone:ospd-20.08from
jjnicola:queue-wait-time
May 26, 2021
Merged

Queue wait time#401
bjoernricks merged 7 commits into
greenbone:ospd-20.08from
jjnicola:queue-wait-time

Conversation

@jjnicola

Copy link
Copy Markdown
Member

What:
Wait a minute between scans starts.

Why:
Currently the queue system in ospd prevents to start a new scan if there is not enough available memory. This produces that new scans are put in the queue, while the memory condition is not satisfied.
Once some memory is released, all scans in queue are started. In the issue mentioned above, I pasted what I found in the log.

How:

  • Set min_free_mem_scan_queue option to some value, to avoid starting scans.
  • Start many task
  • release memory to allow queued scans to start.
  • Check in the log that the time between takes about a minute, and the queued scans are not started all together.

Checklist:

jjnicola added 4 commits May 20, 2021 14:51
Currently the queue system in ospd prevents to start a new scan if there is not enough available memory. This produces that new scans are put in the queue, while the memory condition is not satisfied.
Once some memory is released, all scans in queue are started. In the issue mentioned above, I pasted what I found in the log.

This avoids ospd to start many queued scans simultaneously. So the last started scan has time enough to take some memory (launch some child processes).
…queue option

It doesn't make sense to wait time if the option is disabled.
Also, use global definition for the waiting time in seconds.
Could be possible that there last scan finished in a few seconds.
Therefore check for running scans.
Although, enough available memory is still a conditional, if enabled.
@codecov

codecov Bot commented May 20, 2021

Copy link
Copy Markdown

Codecov Report

Merging #401 (8687776) into ospd-20.08 (11395cd) will increase coverage by 0.13%.
The diff coverage is 100.00%.

Impacted file tree graph

@@              Coverage Diff               @@
##           ospd-20.08     #401      +/-   ##
==============================================
+ Coverage       74.41%   74.55%   +0.13%     
==============================================
  Files              23       23              
  Lines            2627     2641      +14     
==============================================
+ Hits             1955     1969      +14     
  Misses            672      672              
Impacted Files Coverage Δ
ospd/ospd.py 72.31% <100.00%> (+0.57%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 11395cd...8687776. Read the comment docs.

@jjnicola
jjnicola marked this pull request as ready for review May 20, 2021 14:10
@jjnicola
jjnicola requested a review from bjoernricks as a code owner May 20, 2021 14:10
@bjoernricks
bjoernricks requested review from a team and removed request for bjoernricks May 24, 2021 13:25
@bjoernricks
bjoernricks enabled auto-merge May 24, 2021 13:26
@jjnicola jjnicola added backport-to-stable This pull request will be backported to the stable branch backport-to-main This pull request will be backported to the master branch labels May 25, 2021
@bjoernricks
bjoernricks merged commit 64d0b3c into greenbone:ospd-20.08 May 26, 2021
jjnicola added a commit that referenced this pull request May 26, 2021
jjnicola added a commit that referenced this pull request May 26, 2021
jjnicola added a commit that referenced this pull request May 26, 2021
@jjnicola
jjnicola deleted the queue-wait-time branch October 15, 2021 09:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

backport-to-main This pull request will be backported to the master branch backport-to-stable This pull request will be backported to the stable branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants