jeudi 8 janvier 2015

Virtualbox guest responding really slow over SSH, VBoxHeadLess stuck in 99.9% system time


I've been using Vagrant/virtualbox on a relatively new laptop with decent specs (16GB memory, Intel i7 4710HQ cpu, dual m-sata SSD).


So far, with every guest I run, I encounter really high latency, where keystrokes over SSH are echoed seconds later. (I did take check the usual SSH connection issues with reverse DNS lookup and GSSAPI auth, they do not apply and would only affect the initial connection.)


Meanwhile (and at other random times) one core will spin up to 100% utilisation, which is all spent by VBoxHeadLess inside select().



$ ps -o time -p 5257; time sudo strace -c -p 5257 ; ps -o time -p 5257
TIME
00:23:51
Process 5257 attached
^CProcess 5257 detached
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
99.95 3.214696 128588 25 select
0.03 0.000822 29 28 read
0.02 0.000521 23 23 futex
0.01 0.000413 21 20 sched_yield
------ ----------- ----------- --------- --------- ----------------
100.00 3.216452 96 total

real 0m3.81s
user 0m0.00s
sys 0m0.01s
TIME
00:23:55

$ ps -fp 5257
UID PID PPID C STIME TTY TIME CMD
henk 5257 25788 45 16:34 ? 00:18:20 /usr/lib/virtualbox/VBoxHeadless


Note the ps -o time ouput before and after



00:23:51
00:23:55


Combined with the time ... result of 3.81s., this confirms that the process is actually spending all of its time in the kernel, just waiting for events.


Meanwhile, the host kernel appears to be spinning on a lock in order to resolve that select().


I've used virtualbox/vagrant on a more modest i5 laptop, with the same ubuntu 14.04, and never saw this kind of behaviour.


Questions:



  1. How can I dig deeper to find out the cause of the excessive cpu wasted here?

  2. Is anyone familiar with similarly slow responding virtualbox guests?



Aucun commentaire:

Enregistrer un commentaire