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

remove lock #948

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

remove lock #948

wants to merge 4 commits into from

Conversation

lxning
Copy link
Contributor

@lxning lxning commented Oct 13, 2020

Issue #, if available:

Description of changes:

This changes is to remove the lock in function pollBatch(). The reason is that each WorkerThread calls pollBatch to get a batch requests from a LinkedBlockingDeque and load them into its own buffer. This lock is not necessary since LinkedBlockingDeque is thread safe.

Testing done:

The test was done at local environment. The test configuration:
inference_address=http://127.0.0.1:8080
management_address=http://127.0.0.1:8081
model_store=../modelarchive/src/test/resources/models
load_models=squeezenet_v1.1.mar
preload_model=true
default_workers_per_model=2
async_logging=true
default_response_timeout=120
unregister_model_timeout=120
max_request_size=10485760
enable_envvars_config=true
job_queue_size=100

Test case1:
#!/bin/bash begin=$(date +%s) for i in {1..10000} do #echo "Welcome $i times" curl -X POST localhost:8080/predictions/squeezenet_v1.1 -T kitten.jpg done end=$(date +%s) latency=expr $end - $endecho $begin echo $end echo $latency
Test case2: call the following scripts 10 concurrently.
#!/bin/bash begin=$(date +%s) for i in {1..1000} do #echo "Welcome $i times" curl -X POST localhost:8080/predictions/squeezenet_v1.1 -T kitten.jpg done end=$(date +%s) latency=expr $end - $endecho $begin echo $end echo $latency
To run CI tests on your changes refer README.md

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@maaquib maaquib requested a review from vdantu October 13, 2020 19:30
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

Successfully merging this pull request may close these issues.

1 participant