@@ -247,6 +247,23 @@ Here's one complete request with data
247
247
--data ' {"username":"xyz","password":"xyz"}' \
248
248
http://localhost:5000/api
249
249
250
+ To run multiple requests in parallel for stress testing
251
+
252
+ .. code :: bash
253
+
254
+ curl --header " Content-Type: application/json" \
255
+ --request POST \
256
+ --data ' {"username":"xyz","password":"xyz"}' \
257
+ http://localhost:5000/api &
258
+ curl --header " Content-Type: application/json" \
259
+ --request POST \
260
+ --data ' {"username":"xyz","password":"xyz"}' \
261
+ http://localhost:5000/api &
262
+ curl --header " Content-Type: application/json" \
263
+ --request POST \
264
+ --data ' {"username":"xyz","password":"xyz"}' \
265
+ http://localhost:5000/api &
266
+ wait
250
267
251
268
File Upload
252
269
-----------
@@ -565,6 +582,32 @@ Apache's httpd.conf file.
565
582
CMD /etc/mod_wsgi-express/apachectl start -D FOREGROUND
566
583
567
584
585
+ Gunicorn is another popular, and extremely easy to use WSGI.
586
+ We can just install as ``pip install gunicorn ``.
587
+ and start it with the simple command.
588
+
589
+ .. code ::
590
+
591
+ # gunicorn -w 2 pythonScriptName:flaskAppName
592
+ # it uses port 8000 by default, but we can change it
593
+ gunicorn --bind 0.0.0.0:5000 -w 2 app:app
594
+
595
+
596
+ ``
597
+ sudo apt-get install nginx
598
+ # ubuntu firewall
599
+ sudo ufw status
600
+ sudo ufw enable
601
+ sudo ufw nginx http
602
+ sudo ufw status
603
+ sudo ufw allow ssh
604
+
605
+ systemctl status nginx
606
+ systemctl start nginx
607
+ systemctl stop nginx
608
+ systemctl restart nginx
609
+ ``
610
+
568
611
569
612
* https://www.appdynamics.com/blog/engineering/a-performance-analysis-of-python-wsgi-servers-part-2/
570
613
0 commit comments