Find answers from the community

Updated 11 months ago

**LlamaIndex + Qdrant: Keep getting this

LlamaIndex + Qdrant: Keep getting this error "The write operation timed out"

I'm unsure whether this question pertains to LlamaIndex or Qdrant. If it relates to Qdrant, please inform me so I can reach out to their customer support.

I've been utilizing LlamaIndex alongside Qdrant, hosted on Qdrant's cloud. Initially, I was on their free tier cluster but have since upgraded to a paid, production-grade cluster. However, I'm still encountering the issue described below.

I'm working with a large JSON file (417 kB) and here are the steps I've taken to index it:

Plain Text
node_parser = SentenceWindowNodeParser.from_defaults(
    window_size=3,
    window_metadata_key="window",
   original_text_metadata_key="original_text",
)
embed_model = OpenAIEmbedding(embed_batch_size=100)
client = qdrant_client.QdrantClient(QDRANT_URL, api_key=QDRANT_API_KEY)

loader = JsonDataReader()
document = loader.load_data(json_string)
vector_store = QdrantVectorStore(client=client,                      collection_name=collection_name)
service_context = ServiceContext.from_defaults(llm=llm,                                      node_parser=node_parser,
                                             embed_model=embed_model)
storage_context = StorageContext.from_defaults(vector_store=vector_store)
index = VectorStoreIndex.from_documents(documents,                                    storage_context=storage_context,                                      service_context=service_context)


I keep encountering this error:
Plain Text
ERROR - Unexpected err=ResponseHandlingException(WriteTimeout('The write operation timed out')), type(err)=<class 'qdrant_client.http.exceptions.ResponseHandlingException'>


I've experimented with adjusting this value:
Plain Text
embed_model = OpenAIEmbedding(embed_batch_size=100)

I tried the default, 50, 100, and 200. It successfully worked once with 100, but every other attempt resulted in either a write timeout or a read timeout error.
L
S
4 comments
the error is definitely coming from qdrant πŸ€” Not entirely sure why though

The batch size you are adjusting is only for openai embeddings

You can adjust the batch size for qdrant inserts by doing QdrantVectorStore(..., batch_size=50)
Thanks @Logan M , I have reached out to Qdrant customer support as well!
It now works with QdrantVectorStore(..., batch_size=25).

The default appears to be 100. With 25, it takes too long, so I'll need to experiment to find the optimal balance between 25 and 100, where it:

  1. Does not timeout
  2. Is reasonably quick
Thank you for the assistance!
Add a reply
Sign up and join the conversation on Discord