Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request Time out Error #632

Open
komi786 opened this issue May 23, 2024 · 5 comments
Open

Request Time out Error #632

komi786 opened this issue May 23, 2024 · 5 comments

Comments

@komi786
Copy link

komi786 commented May 23, 2024

I am using qdrant for almost 4 million vectors and after few batches of embedding and storage it shows error below.
Here is code to create instance of qdrant:
qdrant_client= QdrantClient(url='http://qdrant:6333', port=None, prefer_grpc=False, https=True, timeout=10)

I have also mentioned my collection config here.
`[2024-05-23 09:57:13,319] INFO - <qdrant_client.qdrant_client.QdrantClient object at 0x7f1d0dcb7ee0>
[2024-05-23 09:57:13,331] INFO - Collection Status=status=<CollectionStatus.GREEN: 'green'> optimizer_status=<OptimizersStatusOneOf.OK: 'ok'> vectors_count=2243648 indexed_vectors_count=0 points_count=2243648 segments_count=8 config=CollectionConfig(params=CollectionParams(vectors={'dense_vector': VectorParams(size=768, distance=<Distance.COSINE: 'Cosine'>, hnsw_config=None, quantization_config=None, on_disk=None, datatype=None)}, shard_number=4, sharding_method=None, replication_factor=1, write_consistency_factor=1, read_fan_out_factor=None, on_disk_payload=True, sparse_vectors=None), hnsw_config=HnswConfig(m=64, ef_construct=256, full_scan_threshold=20000, max_indexing_threads=8, on_disk=True, payload_m=128), optimizer_config=OptimizersConfig(deleted_threshold=0.2, vacuum_min_vector_number=1000, default_segment_number=2, max_segment_size=None, memmap_threshold=20000, indexing_threshold=0, flush_interval_sec=5, max_optimization_threads=None), wal_config=WalConfig(wal_capacity_mb=32, wal_segments_ahead=0), quantization_config=ScalarQuantization(scalar=ScalarQuantizationConfig(type=<ScalarType.INT8: 'int8'>, quantile=0.99, always_ram=True))) payload_schema={'page_content': PayloadIndexInfo(data_type=<PayloadSchemaType.KEYWORD: 'keyword'>, params=None, points=2243648)}
The collection has 2243648 vectors.
[2024-05-23 09:57:13,335] INFO - All Collections=collections=[CollectionDescription(name='SYNONYMS_MAPPING'), CollectionDescription(name='collection_name'), CollectionDescription(name='collection_name')]

Here is the error i am getting:
qdrant.add_documents(documents=documents) File "/usr/local/lib/python3.10/dist-packages/langchain_core/vectorstores.py", line 138, in add_documents return self.add_texts(texts, metadatas, **kwargs) File "/usr/local/lib/python3.10/dist-packages/langchain_community/vectorstores/qdrant.py", line 190, in add_texts self.client.upsert( File "/usr/local/lib/python3.10/dist-packages/qdrant_client/qdrant_client.py", line 1003, in upsert return self._client.upsert( File "/usr/local/lib/python3.10/dist-packages/qdrant_client/qdrant_remote.py", line 1383, in upsert http_result = self.openapi_client.points_api.upsert_points( File "/usr/local/lib/python3.10/dist-packages/qdrant_client/http/api/points_api.py", line 1439, in upsert_points return self._build_for_upsert_points( File "/usr/local/lib/python3.10/dist-packages/qdrant_client/http/api/points_api.py", line 738, in _build_for_upsert_points return self.api_client.request( File "/usr/local/lib/python3.10/dist-packages/qdrant_client/http/api_client.py", line 76, in request return self.send(request, type_) File "/usr/local/lib/python3.10/dist-packages/qdrant_client/http/api_client.py", line 93, in send response = self.middleware(request, self.send_inner) File "/usr/local/lib/python3.10/dist-packages/qdrant_client/http/api_client.py", line 202, in __call__ return call_next(request) File "/usr/local/lib/python3.10/dist-packages/qdrant_client/http/api_client.py", line 105, in send_inner raise ResponseHandlingException(e) qdrant_client.http.exceptions.ResponseHandlingException: timed out

Can you please me understand why is this happening?

@joein
Copy link
Member

joein commented May 23, 2024

Hi @komi786 , the problem is probably about the fact that you're keeping your hnsw graph on disk and using not fast enough disks.
In general, we recommend to store hnsw graph on disk only as a last attempt to reduce memory footprint, when you are ready to give up on the speed.
I would recommend to remove on_disk option for hnsw graph, and either keep everything in memory, if you have enough resources, or enable on_disk option for vectors only, not for hnsw graph.

@joein
Copy link
Member

joein commented May 23, 2024

Also, your client instantiation seems to be controversial, you provide url with http, however set https flag to true

If you want to speed up the upserting/querying, I would recommend to switch to grpc if possible.

@komi786
Copy link
Author

komi786 commented May 23, 2024

@joein i added https when i found discussion on time out error in an another issue here . just wanted to check if this makes any difference but no. you are right . Can you tell me what is the difference between on_disk_payload and on_disk options?

@komi786
Copy link
Author

komi786 commented May 23, 2024

I removed on_disk_payload as well as on_disk from HNSW config but time out issue still persists

@joein
Copy link
Member

joein commented May 23, 2024

you don't need to remove on_disk_payload

could you send output of your collection info once again please?

what is the batch size you're using?

if it is large or you have long documents, it might be reasonable to reduce it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants