benchmark.sh 1.4 KB
Newer Older
R
root 已提交
1
# HTTP
R
root 已提交
2 3 4 5
ps -ef | grep web_service | awk '{print $2}' | xargs kill -9 
sleep 3
python3 benchmark.py yaml local_predictor 1 

R
root 已提交
6 7 8
for thread_num in 1 
do
for batch_size in 1
R
root 已提交
9
do
R
root 已提交
10 11
rm -rf PipelineServingLogs
rm -rf cpu_utilization.py
R
root 已提交
12 13 14
python3 web_service.py >web.log 2>&1 &
sleep 3
echo "import psutil\ncpu_utilization=psutil.cpu_percent(1,False)\nprint('CPU_UTILIZATION:', cpu_utilization)\n" > cpu_utilization.py
R
root 已提交
15
python3 benchmark.py run http $thread_num $batch_size
R
root 已提交
16
python3 cpu_utilization.py
R
root 已提交
17
echo "------------Fit a line pipeline benchmark (Thread: $thread_num) (BatchSize: $batch_size)"
R
root 已提交
18 19 20
tail -n 25 PipelineServingLogs/pipeline.tracer 
ps -ef | grep web_service | awk '{print $2}' | xargs kill -9
done
R
root 已提交
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
done

# RPC
ps -ef | grep web_service | awk '{print $2}' | xargs kill -9
sleep 3
python3 benchmark.py yaml local_predictor 1

for thread_num in 1 
do
for batch_size in 1 
do
rm -rf PipelineServingLogs
rm -rf cpu_utilization.py
python3 web_service.py >web.log 2>&1 &
sleep 3
echo "import psutil\ncpu_utilization=psutil.cpu_percent(1,False)\nprint('CPU_UTILIZATION:', cpu_utilization)\n" > cpu_utilization.py
python3 benchmark.py run rpc $thread_num $batch_size
python3 cpu_utilization.py
echo "------------Fit a line pipeline benchmark (Thread: $thread_num) (BatchSize: $batch_size)"
tail -n 25 PipelineServingLogs/pipeline.tracer
ps -ef | grep web_service | awk '{print $2}' | xargs kill -9
done
done