LLM node execution is slow #14576

Closed
opened 2026-02-21 19:17:52 -05:00 by yindo · 4 comments
Owner

Originally created by @htk949 on GitHub (Jun 12, 2025).

Self Checks

  • 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 (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.4.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

1.LLM node calls model execution for 4 seconds

Image

2.Use code or curl to call the model and execute it within 1 second

Image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @htk949 on GitHub (Jun 12, 2025). ### Self Checks - [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 (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.4.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1.LLM node calls model execution for 4 seconds ![Image](https://github.com/user-attachments/assets/7dcffc62-8939-4914-94af-a8319660a6f4) 2.Use code or curl to call the model and execute it within 1 second ![Image](https://github.com/user-attachments/assets/da96a615-13aa-4f26-8d61-2dc42bf2d9ab) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the performance label 2026-02-21 19:17:52 -05:00
yindo closed this issue 2026-02-21 19:17:52 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jun 12, 2025):

The extra delay you see with LLM node execution in Dify (compared to direct model calls) is a known issue and comes from several sources. Dify’s workflow engine adds orchestration layers—like context/memory fetching, variable handling, event emission, and support for multimodal data—which all add overhead compared to a direct API call. In self-hosted Docker setups, network overhead, plugin service calls, and large prompt data (like images or long texts) can further slow things down. There are also reports that frequent service-to-service calls and high CPU load on plugin services can cause significant delays, sometimes several seconds per call (source).

To improve performance, try these: use smaller or quantized models, optimize your workflow to remove unnecessary steps, monitor and tune your Docker/container resources, and check for large prompt payloads that might be causing bottlenecks. If you use plugins, make sure their services are healthy and not overloaded. You can also try adjusting timeout and worker settings in your Docker and environment configs (source). If you’re running in dev mode, switch to production mode for better speed (source).

If you want more targeted advice, sharing your Docker and workflow configuration details could help pinpoint the main bottleneck.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Jun 12, 2025): <!-- Answer --> The extra delay you see with LLM node execution in Dify (compared to direct model calls) is a known issue and comes from several sources. Dify’s workflow engine adds orchestration layers—like context/memory fetching, variable handling, event emission, and support for multimodal data—which all add overhead compared to a direct API call. In self-hosted Docker setups, network overhead, plugin service calls, and large prompt data (like images or long texts) can further slow things down. There are also reports that frequent service-to-service calls and high CPU load on plugin services can cause significant delays, sometimes several seconds per call ([source](https://github.com/langgenius/dify/issues/19467)). To improve performance, try these: use smaller or quantized models, optimize your workflow to remove unnecessary steps, monitor and tune your Docker/container resources, and check for large prompt payloads that might be causing bottlenecks. If you use plugins, make sure their services are healthy and not overloaded. You can also try adjusting timeout and worker settings in your Docker and environment configs ([source](https://github.com/langgenius/dify/issues/17921)). If you’re running in dev mode, switch to production mode for better speed ([source](https://github.com/langgenius/dify/issues/15089)). If you want more targeted advice, sharing your Docker and workflow configuration details could help pinpoint the main bottleneck. <!-- 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/a50ea021-2f38-4d74-ba08-d736ec2305ac?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/a50ea021-2f38-4d74-ba08-d736ec2305ac?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/a50ea021-2f38-4d74-ba08-d736ec2305ac?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/a50ea021-2f38-4d74-ba08-d736ec2305ac?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/a50ea021-2f38-4d74-ba08-d736ec2305ac?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/a50ea021-2f38-4d74-ba08-d736ec2305ac?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/a50ea021-2f38-4d74-ba08-d736ec2305ac?feedback_type=other)</sup>&nbsp;&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/20950)
Author
Owner

@xiangyue520 commented on GitHub (Jun 12, 2025):

+1,but use chat assistant,same workspace app
it's very fast in 1.1.3 (abount 3s),but upgrade to 1.4.1(about 6s)

time in 1.1.3
Image

Image

time in 1.4.1

Image Image
@xiangyue520 commented on GitHub (Jun 12, 2025): +1,but use chat assistant,same workspace app it's very fast in 1.1.3 (abount 3s),but upgrade to 1.4.1(about 6s) time in 1.1.3 <img width="635" alt="Image" src="https://github.com/user-attachments/assets/5fabb3e9-355a-4866-90fc-75c416b2e629" /> <img width="598" alt="Image" src="https://github.com/user-attachments/assets/3b01dc30-da37-42ae-9800-98c09d642608" /> time in 1.4.1 <img width="631" alt="Image" src="https://github.com/user-attachments/assets/1c65ce9e-b347-4b67-98d5-7c26d1b1ebeb" /> <img width="626" alt="Image" src="https://github.com/user-attachments/assets/6abad622-07aa-48d6-8ae2-a5085034a985" />
Author
Owner

@htk949 commented on GitHub (Jun 19, 2025):

@xiangyue520 @dosu
Solution:

  1. Check the TCP connection establishment and SSL handshake time. If the time is too long, it is a problem with slow DNS resolution of domain names
    curl -w "Time: %{time_total}, Connect: %{time_connect}, AppConnect: %{time_appconnect}\n" -o /dev/null -s https://open.bigmodel.cn/api/paas/v4/chat/completions
  2. Manually parse the model address and edit/etc/hosts
    sudo vim /etc/hosts

Add the following model addresses
#Zhipu AI
60.205.172.105 open.bigmodel.cn
#Silicon based flow
47.102.37.23 api.siliconflow.cn
#Volcano
101.126.30.253 ark.cn-beijing.volces.com
#GPT model
46.3.100.72 api.openai-sb.com
#Qian Wen
8.141.18.184 dashscope.aliyuncs.com

@htk949 commented on GitHub (Jun 19, 2025): @xiangyue520 @dosu Solution: 1. Check the TCP connection establishment and SSL handshake time. If the time is too long, it is a problem with slow DNS resolution of domain names `curl -w "Time: %{time_total}, Connect: %{time_connect}, AppConnect: %{time_appconnect}\n" -o /dev/null -s https://open.bigmodel.cn/api/paas/v4/chat/completions` 2. Manually parse the model address and edit/etc/hosts `sudo vim /etc/hosts` Add the following model addresses #Zhipu AI 60.205.172.105 open.bigmodel.cn #Silicon based flow 47.102.37.23 api.siliconflow.cn #Volcano 101.126.30.253 ark.cn-beijing.volces.com #GPT model 46.3.100.72 api.openai-sb.com #Qian Wen 8.141.18.184 dashscope.aliyuncs.com
Author
Owner

@xiangyue520 commented on GitHub (Jun 19, 2025):

is there has break change?i use same workflow app just different dify version,so i can't understand why,maybe need check code,and model use volcengine maas

---Original---
From: @.>
Date: Thu, Jun 19, 2025 16:27 PM
To: @.
>;
Cc: @.@.>;
Subject: Re: [langgenius/dify] LLM node execution is slow (Issue #20950)

htk949 left a comment (langgenius/dify#20950)

@xiangyue520 @Dusu
Solution:

Check the TCP connection establishment and SSL handshake time. If the time is too long, it is a problem with slow DNS resolution of domain names
curl -w "Time: %{time_total}, Connect: %{time_connect}, AppConnect: %{time_appconnect}\n" -o /dev/null -s https://open.bigmodel.cn/api/paas/v4/chat/completions

Manually parse the model address and edit/etc/hosts
sudo vim /etc/hosts
Add the following model addresses
#Zhipu AI
60.205.172.105 open.bigmodel.cn
#Silicon based flow
47.102.37.23 api.siliconflow.cn
#Volcano
101.126.30.253 ark.cn-beijing.volces.com
#GPT model
46.3.100.72 api.openai-sb.com
#Qian Wen
8.141.18.184 dashscope.aliyuncs.com


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: @.***>

@xiangyue520 commented on GitHub (Jun 19, 2025): is there has break change?i use same workflow app just different dify version,so i can't understand why,maybe need check code,and model use volcengine maas ---Original--- From: ***@***.***&gt; Date: Thu, Jun 19, 2025 16:27 PM To: ***@***.***&gt;; Cc: ***@***.******@***.***&gt;; Subject: Re: [langgenius/dify] LLM node execution is slow (Issue #20950) htk949 left a comment (langgenius/dify#20950) @xiangyue520 @Dusu Solution: Check the TCP connection establishment and SSL handshake time. If the time is too long, it is a problem with slow DNS resolution of domain names curl -w "Time: %{time_total}, Connect: %{time_connect}, AppConnect: %{time_appconnect}\n" -o /dev/null -s https://open.bigmodel.cn/api/paas/v4/chat/completions Manually parse the model address and edit/etc/hosts sudo vim /etc/hosts Add the following model addresses #Zhipu AI 60.205.172.105 open.bigmodel.cn #Silicon based flow 47.102.37.23 api.siliconflow.cn #Volcano 101.126.30.253 ark.cn-beijing.volces.com #GPT model 46.3.100.72 api.openai-sb.com #Qian Wen 8.141.18.184 dashscope.aliyuncs.com — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: ***@***.***&gt;
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#14576