Skip to content

Commit

Permalink
Enabled thread_num option
Browse files Browse the repository at this point in the history
  • Loading branch information
louiezzang committed Dec 13, 2019
1 parent 19a1bba commit 7d3894e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ echo "nprobe: $NPROBE"

ROOT="$(pwd)/$(dirname "$0")"

echo "Stop $CONTAINER_NAME..."
./stop.sh "$CONTAINER_NAME"

echo "Start $CONTAINER_NAME..."
docker run -d --name $CONTAINER_NAME -it \
-p $PORT:50051 \
-v $(pwd):/app \
Expand All @@ -35,3 +39,5 @@ docker run -d --name $CONTAINER_NAME -it \
--max_workers "$MAX_WORKERS" \
--num_threads "$NUM_THREADS" \
--nprobe $NPROBE

echo "Started!"
3 changes: 2 additions & 1 deletion server.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def main(args):
if num_threads is not None:
logging.info("num_threads: %d", num_threads)
server = grpc.server(futures.ThreadPoolExecutor(max_workers=max_workers))
servicer = FaissServer(dim, save_path, keys_path, nprobe)
#servicer = FaissServer(dim, save_path, keys_path, nprobe)
servicer = FaissServer(dim, save_path, keys_path, nprobe, num_threads)
pb2_grpc.add_ServerServicer_to_server(servicer, server)
server.add_insecure_port("[::]:50051")
server.start()
Expand Down

0 comments on commit 7d3894e

Please sign in to comment.