Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting frequent Server is busy messages #3812

Closed
codenprogressive opened this issue Sep 14, 2024 · 4 comments
Closed

Getting frequent Server is busy messages #3812

codenprogressive opened this issue Sep 14, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@codenprogressive
Copy link

Bug Description

I have a simple flow, it takes a chat input do some processing (to reproduce the issue, time.sleep 15sec), then output the message. While the flow is building I get the popup message server is busy . not sure how to increase triggering the timeout message.

image

image

Reproduction

use the attached flow to reproduce the issue.

Expected behavior

the flow builds without poping up the server busy message.

Who can help?

@Cristhianzl @lucaseduoli

Operating System

Ubuntu

Langflow Version

1.0.17

Python Version

3.10

Screenshot

No response

Flow File

timeout_server_busy.json

@codenprogressive codenprogressive added the bug Something isn't working label Sep 14, 2024
Copy link

dosubot bot commented Sep 14, 2024

The "Server is busy" message you're encountering is likely due to the default timeout setting for server requests in Langflow, which is set to 60 seconds. Given that your flow includes a time.sleep(15) call, it might be causing the server to reach its timeout limit, especially if there are multiple such requests or other processes running concurrently.

To address this issue, you can increase the server timeout duration by using the --timeout option when running Langflow. For example, you can set the timeout to 120 seconds as follows:

langflow run --timeout 120

This will extend the worker timeout to 120 seconds, which should help in handling longer-running tasks without triggering the "server is busy" message [1].

Additionally, consider optimizing your flow to handle long-running tasks more efficiently. Langflow supports asynchronous processing, which can help in managing server load and preventing timeouts. You can use the sync flag set to false in your API requests to process tasks asynchronously:

curl -X POST \
  http://localhost:3000/api/v1/process/<your_flow_id> \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: <your_api_key>' \
  -d '{"inputs": {"text": ""}, "tweaks": {}, "sync": false}'

This will allow the server to handle the task asynchronously, freeing up resources for other requests [2].

By increasing the timeout and utilizing asynchronous processing, you should be able to mitigate the "server is busy" messages and improve the overall performance of your flow.

To continue talking to Dosu, mention @dosu.

@codenprogressive
Copy link
Author

I'm already putting worker --timeout to 300. this is not avoiding the server is busy to pop up!

@carlosrcoelho
Copy link
Contributor

@codenprogressive

Have you tried using the version 1.0.18?

We had this problem in version .17, which was fixed in .18.

@codenprogressive
Copy link
Author

yes I upgraded to 1.0.18 and this bug was fixed. thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants