-
Notifications
You must be signed in to change notification settings - Fork 132
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Is there an existing issue for this?
- I have searched the existing issues
What happened?
📌 Issue Overview
The Weaviate backend client repeatedly connects and disconnects on every database operation instead of reusing a persistent connection, causing unnecessary performance overhead.
🔍 Root Cause
get_weaviate_client()callsawait client.connect()on entry andawait client.close()on exit- All Weaviate operations use
async with get_weaviate_client(), triggering a full connect/disconnect cycle per request - This occurs despite having a global client instance
🚨 Actual Behavior
- A new connection is established for every operation
- The connection is closed immediately after use
- No connection pooling or reuse
- Adds ~10–50ms latency per query
- Wastes resources and becomes a scalability bottleneck under load
@asynccontextmanager
async def get_weaviate_client():
client = get_client()
try:
await client.connect() # connects every time
yield client
finally:
await client.close() # disconnects every timeRecord
- I agree to follow this project's Code of Conduct
- I want to work on this issue
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request