I have build a simple application with two pages (a multi-page Dash app) which I am running locally using Gunicorn with two workers and four threads. It's a simple dashboard application.
When I refresh the page in the browser and inspect the network tab, it usually takes 800ms to fetch the data and render it to the chart. The _dash-update-component typically takes about 800ms to respond and finish.
However, there are instances when I reload the page and the same process suddenly takes about one minute. During this time, the page stays completely white and only shows the text "Loading...". This behavior is also visible in the Chrome network logs: Network logs from Chrome
Has anyone experienced this or have an idea what might be causing this?
1 Answer 1
gunicorn app:server --workers 4 --threads 1 --timeout 120
For CPU-heavy or Pandas/NumPy tasks, threads don’t help because of the Python GIL. Increasing worker and reducing threads improves responsiveness:
1.