Open alexcappelletti opened 11 months ago
I had a look at this, and it seems related to how uwsgi
deals with threads and python.
Basically, the app is loaded in a pre-forking
mode, in which the workers are just "forked" from the main process. Such processes should share all the objects of the main process, but sometimes there are issues with it. In our case, the predict()
method of our pytorch models hangs, thus blocking the entire app
If we run uwsgi --ini uwsgi.ini --lazy-apps
the problem disappears, at the cost of using much more RAM (each process will have its own copy of the ML models).
I did not find any clever way to fix it nicely, since I myself have no idea where the issue could lie specifically.
Hi Giovanni, In the last iteration of dockerfile I removed uwsgi because it runs as admin but it is not a good idea. The problem still persists. On Mon, 21 Aug 2023 at 23:58, Giovanni De Toni @.***> wrote:
I had a look at this, and it seems related to how uwsgi deals with threads and python.
Basically, the app is loaded in a pre-forking mode, in which the workers are just "forked" from the main process. Such processes should share all the objects of the main process, but sometimes there are issues with it. In our case, the predict() method of our pytorch models hangs, thus blocking the entire app
If we run uwsgi --ini uwsgi.ini --lazy-apps the problem disappears, at the cost of using much more RAM (each process will have its own copy of the ML models).
I did not find any clever way to fix it nicely, since I myself have no idea where the issue could lie.
— Reply to this email directly, view it on GitHub https://github.com/geektoni/RecourseBackend/issues/2#issuecomment-1687100173, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALGBZO2SMEUI6US3LKCIGNDXWPKYBANCNFSM6AAAAAA3TRZW2U . You are receiving this because you authored the thread.Message ID: @.***>
Le informazioni contenute nella presente comunicazione sono di natura privata e come tali sono da considerarsi riservate ed indirizzate esclusivamente ai destinatari indicati e per le finalità strettamente legate al relativo contenuto. Se avete ricevuto questo messaggio per errore, vi preghiamo di eliminarlo e di inviare una comunicazione all’indirizzo e-mail del mittente.
-- The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If you received this in error, please contact the sender and delete the material.
step to reproduce: 1) build docker image
2) run container
2) make a http request (post)
with parameters