im Using Python 3.7.3, uwsgi 2.0.18, (docker container image python:3-stretch)
We have development environment where we are running our code on flask and we change it to uwsgi when we test it on production. Im running a py script which get live-stream pcm audio from redis (another container)
Now, when we run it on flask all works fine! when we run it on uwsgi threads gets stuck and die.
uwsgi settings :
[uwsgi]
http = :5000
socket = :3031
wsgi-env-behaviour=holy
master=1
uid=1000
gid=2000
master=1
processes = 1
threads = 1
protocol = uwsgi
wsgi-file = server.py
chdir = /app/base/
callable = app
http-raw-body
single-interpreter
paste-logger = true
honour-stdin
#logto = /tmp/errlog
vacuum = true
harakiri-verbose = true
harakiri = 60
cpu-affinity =3
http-timeout = 60
optimize = 2
http-keepalive
listen=30
workers = 40
ugreen
reaper
start_response-nodelay
greenlet
logs :
HARAKIRI: -- wchan> 0
Wed Jun 5 15:55:48 2019 - HARAKIRI !!! worker 24 status !!!
Wed Jun 5 15:55:48 2019 - HARAKIRI [core 0] XX.XX.XX.XX- GET /pcm_json since 1559750087
Wed Jun 5 15:55:48 2019 - HARAKIRI !!! end of worker 24 status !!!
Wed Jun 5 15:55:48 2019 - *** HARAKIRI ON WORKER 27 (pid: 32, try: 1) ***
DAMN ! worker 10 (pid: 15) died, killed by signal 9 :( trying respawn ...
Respawned uWSGI worker 10 (new pid: 64)
whats the major difference between flask and uwsgi regarding post and get requests ?
After googlins 2 days in a row no matter how much i have changed the settings nothing helps, i have tried all things suggested.
we are considering moving to gunicorn.. Thanks.
EDIT:
this is the code sendind request :
conn = http.client.HTTPConnection(server, port)
headers = { "ID": ID, "debugLevel": 1, "Multipart": 1, "Audio": 1, "Accept": "application/json" } conn.request("GET", "/pcm", "", headers)
ret = conn.getresponse()
this is another error i see in cli
Unhandled exception in thread started by <function get_pcm>