I have a server running Debian 11 with two 1Gbps and 10Gbps uplinks respectively. When running any network related commands, I observe a very high latency at the beginning of the command execution.
For example, if I run the command curl -I google.com
, it hangs for a couple of seconds and then outputs the result:
$ curl -I google.com
*** hangs for about 5 seconds ***
HTTP/1.1 301 Moved Permanently
Location: http://www.google.com/
Content-Type: text/html; charset=UTF-8
Date: Wed, 13 Apr 2022 16:20:09 GMT
Expires: Fri, 13 May 2022 16:20:09 GMT
Cache-Control: public, max-age=2592000
Server: gws
Content-Length: 219
X-XSS-Protection: 0
X-Frame-Options: SAMEORIGIN
There is a similar problem for apt
:
$ sudo apt update
0% [Working] # <--- hangs for 2-3 seconds
Hit:1 https://mirror.yandex.ru/debian bullseye InRelease
...
At the same time, the speed of the Internet connection is acceptable:
$ wget http://tb.ip4market.ru/file1gb.bin
--2022-04-13 19:11:28-- http://tb.ip4market.ru/file1gb.bin
Resolving tb.ip4market.ru (tb.ip4market.ru)... 193.0.203.203
Connecting to tb.ip4market.ru (tb.ip4market.ru)|193.0.203.203|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1073741824 (1.0G) [application/octet-stream]
Saving to: ‘file1gb.bin’
file1gb.bin 100%[==================================>] 1.00G 17.0MB/s in 49s
2022-04-13 19:12:22 (21.1 MB/s) - ‘file1gb.bin’ saved [1073741824/1073741824]
On other servers connected to the same switch, there is no such problem.
How can this be fixed, or at least how to determine the cause of this strange behavior?
Thanks in advance.