GitHub Repo
Dify Community Reports Retrieval Connection Exhaustion, Which May Produce Answers Without Citing the Knowledge Base Under High Concurrency
On November 14, the Dify community reported that knowledge retrieval may hold SQL connections while waiting for the embedding model and vector database, potentially causing timeouts or skipped retrieval. The report includes comparative tests in a self-hosted environment, but maintainers have yet to confirm the issue or provide an official fix.

A new report on Dify’s GitHub raises concerns about the reliability of RAG responses: under high concurrency, requests may exhaust the database connection pool, and some chat requests may still return answers without using the attached knowledge base. The author tested Docker self-hosted version 1.19.0 on November 14 and said the issue affects knowledge retrieval paths in both chat applications and workflows. For now, this should be treated as a community test report; the scope of the impact remains to be confirmed. Issue and reproduction conditions
The author’s investigation found that after a retrieval thread reads a dataset, it continues to hold the same database session while waiting for the embedding model and vector search. The lower-level search thread also needs another connection. When the number of datasets being searched concurrently approaches the pool capacity, threads may each hold a connection while waiting for another one. In the report, some chat requests skipped retrieval after an error and went directly to model generation, allowing an availability issue to affect the sources behind the answers. Code path analysis
A separate report on the same day found a similar issue in the standalone knowledge base retrieval API. With 100 concurrent requests, semantic search completed only 11, 29, and 14 out of 200 requests in three runs. After ending the read transaction early, all requests completed in all three runs. However, the tests used an embedding stub endpoint with a fixed delay, and both test groups included other connection fixes, so the figures do not directly represent performance on an unmodified deployment. API comparison test
Dify’s official documentation lists defaults of 30 persistent connections and 10 additional connections, with a 30-second wait timeout. This shows that the concurrency an application accepts must be assessed alongside the database’s service capacity. Environment variables documentation SQLAlchemy’s documentation also notes that requests block and wait once the connection pool reaches its limit; allowing unlimited expansion can shift resource exhaustion to the database. Connection pool error explanation
For engineering teams, this report is a reminder that load tests should check not only success rates, but also whether answers include retrieved content and how long connections remain occupied. Teams should follow whether maintainers can reproduce the issue, whether a fix covers different retrieval strategies, and what the regression test results show in an official release.