strix

A simple web UI for motion
git clone https://www.brianlane.com/git/strix
Log | Files | Refs | LICENSE

commit 9cfa9aa1c80106f0a1b4bebcef9212e32e868f3a
parent ae6da7226f443681727a0828df1f49e57ef9a331
Author: Brian C. Lane <bcl@brianlane.com>
Date:   Sat, 25 Apr 2020 14:55:49 -0700

Change queue limit to 1/2 cpus

Diffstat:
Msrc/strix/queue.py | 5++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/strix/queue.py b/src/strix/queue.py @@ -110,9 +110,8 @@ def monitor_queue(logging_queue: mp.Queue, base_dir: str, quit: mp.Event) -> Non log.debug("queue check", queue_path=queue_path) for event_file in glob(os.path.join(queue_path, "*")): - # Limit the number of processes - if len(threads) > mp.cpu_count(): - log.debug("Too many running threads (%d), not adding a new one yet.", len(threads)) + # Limit the number of processes to 1/2 the number of cpus (or 1) + if len(threads) >= max(1, mp.cpu_count() // 2): break os.unlink(event_file)