Hello,
We are using Traefik for a Docker Swarm cluster with 6 nodes (3 x managers, 3 x workers). Traefik is running on the manager nodes, while all other containers are running on the worker nodes.
So far, everything is working, but we are seeing a behaviour we can't explain to ourselves. We have a really simple PHP/Memcached-based statistics tool for tracking traffic on our webpages. When a URL like this is requested for reporting, it takes around 250ms to get an answer:
http://[mydockerswarmhost]/screenall/ajax/get_graph_data.php?id=project1diagram1&additionalparamsconfig=a%253a0%253a%257b%257d&_=1779107822392
When reloading the request, it takes less than 30ms. The first thought would be that the data had been cached in the backend Docker container, but with the refresh, you also get fresh data from the backend container (pressed Ctrl+F5 while reloading).
As you can see, there is a cache-busting parameter in the URL. The slow requests are reproducible when changing one digit in this parameter:
- 1st request: &_=1779107822392 (slow)
- Force reloading: &_=1779107822392 (fast)
- Change caching parameter: &_=1779107822393 (slow)
- Force reloading: &_=1779107822393 (fast)
So it seems that Traefik has to think quite long when it gets an unknown URL. Is there anything like an internal cache for known URLs?
Also very strange: when putting an additional reverse proxy (e.g., Varnish) in front of the setup, the problem does not exist. Then every request is fast. We do not understand why a chain of reverse proxy + reverse proxy is faster than the direct way.
All requests are HTTP only. Connection keep-alive is returned in the response header in both situations.
We have no idea what is behind this behaviour in traefik...