improve results directory purging to prevent stalls

so far when hitting the results directory threshold only few,
often just one, results were purged which basically triggered
another purge on the very next request rather often

as purge processing takes quite some time with large result
directories (somehting that needs solving, too, at a later time)
being near the threshold size could lead to substantial stalls
between individual render requests being processed

now purging will remove more results at a time, bringing the
directory size down to 90% of the threshold size whenever the
threshold is exceeded, and actual purge runs happen less often
user-mgmt
Hartmut Holzgraefe 2022-03-27 13:14:24 +02:00
rodzic 9e1a180ff1
commit 65118b15aa
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -227,7 +227,7 @@ class RenderingsGarbageCollector:
LOG.info("Cleanup processing file list")
iterations = 0
previous_job_id = 0
while size > threshold:
while size > ( 0.9 * threshold):
if iterations > RENDERING_RESULT_MAX_PURGE_ITERATIONS:
LOG.info("%d delete iterations done, pausing until next invocation" % RENDERING_RESULT_MAX_PURGE_ITERATIONS)
break