Langflow's CPU usage reaches 100%, causing the system to become sluggish
Bug Description
After Langflow is deployed in the production environment and used by several different projects, it has been observed that 1 to 2 hours after startup, Langflow's CPU usage reaches 100%, causing the system to become sluggish. I'm not sure whether this is caused by a Langflow issue or a workflow/flow design problem.
Langflow version = "1.4.2"
cpu top:
py-spy record:
The CPU usage started to rise from 18:28. log:
Reproduction
I'm still unclear about the triggering conditions and don't know how to reproduce the issue. There is a suggestion that upgrading 'anyio|httpx|aiohttp|mcp' might resolve it.
Expected behavior
The phenomenon and logs have already been described above.
Who can help?
No response
Operating System
Debian GNU/Linux 12 (bookworm) in k8s
Langflow Version
1.4.2
Python Version
3.12
Screenshot
No response
Flow File
No response
did you use langfuse? i found langflow langfuse code logic had thread leak resulting in 100% CPU usage
Thank you for your reply. I didn't use Langfuse - I checked the environment variables.
@borderlayout Does the problem persist in 1.5.0post2?
I had a memory leak and some version migration and I managed to solve it by doing a fresh install (if I'm not mistaken, it was on version 1.4.0). Since then, I haven't had this problem again.
I haven't tested it on version 1.5.0.post2 yet—only on 1.4.2.2. It seems the issue might be related to MCP SSE, but I'm not entirely sure. The specific trigger function and workflow aren't clear yet — sometimes it doesn't occur for many days, while other times it hits cpu100% immediately after startup.