API request unresponsive #12761

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

Originally created by @slajdfk on GitHub (Apr 10, 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.2.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

API:/datasets/{dataset_id}/documents/{document_id}/segments
this's api requests remain unresponsive for a long time ,and The CPU of docker-apiI will also be very high.

logs:
/app/api/services/app_service.py:203: SAWarning: This declarative base already contains a class with the same class name and module name as services.app_service.ModifiedApp, and will be replaced in the string-lookup table.

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @slajdfk on GitHub (Apr 10, 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.2.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce API:/datasets/{dataset_id}/documents/{document_id}/segments this's api requests remain unresponsive for a long time ,and The CPU of docker-apiI will also be very high. logs: /app/api/services/app_service.py:203: SAWarning: This declarative base already contains a class with the same class name and module name as services.app_service.ModifiedApp, and will be replaced in the string-lookup table. ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 19:08:54 -05:00
yindo closed this issue 2026-02-21 19:08:54 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 10, 2025):

Hey there, @slajdfk! 👋 I'm Dosu, your friendly bot here to help you tackle bugs, answer questions, and become a contributor while we wait for a human maintainer. Let's get this sorted out!

I found some relevant information that might help address the issue of unresponsive API requests in Dify:

  1. High CPU Usage: One common cause of high CPU usage in Dify's Docker setup is the langfuse_client not shutting down automatically after API calls. To resolve this, ensure that you explicitly call the shutdown method on the langfuse_client after each interface call completes [1].

  2. Unresponsive API Requests: Multiple LLM API requests pending, especially with slow LLM connections, can cause the management web UI to become unresponsive. Upgrading to Dify version 1.2.0 is recommended to resolve console API hanging issues, as this version includes performance improvements [2].

  3. SAWarning in Logs: Although I couldn't find a specific solution for the SAWarning related to the declarative base in the logs, it might be worth investigating if this warning is contributing to the unresponsiveness.

Additionally, you might want to check similar discussions for more insights:

These discussions might provide additional context or solutions that could be applicable to your situation.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Apr 10, 2025): <!-- Greeting --> Hey there, @slajdfk! 👋 I'm [Dosu](https://dosu.dev), your friendly bot here to help you tackle bugs, answer questions, and become a contributor while we wait for a human maintainer. Let's get this sorted out! <!-- Answer --> I found some relevant information that might help address the issue of unresponsive API requests in Dify: 1. **High CPU Usage**: One common cause of high CPU usage in Dify's Docker setup is the `langfuse_client` not shutting down automatically after API calls. To resolve this, ensure that you explicitly call the shutdown method on the `langfuse_client` after each interface call completes <sup>[[1]](https://github.com/langgenius/dify/issues/12496)</sup>. 2. **Unresponsive API Requests**: Multiple LLM API requests pending, especially with slow LLM connections, can cause the management web UI to become unresponsive. Upgrading to Dify version 1.2.0 is recommended to resolve console API hanging issues, as this version includes performance improvements <sup>[[2]](https://github.com/langgenius/dify/issues/17710)</sup>. 3. **SAWarning in Logs**: Although I couldn't find a specific solution for the SAWarning related to the declarative base in the logs, it might be worth investigating if this warning is contributing to the unresponsiveness. Additionally, you might want to check similar discussions for more insights: - [The API service that uses DIFY uses the streaming stream, but the result is that it waits for a long time to return at the same time, what is the reason for this?](https://github.com/langgenius/dify/discussions/13700) <sup>[[3]](https://github.com/langgenius/dify/discussions/13700)</sup> - [The HTTP request node responds slowly](https://github.com/langgenius/dify/discussions/8521) <sup>[[4]](https://github.com/langgenius/dify/discussions/8521)</sup> These discussions might provide additional context or solutions that could be applicable to your situation. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/c138773d-6ed2-44b9-a864-dfeac61fca7f?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/c138773d-6ed2-44b9-a864-dfeac61fca7f?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/c138773d-6ed2-44b9-a864-dfeac61fca7f?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/c138773d-6ed2-44b9-a864-dfeac61fca7f?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/c138773d-6ed2-44b9-a864-dfeac61fca7f?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/c138773d-6ed2-44b9-a864-dfeac61fca7f?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/c138773d-6ed2-44b9-a864-dfeac61fca7f?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Apr 10, 2025):

How big is your single table data? Afaik, it won't affect the performance for now.

@crazywoola commented on GitHub (Apr 10, 2025): How big is your single table data? Afaik, it won't affect the performance for now.
Author
Owner

@slajdfk commented on GitHub (Apr 10, 2025):

你的单表数据量有多大?据我所知,目前不会影响性能。

I upgraded from version 1.1.3 to 1.2.0. The previous data was around 100000, but the API was running normally. After upgrading to 1.2.0, this API request did not respond, while several other APIs were tested and found to be successful
@crazywoola

@slajdfk commented on GitHub (Apr 10, 2025): > 你的单表数据量有多大?据我所知,目前不会影响性能。 I upgraded from version 1.1.3 to 1.2.0. The previous data was around 100000, but the API was running normally. After upgrading to 1.2.0, this API request did not respond, while several other APIs were tested and found to be successful @crazywoola
Author
Owner

@crazywoola commented on GitHub (Apr 11, 2025):

fix segment query index not effect (#17704)
revert batch query (#14770

It might related to the PR before these 2 commits.

Should be fixed in next version.

@crazywoola commented on GitHub (Apr 11, 2025): fix segment query index not effect (#17704) revert batch query (#14770 It might related to the PR before these 2 commits. Should be fixed in next version.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#12761