I have build up a simple application with 2 pages (multi page dash app) which I am running locally using gunicorn with 2 workers 4 threads. Its a simple dashboard application.
When I refresh the page in the browser and inspect the network tab, it usually takes 800ms to use the data and render it to the chart (_dash-update-component took 800ms to respond/finish).
However there are instances when I reload, it takes 1 minute to do the same process. The page is an empty white page with just “Loading…” text to it. Sometimes it hogs at dash-dependencies as well.
I believe that you are encountering a conga line to requests. This works because each request gets in line and gets rendered on a first come first server basis, so if it is last in-line then it will take a while to get the response.
There are several things that you can do to avoid this:
use a reverse proxy (I use nginx) with a config that offloads static pages (assets, static and dash-component-suites):
Component suites and assets both get timestamps, so cache busting. Static doesnt get anything like that automatically. But this approach allows for the server to only handle things that its really needed for.
I’d also make sure that your app isnt crashing silently or running in debug mode, as both of these would cause the server to reboot and take much longer to respond to requests.