File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,20 @@ We trained a python model to classify whether or not a review is real or spam. N
44
55The model is stored in model as ``` model.pkl ``` .
66
7+ # Version 1.1 - Flask + gunicorn
8+
9+ We can run flask using gunicorn and scale the number of workers.
10+
11+ ``` bash
12+ gunicorn -w 3 -b :5000 api:app
13+ ```
14+
15+ ## Benchmarks
16+ ``` bash
17+ ab -n 10 -p data.json -T application/json 127.0.0.1:5000/predict
18+ ```
19+ ~ 2.75 requests/s
20+
721# Version 1 - Flask
822
923We can set up a flask server to serve the model.
@@ -26,9 +40,7 @@ How many predictions can our setup handle?
2640Using Apache Bench:
2741
2842``` bash
29- ab -n 10 -p data.json \
30- -T application/json \
31- 127.0.0.1:5000/predict
43+ ab -n 10 -p data.json -T application/json 127.0.0.1:5000/predict
3244```
3345
3446```
You can’t perform that action at this time.
0 commit comments