Skip to content

Title: fix: psutil.cpu_percent(interval=1) blocks FastAPI async event loop #1336

Description

@sushantguri

psutil.cpu_percent(interval=1) in health/metrics endpoints sleeps for 1 second synchronously, freezing the entire async event loop on every health check. Fix: use interval=None + asyncio.to_thread().

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions