首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Weaviate批终端套接字挂起

Weaviate批终端套接字挂起
EN

Stack Overflow用户
提问于 2022-11-03 05:50:36
回答 1查看 50关注 0票数 1

当试图在本地(使用docker compose)将~10k项数组(确切地说是10810项)插入到我的Weaviate实例时,我遇到了以下错误:

代码语言:javascript
复制
FetchError: request to http://localhost:8080/v1/batch/objects failed, reason: socket hang up
    at ClientRequest.<anonymous> (/Users/bram/Dropbox/PARA/Projects/weaviate-kindle/node_modules/node-fetch/index.js:133:11)
    at ClientRequest.emit (node:events:527:28)
    at Socket.socketOnEnd (node:_http_client:478:9)
    at Socket.emit (node:events:539:35)
    at endReadableNT (node:internal/streams/readable:1344:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  type: 'system',
  errno: 'ECONNRESET',
  code: 'ECONNRESET'
}

但是,一些对象已成功上传。当我在Weaviate控制台中运行元计数查询时,我发现了1233个对象(见图)

下面是用于导入剪报的相关批处理代码:

代码语言:javascript
复制
async function importClippings() {
  // Get the data from the data.json file
  const data = await getJsonData();

  // Prepare a batcher
  let batcher = client.batch.objectsBatcher();
  let counter = 0;

  data.clippings.forEach((clipping) => {
    // Construct an object with a class, id, properties and vector
    const obj = generateClippingObject(clipping);

    // add the object to the batch queue
    batcher = batcher.withObject(obj);

    // When the batch counter reaches 20, push the objects to Weaviate
    if (counter++ == 20) {
      // flush the batch queue
      batcher
        .do()
        .then((res) => {
          console.log(res);
        })
        .catch((err) => {
          console.error(err);
        });

      // restart the batch queue
      counter = 0;
      batcher = client.batch.objectsBatcher();
    }
  });

  // Flush the remaining objects
  batcher
    .do()
    .then((res) => {
      console.log(res);
    })
    .catch((err) => {
      console.error(err);
    });
}

编辑:在Docker日志中也出现了此错误:

代码语言:javascript
复制
weaviate-kindle-t2v-transformers-1  | INFO:     172.18.0.5:53942 - "POST /vectors/ HTTP/1.1" 200 OK

weaviate-kindle-weaviate-1          | {
"description":"An I/O timeout occurs when the request takes longer than the specified server-side timeout.",
"error":"write tcp 172.18.0.5:8080-\u003e172.18.0.1:61056: i/o timeout",
"hint":"Either try increasing the server-side timeout using e.g. '--write-timeout 600s' as a command line flag when starting Weaviate, or try sending a computationally cheaper request, for example by reducing a batch size, reducing a limit, using less complex filters, etc. Note that this error is only thrown if client-side and server-side timeouts are not in sync, more precisely if the client-side timeout is longer than the server side timeout.",
"level":"error",
"method":"POST",
"msg":"i/o timeout",
"path":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/v1/batch/objects","RawPath":"","OmitHost":false,"ForceQuery":false,"RawQuery":"","Fragment":"","RawFragment":""},"time":"2022-11-03T05:33:30Z"}
}
EN

回答 1

Stack Overflow用户

发布于 2022-11-03 11:00:31

此问题在Docker日志中可见:)

代码语言:javascript
复制
"An I/O timeout occurs when the request takes longer than the specified server-side timeout."

这意味着您发送请求,并且Weaviate完成请求所需的时间要比客户端定义的超时时间长。

这通常有两个原因:

如果你带着你自己的向量(即,你使用的是单独的,没有向量化模块),批大小太高了。如果你使用向量化模块,很可能这是第一个bottleneck.

  • For,降低了批大小。对于后者,
    1. ,如果你自己运行ML模型,你真的想要在GPU上这样做,因为矢量化(即ML-模型推断)在CPU上实际上是不可撤销的。
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74298593

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档