Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.