[CentOS] Slow CentOS VM when running off the network

Tue Jun 16 19:31:15 UTC 2009
Alfred von Campe <alfred at von-campe.com>

On Jun 16, 2009, at 15:03, Brian Mathis wrote:

> This is a classic sign of DNS query timeouts.  When you are connected
> to the network the system is making DNS queries which respond quickly.
>  When you are not connected, the host makes DNS queries and waits for
> a response.  The timeout is a minute or so, so you will see a long
> delay in any program that tries to resolve DNS.  Many programs use DNS
> even if it's not entirely obvious why.

That's what I thought at first too, but I've ruled that out.  For  
instance, here is some snippets from the strace output when trying to  
open another Terminal window:

12:45:59 socket(PF_FILE, SOCK_STREAM, 0) = 10
   ...
12:45:59 connect(10, {sa_family=AF_FILE, path="/tmp/.ICE-unix/4046"},  
21) = 0
12:45:59 fcntl64(10, F_SETFD, FD_CLOEXEC) = 0
12:45:59 write(10, "\0\1\0\0\0\0\0\0", 8) = 8
12:45:59 read(10, "\0\1\0\0\0\0\0\0", 8) = 8
12:46:43 access("/home/dv15727/.ICEauthority", R_OK) = 0
   ...
12:46:43 read(10, "\1\2\0\1\6\0\0\0", 8) = 8
12:48:03 read(10, "%\0\0\0001053b574c2000124517088300000"..., 48) = 48

As you can see, reading from a (local) socket is taking a long time.   
DNS should not be involved.

> You didn't say which virtual network this machine is connected to, but
> you probably want to use the NAT network and allow the VM to receive
> the DNS server configuration via DHCP.

I'll have to check when I get back to the office in 1.5 weeks.

Alfred