2

I run a website on a KVM VPS and I noticed that processes appear to run extremely slowly when being traced. For example, I ran ls on my home directory, which contains 72 files and directories.

With strace:

real    0m13.591s
user    0m0.024s
sys     0m6.972s

No particular system call is especially slow, but there is a noticeable (~0.1 s) pause after each one in the strace output.

Without strace:

real    0m0.101s
user    0m0.000s
sys     0m0.068s

I'm not sure whether this is related, but recursively removing large directories is also very slow. For example, I used

rsync -av `mktemp -d`/ dir

and it made extremely slow progress, removing only about 200 files per second. (That's slow, right?)

Is this a bug in KVM? Is there any way I could get my hosting company to fix it?

Brian Bi
  • 347
  • 1
  • 2
  • 9
  • It's hard to say. Are you using the virtio drivers? This could easily be a machine on a host with high load, but it could also be issues with the guest. Does `top` show high steal time? Run `ioping` against the drive for awhile, see if the numbers are consistent – devicenull Mar 19 '14 at 03:57
  • @devicenull yep, it's using virtio. `ioping` numbers don't seem very consistent; avg is 67.2 ms but maybe one in ten requests it's as high as 200 ms. Steal time appears to be 0.0%. – Brian Bi Mar 19 '14 at 04:11
  • Any idea what could be up with the tracing? That's way more important than the slow disk accesses. – Brian Bi Mar 19 '14 at 04:11
  • 67ms from ioping is pretty high. That means it takes at least 67ms to execute any sort of command to the disk. I wonder if your hosting company has overprovisioned the machines so your guest keeps getting swapped to the (terribly slow) disk. – devicenull Mar 19 '14 at 04:14

1 Answers1

1

Update: I still don't know what the problem was, but rebooting fixed it.

Brian Bi
  • 347
  • 1
  • 2
  • 9