langflow icon indicating copy to clipboard operation
langflow copied to clipboard

Langflow's CPU usage reaches 100%, causing the system to become sluggish

Open borderlayout opened this issue 8 months ago • 4 comments

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: Image

py-spy record: Image

The CPU usage started to rise from 18:28. log:

langflow_error.txt

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

borderlayout avatar Aug 20 '25 04:08 borderlayout

did you use langfuse? i found langflow langfuse code logic had thread leak resulting in 100% CPU usage

jeevic avatar Aug 24 '25 15:08 jeevic

Thank you for your reply. I didn't use Langfuse - I checked the environment variables. Image

Image

borderlayout avatar Aug 27 '25 11:08 borderlayout

@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.

Empreiteiro avatar Sep 25 '25 18:09 Empreiteiro

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.

borderlayout avatar Nov 10 '25 08:11 borderlayout