Next.js with Docker
Unanswered
Blue whiting posted this in #help-forum
Blue whitingOP
Hello everybody, I am currently experimenting with hosting my Next.js app using Docker in "standalone" mode. During my testing, I have observed that the server deployed via Docker experiences slower response times compared to manually running the production server (both tested on my Mac).
The specific scenario involves making a request to a server-side rendered (SSR) page, where the data is fetched by the Next.js server.
When testing the Dockerized server, the response time ranges from approximately 500ms to 1s. On the other hand, when running the server manually, the response time is typically within the range of 200ms to 400ms.
I am seeking suggestions or insights on how to optimize the Docker configuration and improve the performance of the Dockerized server to reduce the response time. Any advice or recommendations would be highly appreciated.
The specific scenario involves making a request to a server-side rendered (SSR) page, where the data is fetched by the Next.js server.
When testing the Dockerized server, the response time ranges from approximately 500ms to 1s. On the other hand, when running the server manually, the response time is typically within the range of 200ms to 400ms.
I am seeking suggestions or insights on how to optimize the Docker configuration and improve the performance of the Dockerized server to reduce the response time. Any advice or recommendations would be highly appreciated.
3 Replies
it's famous issue on Docker on mac, especially when mounting volumes.
https://www.paolomainardi.com/posts/docker-performance-macos/
https://www.paolomainardi.com/posts/docker-performance-macos/
@tafutada777 it's famous issue on Docker on mac, especially when mounting volumes.
https://www.paolomainardi.com/posts/docker-performance-macos/
Blue whitingOP
Hi @tafutada777 , I facing the same issue with slow response time of my Next.js server deployed via Docker on DigitalOcean
only mac box. i believe it is a linux box so you hit different issues.