This directory contains helper scripts to simplify the deployment and management of ComfyStream:
- Ansible Playbook (
ansible/plays/setup_comfystream.yml) – Deploys ComfyStream on any cloud provider. monitor_pid_resources.py: Monitors and profiles the resource usage of a running ComfyStream server.
This repository provides an Ansible playbook to streamline the deployment of ComfyStream across any cloud provider. For comprehensive setup instructions, see the Ansible section in the ComfyStream Installation Guide.
To monitor the resource consumption of a running ComfyStream server, use the monitor_pid_resources.py script:
-
Start the ComfyStream server and execute a streaming workflow.
-
Run the profiling script:
python monitor_pid_resources.py --name app.py
The script will automatically try to find the process ID (PID) of the server. If you prefer to specify the PID manually, you can retrieve it using:
pgrep -f app.py | xargs ps -o pid,cmd --pidThen run the profiling script with the retrieved PID:
python monitor_pid_resources.py --pid <PID>
-
Running Inside a Container: If you are running the script inside a container, use the
--host-pidoption to provide the host PID for accurate GPU monitoring:python monitor_pid_resources.py --name app.py --host-pid <HOST_PID>
Find
<HOST_PID>withnvidia-smion the host.
The script will continuously track CPU and memory usage at specified intervals. If the --spy flag is used, it will also generate a detailed Py-Spy profiler report for deeper performance insights.
For a complete list of available options, run:
python monitor_pid_resources.py --help