public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* Degraded performance with Windows 2008 R2 with applications
@ 2011-03-06 22:25 Mathias Klette
  2011-03-07  9:41 ` Stefan Hajnoczi
  2011-03-07  9:57 ` Avi Kivity
  0 siblings, 2 replies; 4+ messages in thread
From: Mathias Klette @ 2011-03-06 22:25 UTC (permalink / raw)
  To: kvm

[-- Attachment #1: Type: text/plain, Size: 3999 bytes --]

Hi list,

I'm not sure if this is the right list, but I have to ask for help on
some performance issues with KVM and Windows 2008 R2.

Windows guest is working properly on a clean install. But once some
applications get installed - especially MSSQL, but others as well -
system becomes pretty unresponsive. In turns, a login to the system can
take several minutes, context menus are opened badly slow and the clock
is not updated correctly which leads to differences of whole hours after
only some few hours uptime. Verifying with performance monitor in
Windows I could only see load on disk IO, not on CPU, memory. From
kvm/qemu point of view: A raw-image stored on a ext4 formatted LVM
volume is used and started with following configurations via libvirt -
see attached.

On the host system runs Debian Squeeze with a custom 2.6.38-rc2-amd64
kernel. Packages kvm, qemu-kvm and qemu-utils have been re-packaged from
source with only slight changes from original Debian source. Versions
following

linux-source-2.6.38-rc2-amd64 (custom kernel)
kvm                                                      1:0.13.60-1
qemu                                                     0.12.5+dfsg-3
qemu-keymaps                                             0.12.5+dfsg-3
qemu-kvm                                                 0.13.60-1.2
qemu-system                                              0.12.5+dfsg-3
qemu-user                                                0.12.5+dfsg-3
qemu-user-static                                         0.12.5+dfsg-3
qemu-utils                                               0.13.60-4
libvirt-bin                                              0.8.6-1
libvirt0                                                 0.8.6-1

I've tested with iozone to compare IO with a linux guest and also to
verify changes made to improve situation - but nothing really helped.

TESTS with "iozone -s 4G -r 256k -c -e":
                                                              random
random    bkwd   record   stride
                KB  reclen   write rewrite    read    reread    read
write    read  rewrite     read   fwrite frewrite   fread  freread

disc: host, host fs: ext4
           4194304     256  212213  219411  1770921  1778980 1772993
222316 1251443  2427416  1556529   211803   225559 2028445  2033889

disc: host, host fs: ext4, mntopt:
noatime,barrier=0,data=writeback,nobh,commit=100,nouser_xattr
           4194304     256  458299  497838  2130939  1981932 1980227
511864 1810650  2556598  1838972   459005   467800 1572550  1576777

guest: debian squeeze, disc type: raw, cache: writeback, host fs: ext3
           4194304     256  111340   82813    81190    97227  116749
128444  378383  2384227    79760   170192   117359   88191    96565

guest: windows 2008 r2. disc type: raw, cache: writeback, host fs: ext4
           4194304     256   67787   27191    18102    38490   57438
96373   44393  3331227    56250    39590    35381   38925    59479

guest: windows 2008 r2, disc type: raw, cache: writeback, host fs: ext4,
mntopts (see above), guest: win 2008 r2, 2 CPU => 4 CPU, 2G => 8G RAM
           4194304     256   25542   55815  675272    634422  655875
34512 1022106  2880516   220929    25342    34893  574888   549021

guest: windows 2008 r2, disc type: raw, cache: writeback, host fs: ext4,
mntopts (see above), guest: win 2008 r2, 2 CPU => 4 CPU, 2G => 8G RAM,
disabled apps:
           4194304     256   23842   27387  665746    737001   85355
30551  993698  2966299    67414    27245    29198   83649   575503
           4194304     256   23832   25542  662877     85437  652512
30592  840599  3201253    65488    27701    21907  585014   565069
           4194304     256   18492   37256   86426    716990  659070
33134  988579  2929210   206683    27324    21285  640326   632402

So, now the questions are: Are any issues known, especially regards
Windows 2008 R2 or hints on further enhancements possible to kvm for
usage with Windows host systems?

Mathias

[-- Attachment #2: xml --]
[-- Type: application/octet-stream, Size: 3325 bytes --]


<domain type='kvm'>
  <name>VM-34</name>
  <memory>4194304</memory>
  <currentMemory>4194304</currentMemory>
  <vcpu>4</vcpu>
  <os>
    <type arch='x86_64' machine='pc-0.12'>hvm</type>
    <boot dev='cdrom'/>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='localtime'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/images/VM-34.raw'/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/images/virtio-win-1.1.16.iso'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <alias name='ide0-1-0'/>
      <address type='drive' controller='0' bus='1' unit='0'/>
    </disk>
    <controller type='ide' index='0'>
      <alias name='ide0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:8a:19:bb'/>
      <source bridge='br0'/>
      <target dev='vnet0'/>
      <model type='e1000'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/1'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/1'>
      <source path='/dev/pts/1'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <input type='tablet' bus='usb'>
      <alias name='input0'/>
    </input>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='5900' autoport='no' listen='0.0.0.0' keymap='de'/>
    <video>
      <model type='vga' vram='9216' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </memballoon>
  </devices>
</domain>

LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin HOME=/ QEMU_AUDIO_DRV=none /usr/bin/kvm -S -M pc-0.12 -enable-kvm -m 4096 -smp 4,sockets=4,cores=1,threads=1 -name VM-34 -nodefconfig -nodefaults -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/VM-34.monitor,server,nowait -mon chardev=monitor,mode=readline -rtc base=localtime -boot dc -drive file=/images/VM-34.raw,if=none,id=drive-virtio-disk0,boot=on,format=raw -device virtio-blk-pci,bus=pci.0,addr=0x6,drive=drive-virtio-disk0,id=virtio-disk0 -drive file=/images/virtio-win-1.1.16.iso,if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev tap,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=00:00:00:00:00:00 -chardev pty,id=serial0 -device isa-serial,chardev=serial0 -usb -device usb-tablet,id=input0 -vnc 0.0.0.0:0 -k de -vga std -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Degraded performance with Windows 2008 R2 with applications
  2011-03-06 22:25 Degraded performance with Windows 2008 R2 with applications Mathias Klette
@ 2011-03-07  9:41 ` Stefan Hajnoczi
  2011-03-07 18:10   ` Mathias Klette
  2011-03-07  9:57 ` Avi Kivity
  1 sibling, 1 reply; 4+ messages in thread
From: Stefan Hajnoczi @ 2011-03-07  9:41 UTC (permalink / raw)
  To: Mathias Klette; +Cc: kvm, Vadim Rozenfeld

On Sun, Mar 6, 2011 at 10:25 PM, Mathias Klette <mklette@gmail.com> wrote:
> I've tested with iozone to compare IO with a linux guest and also to
> verify changes made to improve situation - but nothing really helped.
>
> TESTS with "iozone -s 4G -r 256k -c -e":

Please use the -I option to bypass the page cache, otherwise buffered
I/O will be used and requests may be satisfied from memory rather than
actually accessing the disk.

What is the qemu-kvm command-line (ps aux | grep kvm)?

Are you using virtio-blk and the Windows guest drivers from here:

http://www.linux-kvm.org/page/WindowsGuestDrivers/Download_Drivers

Stefan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Degraded performance with Windows 2008 R2 with applications
  2011-03-06 22:25 Degraded performance with Windows 2008 R2 with applications Mathias Klette
  2011-03-07  9:41 ` Stefan Hajnoczi
@ 2011-03-07  9:57 ` Avi Kivity
  1 sibling, 0 replies; 4+ messages in thread
From: Avi Kivity @ 2011-03-07  9:57 UTC (permalink / raw)
  To: Mathias Klette; +Cc: kvm

On 03/07/2011 12:25 AM, Mathias Klette wrote:
> Hi list,
>
> I'm not sure if this is the right list, but I have to ask for help on
> some performance issues with KVM and Windows 2008 R2.
>
> Windows guest is working properly on a clean install. But once some
> applications get installed - especially MSSQL, but others as well -
> system becomes pretty unresponsive. In turns, a login to the system can
> take several minutes, context menus are opened badly slow and the clock
> is not updated correctly which leads to differences of whole hours after
> only some few hours uptime. Verifying with performance monitor in
> Windows I could only see load on disk IO, not on CPU, memory. From
> kvm/qemu point of view: A raw-image stored on a ext4 formatted LVM
> volume is used and started with following configurations via libvirt -
> see attached.
>
> On the host system runs Debian Squeeze with a custom 2.6.38-rc2-amd64
> kernel. Packages kvm, qemu-kvm and qemu-utils have been re-packaged from
> source with only slight changes from original Debian source. Versions
> following
>

top/vmstat/kvm_stat on the host, please.

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Degraded performance with Windows 2008 R2 with applications
  2011-03-07  9:41 ` Stefan Hajnoczi
@ 2011-03-07 18:10   ` Mathias Klette
  0 siblings, 0 replies; 4+ messages in thread
From: Mathias Klette @ 2011-03-07 18:10 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: kvm

On 07/03/11 10:41, Stefan Hajnoczi wrote:
> On Sun, Mar 6, 2011 at 10:25 PM, Mathias Klette<mklette@gmail.com>  wrote:
>> I've tested with iozone to compare IO with a linux guest and also to
>> verify changes made to improve situation - but nothing really helped.
>>
>> TESTS with "iozone -s 4G -r 256k -c -e":
>
> Please use the -I option to bypass the page cache, otherwise buffered
> I/O will be used and requests may be satisfied from memory rather than
> actually accessing the disk.
>
thanks, wasn't really aware of that switch.

here now tests, with a raw image on ext4 LV mounted with option 
relatime. vm has 4cores, 8G memory.
                                                             random 
random    bkwd   record   stride
               KB  reclen   write rewrite    read    reread    read 
write    read  rewrite     read   fwrite frewrite   fread  freread
          4194304     256  116922   43874   53701     34459   62807 
40152  152029  3519190   126013    38504    74360   24814    25112
          4194304     256  102275   48545   24342     33265   67412 
40945   59097  3500722   114174    73353    44401   46383    31860
          4194304     256   49306   45876   31610     31285  187091 
37275   59135  3472783    54016    65711    70700   24674    49231
          4194304     256   85590   90679   31319     47120  269864 
38727  137024  3462054    48674    73425    44879   46736    31684
          4194304     256   40474   27725   46137     46084  180579 
38938   57869  3473130    52202    36281    90943   31189    32703

unfortunately kvm_stat wasn't possible as debugfs is not compiled in.

vmstat 15 on host for the time of one iozone run:

procs -----------memory---------- ---swap-- -----io---- -system-- 
----cpu----
  r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy 
id wa
  0  0      0 53722472 809620 160285216    0    0     2    17    1    0 
  0  1 98  0
  7  0      0 53726724 809648 160285280    0    0     0 24761 12731 
16822  1  1 98  0
  7  0      0 53722752 809672 160285296    0    0     0 120753 23707 
15666  1  2 97  0
  6  0      0 53724780 809688 160285344    0    0     0 86676 13572 
17537  1  1 98  0
  2  0      0 53725188 809716 160285392    0    0     1 72324 23238 
16397  0  2 98  0
  1  0      0 53728600 809740 160285424    0    0     0    24 10909 
13529  0  1 99  0
  0  0      0 53725612 809760 160285488    0    0     1    44 10469 
12467  0  1 99  0
  0  0      0 53726592 809784 160285680    0    0     1   299 11871 
15643  0  1 99  0
  1  0      0 53727512 809800 160285696    0    0     0    29 10635 
13284  0  1 99  0
  2  0      0 53727952 809832 160285776    0    0     1    53 10483 
12935  0  1 99  0
  1  0      0 53726348 809856 160285840    0    0     1    54 10384 
12600  0  1 99  0
  1  0      0 53727096 809880 160285856    0    0     0   108 10902 
13659  0  1 99  0
  1  0      0 53727328 809904 160285920    0    0     0    38 10348 
12692  0  1 99  0
  0  0      0 53728328 809928 160285952    0    0     0    33 10137 
12195  0  1 99  0
  1  0      0 53727680 809952 160286000    0    0     0    35 10653 
13327  0  1 99  0
  1  0      0 53727616 809968 160286112    0    0     0    31 10465 
12932  0  0 99  0
  0  0      0 53728148 809992 160286128    0    0     0    17 10037 
11946  0  0 99  0
  0  0      0 53727756 810016 160286192    0    0     1    29 13424 
18647  1  1 98  0
  5  0      0 53711500 810040 160286224    0    0     0    41 16580 
24443  1  2 97  0
  3  0      0 53724776 810076 160286288    0    0     1    61 13441 
18676  1  1 98  0
  0  0      0 53721816 810108 160286320    0    0     0 201432 14520 
14391  0  2 97  1
  6  0      0 53724704 810128 160286368    0    0     0    36 11088 
14476  0  1 99  0
  0  0      0 53725068 810164 160286432    0    0     0 78247 11450 
12167  1  2 97  1
  7  0      0 53626104 810188 160382512    0    0     0    35 11459 
14319  1  1 98  0
  3  0      0 53605924 810208 160402400    0    0     0    18 12609 
15837  2  1 97  0
  2  0      0 53589232 810356 160416864    0    0     0  8471 12203 
14956  2  1 97  0
  3  0      0 53570564 810372 160434128    0    0     0    26 11359 
13451  2  1 97  0
  0  0      0 53569516 810428 160438400    0    0     0  1735 10793 
12836  2  1 98  0
  1  0      0 53570652 810452 160438432    0    0     0    24 10816 
13483  0  1 99  0
  1  0      0 53570472 810476 160438496    0    0     0    61 11613 
14829  0  1 99  0
  5  0      0 53567268 810500 160438512    0    0     0    22 12978 
17810  1  1 98  0
  8  0      0 53564892 810528 160438816    0    0     0 150075 25535 
23496  0  2 98  0
  6  0      0 53565608 810552 160438848    0    0     0 27318 13518 
16144  0  1 99  0
  4  0      0 53566828 810576 160438912    0    0     0 102318 13783 
15730  1  1 98  0
  1  0      0 53564064 810600 160438944    0    0     0 84140 18573 
20191  1  2 98  0
  3  0      0 53564344 810616 160438992    0    0     0 131089 21789 
21013  0  2 98  0
  6  0      0 53565948 810640 160439008    0    0     0 17110 12010 
11942  0  1 99  0
  1  0      0 53567380 810656 160439056    0    0     0 47398 18252 
13303  0  1 99  0
  1  0      0 53550740 810684 160439104    0    0     0    25 10505 
12964  0  1 99  0
  2  0      0 53564948 810716 160439216    0    0     1    60 10113 
12037  0  1 99  0
  2  0      0 53566988 810740 160439264    0    0     0    39 10720 
13451  0  1 99  0
  1  0      0 53566420 810772 160439296    0    0     0    30 10526 
13053  0  1 99  0

regards top, i'm afraid to attach a log for the whole time iozone is 
being run. only remarkable: once iozone starts writing the kvm process 
requests more cpu time and ksoftirqd/18 and flush-253:1 show up for 
short times in the top 5 of the list.

> What is the qemu-kvm command-line (ps aux | grep kvm)?

106      14527 28.5  1.5 4413272 4223720 ?     Sl   15:04  58:50 
/usr/bin/kvm -S -M pc-0.13 -enable-kvm -m 4096 -smp 
4,sockets=4,cores=1,threads=1 -name Profitbricks-Linuxtest -uuid 
e4594cb9-6958-d564-8ed0-74ba828b9326 -nodefconfig -nodefaults -chardev 
socket,id=monitor,path=/var/lib/libvirt/qemu/VM-34.monitor,server,nowait 
-mon chardev=monitor,mode=readline -rtc base=localtime -boot dc -drive 
file=/images/VM-34.raw,if=none,id=drive-virtio-disk0,boot=on,format=raw,cache=writeback 
-device 
virtio-blk-pci,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0 
-drive 
file=/images/virtio-win-1.1.16.iso,if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw 
-device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 
-netdev tap,fd=90,id=hostnet0 -device 
e1000,netdev=hostnet0,id=net0,mac=52:54:00:4e:3c:6d,bus=pci.0,addr=0x3 
-netdev tap,fd=95,id=hostnet1 -device 
virtio-net-pci,netdev=hostnet1,id=net1,mac=52:54:00:37:4f:5f,bus=pci.0,addr=0x6 
-chardev pty,id=serial0 -device isa-serial,chardev=serial0 -usb -device 
usb-tablet,id=input0 -vnc 0.0.0.0:10 -k de -vga std -device 
virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4

>
> Are you using virtio-blk and the Windows guest drivers from here:
>
> http://www.linux-kvm.org/page/WindowsGuestDrivers/Download_Drivers
yes, versions 1.1.16. as far as I've seen, there were no newer ones 
available?!
>
> Stefan

I checked with linux-2.6.38-rc6 with AMD IOMMU support today and got far 
better results and also it felt like a usable system:

                                                             random 
random    bkwd   record   stride
               KB  reclen   write rewrite    read    reread    read 
write    read  rewrite     read   fwrite frewrite   fread  freread
           4194304     256   64937  101079  245510    229593  265388 
79120  321497  3608593   273455    48558    99760  224877   224175
          4194304     256   49674   95625   66813    213311   70686 
79345  322612  3198246   272728    96646    99040  212715   210044
          4194304     256   97412   49211  204895    654454  246541 
75667   74149  3250535   260699    48806    99973  225283   225453


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-03-07 18:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-06 22:25 Degraded performance with Windows 2008 R2 with applications Mathias Klette
2011-03-07  9:41 ` Stefan Hajnoczi
2011-03-07 18:10   ` Mathias Klette
2011-03-07  9:57 ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox