GibbsConsulting / django-plotly-dash

Expose plotly dash apps as django tags
MIT License
560 stars 125 forks source link

django-plotly-dash multi session on CPU intensive pages #422

Open gershonavi opened 2 years ago

gershonavi commented 2 years ago

Running - django-plotly-dash I have multipole python pages, the issue is that when I am loading one of the pages while it is running some calculations, I can not run the same page or other pages from a different session, and the webserver is not responding for other users. if I look at the runserver output, it is busy rendering the first request only.

delsim commented 2 years ago

@gershonavi how are you launching Django?

If you're using the debug runserver, then that is single-threaded, so you will get this behaviour. Try running Django using a multithreaded server such as gunicorn.

Note that if you have intensive calculations, then you will have to think about how to set up your application. You might want to offload them so that they are not performed during normal request-response processing.

gershonavi commented 2 years ago

thank you, I was looking for a solution such as gunicorn. tx.