Find answers from the community

Updated last year

**LlamaIndex + Qdrant: Keep getting this

At a glance

The community member is using LlamaIndex and Qdrant, and is encountering a "The write operation timed out" error. They are unsure if the issue is related to LlamaIndex or Qdrant, and have reached out to Qdrant customer support. The community member has tried adjusting the embed_batch_size parameter, but the issue persists. Another community member suggests adjusting the batch_size parameter for the Qdrant vector store, and the issue is resolved by setting it to 25. The community members discuss finding the optimal balance between 25 and 100 for the batch size.

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!
Makes sense!
Add a reply
Sign up and join the conversation on Discord