High CPU Usage (90%+) and Sluggish UI with Knowledge Pipeline in Dify v1.10.1 fix1 #21070

Closed
opened 2026-02-21 20:10:33 -05:00 by yindo · 3 comments
Owner

Originally created by @fakerHub on GitHub (Dec 15, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.10.1 fix1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Start Dify version 1.10.1 fix1 locally
Navigate to the Knowledge Pipeline section
Create or open an existing knowledge pipeline
Perform any operation (e.g., add document, process data)
Observe CPU usage spikes to 90%(docker-api server)+ and interface lag

✔️ Expected Behavior

CPU usage should remain at reasonable levels during knowledge pipeline operations
Interface should remain responsive during pipeline processing

Actual Behavior

CPU usage spikes to over 90% when using knowledge pipeline
Page becomes very sluggish and unresponsive
Operations take significantly longer than expected

Originally created by @fakerHub on GitHub (Dec 15, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.10.1 fix1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Start Dify version 1.10.1 fix1 locally Navigate to the Knowledge Pipeline section Create or open an existing knowledge pipeline Perform any operation (e.g., add document, process data) Observe CPU usage spikes to 90%(docker-api server)+ and interface lag ### ✔️ Expected Behavior CPU usage should remain at reasonable levels during knowledge pipeline operations Interface should remain responsive during pipeline processing ### ❌ Actual Behavior CPU usage spikes to over 90% when using knowledge pipeline Page becomes very sluggish and unresponsive Operations take significantly longer than expected
yindo added the 🐞 bug label 2026-02-21 20:10:33 -05:00
yindo closed this issue 2026-02-21 20:10:33 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 15, 2025):

Hi @fakerHub! I'm Dosu and I’m helping the dify team.

High CPU usage and UI lag during Knowledge Pipeline operations in Dify v1.10.1 fix1 are caused by backend design: pipeline tasks are executed concurrently using a ThreadPoolExecutor (max_workers=10), with each task running compute-heavy operations like graph initialization, workflow execution, and document/database updates. If multiple pipelines run in parallel or the pipeline graph/data is large, CPU saturation and sluggishness can occur. Recent optimizations (like batch query improvements) may help, but the main issue is the concurrency and intensity of pipeline processing itself.

To mitigate this, consider reducing the number of concurrent pipeline threads (lower the max_workers in the ThreadPoolExecutor), limit the number of simultaneous pipeline operations, and ensure your Docker containers have sufficient CPU/memory resources. Profiling your pipeline graphs and staggering heavy operations can also help. There are no user-facing settings for this yet, so adjustments would need to be made in the backend configuration or code (see the threading and task execution logic in the pipeline task runner) [source].

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Dec 15, 2025): <!-- Greeting --> Hi @fakerHub! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> High CPU usage and UI lag during Knowledge Pipeline operations in Dify v1.10.1 fix1 are caused by backend design: pipeline tasks are executed concurrently using a ThreadPoolExecutor (max_workers=10), with each task running compute-heavy operations like graph initialization, workflow execution, and document/database updates. If multiple pipelines run in parallel or the pipeline graph/data is large, CPU saturation and sluggishness can occur. Recent optimizations (like batch query improvements) may help, but the main issue is the concurrency and intensity of pipeline processing itself. To mitigate this, consider reducing the number of concurrent pipeline threads (lower the max_workers in the ThreadPoolExecutor), limit the number of simultaneous pipeline operations, and ensure your Docker containers have sufficient CPU/memory resources. Profiling your pipeline graphs and staggering heavy operations can also help. There are no user-facing settings for this yet, so adjustments would need to be made in the backend configuration or code (see the threading and task execution logic in the pipeline task runner) [[source](https://github.com/langgenius/dify/blob/a232da564a23314ed9ad3b9da5695cb6de76b6d2/api/tasks/rag_pipeline/rag_pipeline_run_task.py#L30-L190)]. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/9fa10616-a679-4ea7-8e17-d0f9764a733f?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/9fa10616-a679-4ea7-8e17-d0f9764a733f?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/9fa10616-a679-4ea7-8e17-d0f9764a733f?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/9fa10616-a679-4ea7-8e17-d0f9764a733f?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/9fa10616-a679-4ea7-8e17-d0f9764a733f?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/9fa10616-a679-4ea7-8e17-d0f9764a733f?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/9fa10616-a679-4ea7-8e17-d0f9764a733f?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=High%20CPU%20usage%20and%20UI%20lag%20during%20Knowledge%20Pipeline%20operations%20in%20Dify%20v1.10.1%20fix1%20are%20caused%20by%20backend%20design%3A%20pipeline%20tasks%20are%20executed%20concurrently%20using%20a%20ThreadPoolExecutor%20%28max_workers%3D10%29%2C%20with%20each%20task%20running%20compute-heavy%20operations%20like%20graph%20initialization%2C%20workflow%20execution%2C%20and%20document/database%20updates.%20If%20multiple%20pipelines%20run%20in%20parallel%20or%20the%20pipeline%20graph/data%20is%20large%2C%20CPU%20saturation%20and%20sluggishness%20can%20occur.%20Recent%20optimizations%20%28like%20batch%20query%20improvements%29%20may%20help%2C%20but%20the%20main%20issue%20is%20the%20concurrency%20and%20intensity%20of%20pipeline%20processing%20itself.%0A%0ATo%20mitigate%20this%2C%20consider%20reducing%20the%20number%20of%20concurrent%20pipeline%20threads%20%28lower%20the%20max_workers%20in%20the%20ThreadPoolExecutor%29%2C%20limit%20the%20number%20of%20simultaneous%20pipeline%20operations%2C%20and%20ensure%20your%20Docker%20containers%20have%20sufficient%20CPU/memory%20resources.%20Profiling%20your%20pipeline%20graphs%20and%20staggering%20heavy%20operations%20can%20also%20help.%20There%20are%20no%20user-facing%20settings%20for%20this%20yet%2C%20so%20adjustments%20would%20need%20to%20be%20made%20in%20the%20backend%20configuration%20or%20code%20%28see%20the%20threading%20and%20task%20execution%20logic%20in%20the%20pipeline%20task%20runner%29%20%5B%5Bsource%5D%28https%3A//github.com/langgenius/dify/blob/a232da564a23314ed9ad3b9da5695cb6de76b6d2/api/tasks/rag_pipeline/rag_pipeline_run_task.py%23L30-L190%29%5D.)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/29707)
Author
Owner

@fakerHub commented on GitHub (Dec 15, 2025):

Only one pipeline is active on my end; the others are not running.

@fakerHub commented on GitHub (Dec 15, 2025): Only one pipeline is active on my end; the others are not running.
Author
Owner

@dosubot[bot] commented on GitHub (Dec 15, 2025):

Even with only one pipeline active, high CPU usage and UI lag can still happen if the pipeline is processing a large number of documents, has a complex workflow graph, or is handling resource-intensive operations. The backend processes each document or data source in parallel threads (up to 10 by default), so a single pipeline with many entities or a heavy workflow can saturate your CPU and slow down the UI. Most of the CPU load comes from initializing workflow graphs, running the pipeline logic, and updating the database for each entity processed (source).

To diagnose or mitigate this, try reducing the number of documents/data sources in the pipeline, simplifying the workflow graph, or lowering the thread pool size (max_workers) in the backend code. Profiling the backend during pipeline execution can help pinpoint which step is most resource-intensive. If you need to adjust concurrency, look for the ThreadPoolExecutor settings in the pipeline task runner.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Dec 15, 2025): <!-- Answer --> Even with only one pipeline active, high CPU usage and UI lag can still happen if the pipeline is processing a large number of documents, has a complex workflow graph, or is handling resource-intensive operations. The backend processes each document or data source in parallel threads (up to 10 by default), so a single pipeline with many entities or a heavy workflow can saturate your CPU and slow down the UI. Most of the CPU load comes from initializing workflow graphs, running the pipeline logic, and updating the database for each entity processed ([source](https://github.com/langgenius/dify/blob/4cc66524242c39aa74fb1b3afa9ae0622d5745d3/api/tasks/rag_pipeline/rag_pipeline_run_task.py#L30-L190)). To diagnose or mitigate this, try reducing the number of documents/data sources in the pipeline, simplifying the workflow graph, or lowering the thread pool size (max_workers) in the backend code. Profiling the backend during pipeline execution can help pinpoint which step is most resource-intensive. If you need to adjust concurrency, look for the ThreadPoolExecutor settings in the pipeline task runner. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/cc23edf5-2727-487a-be9d-003de8e7fdcb?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/cc23edf5-2727-487a-be9d-003de8e7fdcb?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/cc23edf5-2727-487a-be9d-003de8e7fdcb?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/cc23edf5-2727-487a-be9d-003de8e7fdcb?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/cc23edf5-2727-487a-be9d-003de8e7fdcb?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/cc23edf5-2727-487a-be9d-003de8e7fdcb?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/cc23edf5-2727-487a-be9d-003de8e7fdcb?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=Even%20with%20only%20one%20pipeline%20active%2C%20high%20CPU%20usage%20and%20UI%20lag%20can%20still%20happen%20if%20the%20pipeline%20is%20processing%20a%20large%20number%20of%20documents%2C%20has%20a%20complex%20workflow%20graph%2C%20or%20is%20handling%20resource-intensive%20operations.%20The%20backend%20processes%20each%20document%20or%20data%20source%20in%20parallel%20threads%20%28up%20to%2010%20by%20default%29%2C%20so%20a%20single%20pipeline%20with%20many%20entities%20or%20a%20heavy%20workflow%20can%20saturate%20your%20CPU%20and%20slow%20down%20the%20UI.%20Most%20of%20the%20CPU%20load%20comes%20from%20initializing%20workflow%20graphs%2C%20running%20the%20pipeline%20logic%2C%20and%20updating%20the%20database%20for%20each%20entity%20processed%C2%A0%28%5Bsource%5D%28https%3A//github.com/langgenius/dify/blob/4cc66524242c39aa74fb1b3afa9ae0622d5745d3/api/tasks/rag_pipeline/rag_pipeline_run_task.py%23L30-L190%29%29.%0A%0ATo%20diagnose%20or%20mitigate%20this%2C%20try%20reducing%20the%20number%20of%20documents/data%20sources%20in%20the%20pipeline%2C%20simplifying%20the%20workflow%20graph%2C%20or%20lowering%20the%20thread%20pool%20size%20%28max_workers%29%20in%20the%20backend%20code.%20Profiling%20the%20backend%20during%20pipeline%20execution%20can%20help%20pinpoint%20which%20step%20is%20most%20resource-intensive.%20If%20you%20need%20to%20adjust%20concurrency%2C%20look%20for%20the%20ThreadPoolExecutor%20settings%20in%20the%20pipeline%20task%20runner.)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/29707)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#21070