Dokku slow to respond and sometimes errors (502) #6549
Replies: 1 comment 1 reply
-
I discovered in my NGINX error logs that there are error when connecting to the Docker container:
I'm able to reproduce this every few requests using cURL:
Now I'm trying to figure out why this is happening. Sometimes it takes a few seconds before I get the "Failed to connect", sometimes just a few hundred ms (like above). I haven't been able to reproduce these errors for any other Dokku apps running on my server. If I build and run the container locally on my machine, I can't reproduce the errors that I'm experiencing on my server. I checked the load of my server in my DigitalOcean control panel and it doesn't seem like the load is too high on the server: If I run However, if I change the Dockerfile to no longer install the Puppeteer dependencies, the connection issues seem to go away:
So I do wonder if the issue is that my droplet is too weak. But then I would expect to see significant resource usage for the docker container or the droplet overall in htop but even that looks ok: Using the official Puppeteer Dockerfile makes the Docker container even more unresponsive and the error rate increases. For a test, I deployed the official Dockerfile and then reverted back to the old one (from the original post above) and now I'm not running into any more issues, strangely. I wonder if these issues will start occurring after some time... |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm a big fan of Dokku and I've been using it for many years.
Recently, I deployed an app that uses a custom Dockerfile for the first time and I'm running into some issues while running it.
When I run HTTP requests against the app, it's sometimes very slow to respond (1+ second, just for a static file) and I sometimes get a 502 error response. When I check my app's logs (
dokku logs <appName>
) there is no indication of any failures, so I'm suspecting that the issue is somewhere "in front of" my app. Maybe on the NGINX layer or somewhere else?Where can I look in order to debug this?
Btw, the app is a simple Node.js Express app, mostly serving static files but it has a few routes for Puppeteer which is why I needed the custom Dockerfile.
I'm thankful for any tips!
502 error in the network tab:
Dockerfile:
App logs:
Beta Was this translation helpful? Give feedback.
All reactions