ENHANCEMENT:Weaviate client connects and disconnects causing latency issues

未关闭
#227 2 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@vaishcodescape 已经在做这个了。

开始于 2026年1月11日。

  • #233 来自 @vaishcodescape —— 已关闭,未合并
  • #234 来自 @vaishcodescape —— 未关闭

评估

这个 Issue 还没有评估数据。

描述

enhancement
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() calls await client.connect() on entry and await 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 time

Record

  • I agree to follow this project's Code of Conduct
  • I want to work on this issue
主要语言
Python
星标
103
派生
143
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

AOSSIE-Org/Devr.AI 的其他 Issue

查看 AOSSIE-Org/Devr.AI 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。