<@ULVA73B9P> sometime my prefect UI drains my comp...
# ask-marvin
c
@Marvin sometime my prefect UI drains my computer resources. How to minimize this?
m
thought for 267.8 seconds
Got it — high CPU/memory in the UI usually comes from live updates (events/logs) and heavy graph rendering while a page is open. Here are practical ways to reduce it right away, plus server-side tweaks if you self-host. Quick wins in the browser - Keep only one Prefect tab open; multiple tabs multiply polling/streams. - Prefer Summary/Details tabs over Graph/Timeline and Logs for long/complex runs. - Filter lists (e.g., “Last 24h”, fewer states) to reduce rows shown. - If you see a “Live” toggle in the header or page, turn it off while inspecting to pause updates. - Avoid tailing large logs in the UI; use CLI instead:
Copy code
prefect logs <flow-run-id> --follow
- Reduce log volume in flows when possible (avoid
log_prints=True
unless needed, lower log level). If you self-host Prefect Server (3.x) - Disable live event streaming to browsers (biggest impact):
Copy code
export PREFECT_SERVER_EVENTS_STREAM_OUT_ENABLED=false
- Cut WebSocket backfill size/time so the browser receives less on connect:
Copy code
export PREFECT_SERVER_EVENTS_WEBSOCKET_BACKFILL_PAGE_SIZE=100
  export PREFECT_SERVER_EVENTS_MAXIMUM_WEBSOCKET_BACKFILL=PT5M
- Slow down server background loops (less CPU churn):
Copy code
export PREFECT_SERVER_SERVICES_SCHEDULER_LOOP_SECONDS=120
  export PREFECT_SERVER_SERVICES_FOREMAN_LOOP_SECONDS=30
  export PREFECT_SERVER_SERVICES_LATE_RUNS_LOOP_SECONDS=10
- Optional (UI-only environments): disable non-essential services
Copy code
export PREFECT_SERVER_SERVICES_SCHEDULER_ENABLED=false
  export PREFECT_SERVER_SERVICES_LATE_RUNS_ENABLED=false
  export PREFECT_SERVER_SERVICES_EVENT_PERSISTER_ENABLED=false
- Then restart your Prefect Server process so settings take effect. General - Upgrade to the latest Prefect 3.x for ongoing UI performance improvements. - Keep one team page open at a time during heavy periods. A couple questions so I can tailor this: - Are you using Prefect Cloud UI or a self-hosted Prefect Server UI? - Which pages spike usage (Dashboard, Runs list, a specific flow run with heavy logs/graph)? - Roughly how many runs/log lines are visible when you notice the slowdown? - Which browser/OS? (I can suggest browser-specific tweaks if helpful.) If you’re self-hosting on RHEL9 and want, I can share a ready-to-drop systemd unit/env file that applies the low-resource settings above.