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

Support for Horizontal Scaling Across Components (API, Worker, Sandbox) #11902

Open
4 tasks done
NiuBlibing opened this issue Dec 20, 2024 · 1 comment
Open
4 tasks done
Labels
📚 documentation Improvements or additions to documentation

Comments

@NiuBlibing
Copy link
Contributor

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Provide a description of requested docs changes

I notice The documentation only provides guidance on vertical scaling by configuring SERVER_WORKER_AMOUNT for Gunicorn and CELERY_WORKER_AMOUNT for Celery. However, it is unclear whether Dify supports horizontal scaling for its components (API, Worker, Sandbox).

Could you clarify if these components support running multiple instances to achieve horizontal scaling? If so, are there any specific configurations or considerations we need to account for?

Copy link

dosubot bot commented Dec 20, 2024

I found a similar discussion titled "How to scale up the dify deployment," which is currently unsolved [1].

Regarding your question about horizontal scaling for Dify components (API, Worker, Sandbox), the Dify codebase does include configurations and tools that support horizontal scaling:

  1. Configuration Files: The pm2.json file specifies a clustered mode with two instances, indicating support for horizontal scaling [2].

  2. Environment Variables: There are specific environment variables for optimizing horizontal scaling:

    • SERVER_WORKER_AMOUNT and CELERY_WORKER_AMOUNT for setting the number of workers.
    • CELERY_AUTO_SCALE for enabling autoscaling of Celery workers [3].
  3. Load Balancing: The documentation mentions a "Round-robin" load balancing strategy by default [4].

  4. Container Orchestration: Dify supports deployment on Kubernetes using Helm Charts or YAML files, which facilitates horizontal scaling [5].

  5. Distributed Systems: The use of PostgreSQL and Redis for distributed data storage and caching supports horizontal scaling [6].

These elements indicate that Dify does support horizontal scaling across its components, and you can leverage these configurations and tools to achieve it.

To continue talking to Dosu, mention @dosu.


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

@dosubot dosubot bot added the 📚 documentation Improvements or additions to documentation label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📚 documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant