Skip to content

Commit

Permalink
Merge pull request #89 from qdrant/ci/test-grpc-fork-perf
Browse files Browse the repository at this point in the history
fix: Reuse of Qdrant process pool should work
  • Loading branch information
KShivendu authored Dec 26, 2023
2 parents e890ac1 + 9b22a84 commit 971af88
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions engine/clients/qdrant/search.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import multiprocessing as mp
import os
from typing import List, Tuple

import httpx
Expand All @@ -17,6 +18,8 @@ class QdrantSearcher(BaseSearcher):

@classmethod
def init_client(cls, host, distance, connection_params: dict, search_params: dict):
os.environ["GRPC_ENABLE_FORK_SUPPORT"] = "true"
os.environ["GRPC_POLL_STRATEGY"] = "epoll,poll"
cls.client: QdrantClient = QdrantClient(
host,
prefer_grpc=True,
Expand Down
3 changes: 3 additions & 0 deletions engine/clients/qdrant/upload.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import time
from typing import List, Optional

Expand All @@ -14,6 +15,8 @@ class QdrantUploader(BaseUploader):

@classmethod
def init_client(cls, host, distance, connection_params, upload_params):
os.environ["GRPC_ENABLE_FORK_SUPPORT"] = "true"
os.environ["GRPC_POLL_STRATEGY"] = "epoll,poll"
cls.client = QdrantClient(host=host, prefer_grpc=True, **connection_params)
cls.upload_params = upload_params

Expand Down

0 comments on commit 971af88

Please sign in to comment.