We have a React/Django app with docker-compose at work. Any request to localhost takes 8 seconds: ab -n1 http://localhost:8080/
This is ApacheBench, Version 2.3 <$Revision: 1879490 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient).....done
Server Software: WSGIServer/0.2
Server Hostname: localhost
Server Port: 8080
Document Path: /
Document Length: 0 bytes
Concurrency Level: 1
Time taken for tests: 8.079 seconds
Complete requests: 1
Failed requests: 0
Non-2xx responses: 1
Total transferred: 768 bytes
HTML transferred: 0 bytes
Requests per second: 0.12 [#/sec] (mean)
Time per request: 8079.369 [ms] (mean)
Time per request: 8079.369 [ms] (mean, across all concurrent requests)
Transfer rate: 0.09 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 8079 8079 0.0 8079 8079
Waiting: 8079 8079 0.0 8079 8079
Total: 8079 8079 0.0 8079 8079
When I check tcpdump output by looking the docker bridge traffic I get:
10:00:29.594195 IP mylaptop.57775 > home.domain: 8575+ [1au] A? host.docker.internal. (49)
10:00:34.679533 IP mylaptop.57775 > home.domain: 8575+ [1au] A? host.docker.internal. (49)
10:00:37.598461 IP mylaptop.41076 > home.domain: 5915+ [1au] A? host.docker.internal.home. (54)
10:00:37.601026 IP home.domain > mylaptop.41076: 5915 NXDomain 0/0/1 (54)
10:00:37.601256 IP mylaptop.41076 > home.domain: 5915+ A? host.docker.internal.home. (43)
10:00:37.602351 IP home.domain > mylaptop.41076: 5915 NXDomain 0/0/0 (43)
This does not happen when I turn-off the wifi, requests are a few ms then. Same as in production.
This problem happened after updating our software stack (Django v3.2 → v4.2, React v16 → v18) but it didn’t affect other coworkers (now they are on vacation).
I have zero networking training so I’m at a loss for what to check next.