Slow response time from docker host #7941

Traefik v.2.4.5 (but behaved same way on v2.x) - didn't test on earlier versions.

Problem:
The ~25s of additional delay smells rounded too well to be just something, it is sort of a timeout, but how to find timeout for what. What's wrong with Traefik and why it only happens for calls from the docker host where Traefik and Nextcloud are held?

Expected:

  • similar response time locally (docker host) to time for calls from LAN side.
    Current situation:
  • response time is +25s longer - this smells like sort of a timeout somewhere.

Writing here in hope that you guys can point me in the right direction for investigation.
Running call like:
time curl --basic --user "$AUTH" -i -X PROPFIND "$URL"

Where URL is in NextCloud (irrelevant probably), I'm getting response time at level of:
a) from host on the LAN connected to docker host (via Traefik)

real	0m2,675s
user	0m0,036s
sys	0m0,022s

b) docker host itself (via Traefik), tried also secondary exposed entrypoint:

real	0m27.495s
user	0m0.036s
sys	0m0.036s

b) docker host itself but directly to Nextcloud IP (no SSL involved), using curl "--connect-to" switch

real	0m2.395s
user	0m0.008s
sys	0m0.008s

Above tests prove to me that:

  • it is not about a NextCloud directly as when hit directly response time is expected.
  • it is something to do only in situation when Traefik is hit from docker host level, using same IP/port as when from LAN.

Therefore question arises as mentioned at the beginning:
The ~25s of additional delay smells rounded too well to be just something, it is sort of a timeout, but how to find timeout for what. What's wrong with Traefik and why it only happens for calls from the docker host where Traefik and Nextcloud are held?

Ticket on Github should it be real bug as thought originally:

Starting with access logs(+json format) and log.level=DEBUG.
Access log is going to show you backend response time. DEBUG may show issues if there are any.

If you want further input from folk here then providing some configuration will help.

This type of delay is very likely going to be a configuration issue of some type, whether that is traefik, docker or nextcloud.