Low priority Python execution

A data acquisition system typically runs multiple programs simultaneously:

  1. High-priority data collection - a program driving high data bandwidth acquisition
  2. Low-priority monitoring tools - check system status or process data
  3. Low-priority services - web servers displaying processed results

Properly prioritizing these processes ensures the critical data collection isn’t interrupted by secondary tasks.

Suppose a Python script “preview.py” is monitoring a camera’s status and needs to run at low priority.

On Unix-like systems (Linux, macOS, BSD, …) use nice to control process priority.

nice -n 19 python preview.py
nice -n
run task(s) with priority, where bigger positive numbers are lower priority, and more negative numbers are higher priority.

On Windows the start command can control program run priority.

start /low python preview.py
start /low
runs a program and its child processes at low priority.