File tree 2 files changed +66
-0
lines changed
2 files changed +66
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ OUTPUT_FILE=" fastapi.log"
4
+
5
+ python fastapi-app.py > " $OUTPUT_FILE " 2>&1 &
6
+ PYTHON_PID=$!
7
+
8
+ cleanup () {
9
+ echo " stopping server..."
10
+ kill $PYTHON_PID
11
+ }
12
+
13
+ trap cleanup EXIT
14
+
15
+ # wait for the server to start
16
+ sleep 10
17
+
18
+ echo " warming up pytorch model..."
19
+ python client.py --infile " cats-image.png" --jobs 10
20
+
21
+ echo " running benchmark..."
22
+
23
+ echo " experiment 1: 10 concurrent requests"
24
+ python client.py --infile " cats-image.png" --jobs 10
25
+
26
+ echo " experiment 2: 50 concurrent requests"
27
+ python client.py --infile " cats-image.png" --jobs 50
28
+
29
+ echo " experiment 3: 100 concurrent requests"
30
+ python client.py --infile " cats-image.png" --jobs 100
31
+
32
+ echo " experiment 4: 200 concurrent requests"
33
+ python client.py --infile " cats-image.png" --jobs 200
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ OUTPUT_FILE=" litserve.log"
4
+
5
+ python litserve-app.py > " $OUTPUT_FILE " 2>&1 &
6
+ PYTHON_PID=$!
7
+
8
+ cleanup () {
9
+ echo " stopping server..."
10
+ kill $PYTHON_PID
11
+ }
12
+
13
+ trap cleanup EXIT
14
+
15
+ # wait for the server to start
16
+ sleep 10
17
+
18
+ echo " warming up pytorch model..."
19
+ python client.py --infile " cats-image.png" --jobs 10
20
+
21
+ echo " running benchmark..."
22
+
23
+ echo " experiment 1: 10 concurrent requests"
24
+ python client.py --infile " cats-image.png" --jobs 10
25
+
26
+ echo " experiment 2: 50 concurrent requests"
27
+ python client.py --infile " cats-image.png" --jobs 50
28
+
29
+ echo " experiment 3: 100 concurrent requests"
30
+ python client.py --infile " cats-image.png" --jobs 100
31
+
32
+ echo " experiment 4: 200 concurrent requests"
33
+ python client.py --infile " cats-image.png" --jobs 200
You can’t perform that action at this time.
0 commit comments