Virtualizacion

Aldrin Gonzalo Martoq Ahumada amartoq en dcc.uchile.cl
Mie Oct 17 00:11:08 CLST 2007


On 10/16/07, Víctor González Piña <victor.gonzalez en redsalud.gov.cl> wrote:
> He estado leyendo información respecto de la virtualización de servidores y
> no he visto nada respecto a comparaciones de desempeño, por ahora he probado
> vmware y virtualbox, con el primero he tenido algunos problemas con los
> dispositivos externos, con virtualbox ninguno por ahora, ¿recomiendan algún
> otro para probar?

Prueba XEN, yo he tenido excelentes resultados. Los contras es que no
es tan facil de configurar...

Acabo de realizar las siguientes pruebas comparando la maquina HOST vs
la maquina GUEST, aprovechando que el tarro no se esta usando a esta
hora:
1. Leer 1GB desde el disco /
2. Descomprimir el kernel
3. Compilar el kernel

Con XEN, en ambos casos me dio practicamente el mismo resultado. Mi
configuracion es la siguiente:
- HP ProLiant DL380 G5 Server series
- 2 Procesadores Intel Xeon Dual Core 3Ghz, 4MB L2
- 8 Discos SATA, 150GB configurado como 2 arreglos RAID-5 con 4 discos cada uno
  - Configuracion de 8 discos por arreglos, 16 discos virtuales en total
- 16 GB RAM
- Debian 4.0, kernel 2.6.18-5-xen-vserver-amd64
- 5 maquinas virtuales, 4 Paravirtual (mismo Debian 4.0) y 1 HVM (Windows 2000)
- integracion es la maquina HOST, 4 procesadores, aprox 1GB libre de RAM
- norberto es la maquina GUEST, 3 procesadores de 4, aprox 3GB libre de RAM

De las pruebas, las conclusiones son:
- La lectura desde disco parece no tener diferencia significante sea
la maquina HOST o GUEST. Esto porque los discos de la maquina HOST asi
como las maquinas VIRTUALES estan sobre LVM en el HOST. Al acceder el
disco directamente, se aprecia una mejora de un 50%!!! (ver Pruebas
1-3 versus Prueba 4).
- El overhead de CPU no es notable, la compilacion del kernel es muy similar.
==> En maquinas paravirtualizadas, obtienes el mismo performance tanto
en la maquina host como guest.


No tengo el tiempo de quitar LVM y probar si es mejor, pero buee..

================= INICIO LOG ===============
--- Prueba #1 (GUEST) LEER DISCO / de DomU ---
norberto:~# time dd if=/dev/sda1 of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 10.342 seconds, 104 MB/s

real    0m10.349s
user    0m0.000s
sys     0m0.164s
norberto:~# time dd if=/dev/sda1 of=/dev/null bs=1M count=1024 skip=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 15.615 seconds, 68.8 MB/s

real    0m15.619s
user    0m0.000s
sys     0m0.128s
norberto:~# time dd if=/dev/sda1 of=/dev/null bs=1M count=1024 skip=2048
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 10.4133 seconds, 103 MB/s

real    0m10.417s
user    0m0.004s
sys     0m0.160s



--- Prueba #2 (HOST) LEER DISCO LVM / de Dom0  ---
integracion:~/src# time dd if=/dev/mapper/integracion-root
of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 9.21706 seconds, 116 MB/s

real    0m9.221s
user    0m0.000s
sys     0m0.316s
integracion:~/src# time dd if=/dev/mapper/integracion-root
of=/dev/null bs=1M count=1024 skip=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 9.21424 seconds, 117 MB/s

real    0m9.220s
user    0m0.004s
sys     0m0.640s
integracion:~/src# time dd if=/dev/mapper/integracion-root
of=/dev/null bs=1M count=1024 skip=2048
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 9.9915 seconds, 107 MB/s

real    0m10.004s
user    0m0.000s
sys     0m0.956s



--- Prueba #3 (HOST) LEER DISCO LVM / de DomU ---
integracion:~/src# time dd if=/dev/vm-norberto/root of=/dev/null bs=1M
count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 9.70968 seconds, 111 MB/s

real    0m9.723s
user    0m0.000s
sys     0m0.356s
integracion:~/src# time dd if=/dev/vm-norberto/root of=/dev/null bs=1M
count=1024 skip=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 9.61394 seconds, 112 MB/s

real    0m9.619s
user    0m0.000s
sys     0m0.352s
integracion:~/src# time dd if=/dev/vm-norberto/root of=/dev/null bs=1M
count=1024 skip=2048
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 9.69174 seconds, 111 MB/s

real    0m9.696s
user    0m0.000s
sys     0m0.368s



--- Prueba #4 (HOST) LEER DISCOS RAW-no-LVM ---
integracion:~/src# time dd if=/dev/cciss/c0d8 of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 5.89464 seconds, 182 MB/s

real    0m5.905s
user    0m0.000s
sys     0m0.436s
integracion:~/src# time dd if=/dev/cciss/c0d8 of=/dev/null bs=1M
count=1024 skip=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 7.89307 seconds, 136 MB/s

real    0m7.900s
user    0m0.000s
sys     0m0.464s
integracion:~/src# time dd if=/dev/cciss/c0d8 of=/dev/null bs=1M
count=1024 skip=2048
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 6.22875 seconds, 172 MB/s

real    0m6.234s
user    0m0.000s
sys     0m0.480s



--- Prueba #5 Configuracion VG ---
integracion:~/src# vgdisplay -v vm-norberto
    Using volume group(s) on command line
    Finding volume group "vm-norberto"

  --- Volume group ---
  VG Name               vm-norberto
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  5
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               19.53 GB
  PE Size               4.00 MB
  Total PE              4999
  Alloc PE / Size       4998 / 19.52 GB
  Free  PE / Size       1 / 4.00 MB
  VG UUID               HHxzGM-qhbO-1HcD-NOq8-4xMh-JFtf-i1DpqB

  --- Logical volume ---
  LV Name                /dev/vm-norberto/swap
  VG Name                vm-norberto
  LV UUID                KPkpyw-rpo4-RmfB-G28V-P54X-ZUxZ-M8Y50C
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                2.00 GB
  Current LE             512
  Segments               1
  Allocation             inherit
  Read ahead sectors     0
  Block device           254:6

  --- Logical volume ---
  LV Name                /dev/vm-norberto/root
  VG Name                vm-norberto
  LV UUID                dXNOWH-Yy3D-1Zeo-Jlbi-fTqV-l4DB-wjoVnl
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                17.52 GB
  Current LE             4486
  Segments               1
  Allocation             inherit
  Read ahead sectors     0
  Block device           254:7

  --- Physical volumes ---
  PV Name               /dev/cciss/c0d8
  PV UUID               gf1JwB-FO79-qgPT-w7HV-pfPF-i2Nz-Qd08Ig
  PV Status             allocatable
  Total PE / Free PE    4999 / 1



--- Prueba #6 Configuracion maquina virtual ---
integracion:~/src# more /etc/xen/norberto.cfg

name="norberto"
memory="4096"
disk=["phy:/dev/vm-norberto/root,sda1,w", "phy:/dev/vm-norberto/swap,sda2,w", "p
hy:/dev/vg-db2cert/db2cert,sda4,w" ]
vif = [ 'mac=00:16:3e:46:1c:ef, bridge=xenbr0', ]
vfb = ["type=vnc,vncdisplay=4,vnclisten=0.0.0.0"]
uuid = "eb4c2a80-4cb7-e76e-5682-44b1213a6dd6"
root="/dev/sda1 ro"
kernel="/boot/vmlinuz-2.6.18-5-xen-vserver-amd64"
ramdisk="/boot/initrd.img-2.6.18-5-xen-vserver-amd64"
vcpus=3
on_reboot   = 'restart'
on_crash    = 'restart'



--- Prueba #7 /proc/cpuinfo (4 procesadores) ---
processor       : 3
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU            5160  @ 3.00GHz
stepping        : 6
cpu MHz         : 2999.718
cache size      : 4096 KB
physical id     : 3
siblings        : 1
core id         : 0
cpu cores       : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu tsc msr pae mce cx8 apic mtrr mca cmov pat pse36
clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc
pni monitor ds_cpl vmx est tm2 cx16 xtpr lahf_lm
bogomips        : 7501.17
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:



--- Prueba #8 memoria (16 GB total) ---
integracion:~/src# free
             total       used       free     shared    buffers     cached
Mem:       1664000    1641016      22984          0    1027116      25880
-/+ buffers/cache:     588020    1075980
Swap:       888824         88     888736
norberto:~/src# free
             total       used       free     shared    buffers     cached
Mem:       4194304    4168208      26096          0    2323852     468552
-/+ buffers/cache:    1375804    2818500
Swap:      2097144       1864    2095280



--- Prueba #9 (GUEST) Descomprimir linux kernel (3 veces, 2 siguientes
debe haber hit en el cache) ---
norberto:~/src# time tar xfj linux-2.6.23.1.tar.bz2

real    0m14.044s
user    0m11.141s
sys     0m1.400s
norberto:~/src# time tar xfj linux-2.6.23.1.tar.bz2

real    0m12.836s
user    0m10.997s
sys     0m1.440s
norberto:~/src# time tar xfj linux-2.6.23.1.tar.bz2

real    0m11.858s
user    0m11.277s
sys     0m1.596s



--- Prueba #10 (HOST) Descomprimir linux kernel (3 veces, 2 siguientes
debe haber hit en el cache) ---
integracion:~/src# time tar xfj linux-2.6.23.1.tar.bz2

real    0m9.369s
user    0m8.513s
sys     0m1.236s
integracion:~/src# time tar xfj linux-2.6.23.1.tar.bz2

real    0m8.874s
user    0m8.177s
sys     0m1.576s
integracion:~/src# time tar xfj linux-2.6.23.1.tar.bz2

real    0m9.236s
user    0m8.605s
sys     0m1.488s



--- Prueba #11 (GUEST) Compilacion kernel justo despues de descomprimir ---
Extractos "tipicos" de TOP durante el proceso:
Cpu0  : 20.2%us,  1.7%sy,  0.0%ni, 78.1%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu1  : 43.5%us,  3.0%sy,  0.0%ni, 53.5%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu2  : 25.1%us,  1.7%sy,  0.0%ni, 73.3%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st

Cpu0  : 29.5%us,  3.6%sy,  0.0%ni, 66.2%id,  0.0%wa,  0.0%hi,  0.3%si,  0.3%st
Cpu1  : 25.5%us,  3.3%sy,  0.0%ni, 71.2%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu2  : 31.3%us,  2.7%sy,  0.0%ni, 66.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st

Cpu0  : 21.4%us,  2.3%sy,  0.0%ni, 76.3%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu1  : 50.8%us,  0.3%sy,  0.0%ni, 48.8%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu2  : 21.3%us,  1.7%sy,  0.0%ni, 77.1%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st

norberto:~/src/linux-2.6.23.1# time make
[...]
real    4m44.849s
user    3m57.975s
sys     0m28.022s

norberto:~/src/linux-2.6.23.1# time make clean
[...]

real    0m2.394s
user    0m0.656s
sys     0m0.724s
norberto:~/src/linux-2.6.23.1# time make
[...]

real    4m41.089s
user    3m55.195s
sys     0m28.202s
norberto:~/src/linux-2.6.23.1# time make clean
[...]

real    0m2.389s
user    0m0.636s
sys     0m0.828s
norberto:~/src/linux-2.6.23.1# time make
[...]

real    4m44.040s
user    3m58.015s
sys     0m27.694s
norberto:~/src/linux-2.6.23.1# time make clean
[...]

real    0m2.442s
user    0m0.692s
sys     0m0.816s



--- Prueba #12 (HOST) Compilacion kernel justo despues de descomprimir ---
Extractos "tipicos" de TOP durante el proceso:
Cpu0  :  1.7%us,  2.7%sy,  0.0%ni, 95.0%id,  0.0%wa,  0.3%hi,  0.3%si,  0.0%st
Cpu1  :  4.9%us,  1.4%sy,  0.0%ni, 93.8%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu2  : 55.7%us, 12.0%sy,  0.0%ni, 32.3%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu3  : 12.3%us,  3.3%sy,  0.0%ni, 84.4%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st

Cpu0  :  2.0%us,  3.0%sy,  0.0%ni, 95.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu1  :  2.6%us,  1.6%sy,  0.0%ni, 95.8%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu2  : 41.3%us, 10.7%sy,  0.0%ni, 48.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu3  : 23.5%us,  4.0%sy,  0.0%ni, 72.5%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st

Cpu0  :  5.0%us,  1.7%sy,  0.0%ni, 93.3%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu1  :  0.3%us,  0.3%sy,  0.0%ni, 99.3%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu2  : 63.1%us, 10.0%sy,  0.0%ni, 26.9%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu3  : 10.5%us,  4.9%sy,  0.0%ni, 84.5%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st

integracion:~/src/linux-2.6.23.1# time make
[...]

real    4m45.273s
user    3m47.066s
sys     0m40.743s
integracion:~/src/linux-2.6.23.1# time make clean
[...]

real    0m2.656s
user    0m0.648s
sys     0m0.892s
integracion:~/src/linux-2.6.23.1# time make
[...]

real    4m42.694s
user    3m46.166s
sys     0m40.047s
integracion:~/src/linux-2.6.23.1# time make clean
[...]

real    0m2.646s
user    0m0.648s
sys     0m0.792s
integracion:~/src/linux-2.6.23.1# time make
[...]

real    4m45.965s
user    3m47.342s
sys     0m41.923s

integracion:~/src/linux-2.6.23.1# time make clean
[...]

real    0m2.613s
user    0m0.700s
sys     0m0.848s

================= FIN   LOG ===============


-- 
Aldrin Martoq



Más información sobre la lista de distribución Linux