Slow Network - adds 120ms delay to response- Droplet adds about 120 ms delay to every API response

Posted February 16, 2020 588 views

We have a simple nodejs application deployed in a basic droplet ( 1 core, 3 GB). The application has a /health API which simply prints “OK” ( nothing else no processing)

Run application on docker (installed on the droplet) => Response time around 15ms

1) Start the docker container which contains the simple /health API. (nodejs)
2) logged into the docker container on droplet (docker exec -it <containerId> sh)
3) curl the application from the docker container (curl --insecure -o /dev/null -s -w 'Total: %{time_total}s\n' https://localhost:443/health)

4) Here the application responses within 15ms. Which is quite fast and acceptable. :)

Run application Directly on droplet => Response time around 150ms

1) Start the nodejs application which contains the API
2) Curl the application from droplet itself (curl --insecure -o /dev/null -s -w 'Total: %{time_total}s\n' https://localhost:443/health)
3) Response time is around 150 ms ( which is very slow and not acceptable). :(

Even the /health API of the docker container is called from the droplet, the response time is 150ms.

This proves that, droplet adds about 120ms, delay to API response. We are developing an auto completion API and this 120ms delay kills us.

Did anybody observe this before. Please help for this.

Thank you.
Dimuthu Senanayaka

edited by MattIPv4
Submit an answer

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!