Open zhang001122 opened 2 weeks ago
Hello, @zhang001122! I'm here to help you with any bugs, questions, or contributions you have for the repository. Let's work together to resolve this issue.
The "docker-db-1 requests overflow" error after 30 requests in Dify version 0.6.13 is likely due to the database connection pool size configuration. In the provided .env.example
file, the SQLALCHEMY_POOL_SIZE
is set to 30:
# The size of the database connection pool.
# The default is 30 connections, which can be appropriately increased.
SQLALCHEMY_POOL_SIZE=30
This means that the database connection pool can handle up to 30 connections simultaneously. If the number of API requests exceeds this limit, additional requests will be queued or fail, leading to the "requests overflow" error.
To resolve this, you can increase the SQLALCHEMY_POOL_SIZE
value to a higher number to accommodate more simultaneous connections. For example:
SQLALCHEMY_POOL_SIZE=50
Additionally, you might want to check other related configurations in the docker-compose.yaml
file, such as SQLALCHEMY_POOL_RECYCLE
and SERVER_WORKER_AMOUNT
, to ensure they are optimized for your use case. For example:
# Database connection pool recycling time, the default is 3600 seconds.
SQLALCHEMY_POOL_RECYCLE: ${SQLALCHEMY_POOL_RECYCLE}
# The number of API server workers, i.e., the number of gevent workers.
# Formula: number of cpu cores x 2 + 1
SERVER_WORKER_AMOUNT: ${SERVER_WORKER_AMOUNT}
This change should help mitigate the "requests overflow" error by allowing more concurrent database connections and optimizing the server worker configuration [1][2].
To continue talking to Dosu, mention @dosu.
i have tried your method, while is not work well the error is IF YOUR SYSTEM treat each requests as a new connection to the database, this will cause a BIG BIG PROBLEM IN YOUR SYSTEM , please solve it ASAP
@takatost, this one's a bit out of my wheelhouse, could you step in and provide your guidance?
To continue talking to Dosu, mention @dosu.
Self Checks
Dify version
0.6.13
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
✔️ Expected Behavior
api requests on dify0.6.13
❌ Actual Behavior
api requests fail after 30 requests