[FUG-BR] Freebsd + xen PV

Deny Codig deny.santos em gmail.com
Quinta Novembro 29 09:28:40 BRST 2012


Bom dia Alexandre vou esclarecer mais agora 

Quando falo em muito trafego é trafego real , este BSD é o gateway da rede, tem firewall nele, dhcp , dns, proxy , vpn (vtund e mpd), nao tem httpd nem email pois estes estao em serviços separados  virtualizados no linux sem problemas. 
Eu tenho quase 250 maquinas ligadas em rede , essas redes são dividas nas 5 placas de rede que lhe falei sao redes 10.91.x.x cada rede em uma placa da virtualizadora . Quando começa a ter trafego entre as redes é que fica lento , eu disparo um ping da rede 10.91.8.x para a rede 10.91.12.x começo a perder pacotes sendo que o servidor é 10.91.11.1 , agora se pingo direto para o servidor nao perco pacote, e se pingo de dentro do servidor para uma dessas redes nao tenho perda entao o trafego se perde quando passa por ele , quando reinicio tudo até comecar a ter trafego em todas as redes tudo anda muito bem fiz o teste fora do horario de expediente e só com trafego normal nao tive perda alguma o problema é o aumento do trafego .

[root em newxenfw ~]# xen
xen-detect        xenstore          xenstore-chmod    xenstore-control  xenstore-exists   xenstore-list     xenstore-ls       xenstore-read     xenstore-rm       xenstore-write    
[root em newxenfw ~]# xen-detect 
Running in HVM context on Xen v4.1.

FreeBSD newxenfw.saa.org.br 9.1-RC3 FreeBSD 9.1-RC3 #1: Mon Nov 12 14:57:53 BRST 2012     root em saasrv09.saa.org.br:/usr/obj/usr/src/sys/XENHVM  amd64

Estou utilizando o XEN 6.0.1 e o BSD 9.1-rc3 

ifconfig -a 

Neste momento só tenho uma placa ativa neste servidor só para acessar , veja o media type esta em Ethernet manual

plip0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> metric 0 mtu 1500
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
pflog0: flags=0<> metric 0 mtu 33152
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
pfsync0: flags=0<> metric 0 mtu 1500
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	syncpeer: 0.0.0.0 maxupd: 128
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
	options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
	inet6 ::1 prefixlen 128 
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5 
	inet 127.0.0.1 netmask 0xff000000 
	nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
xn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=503<RXCSUM,TXCSUM,TSO4,LRO>
	ether e6:4d:93:4c:e1:56
	inet 10.91.8.117 netmask 0xfffffe00 broadcast 10.91.9.255
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: Ethernet manual
	status: active


dmesg 

Copyright (c) 1992-2012 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 9.1-RC3 #1: Mon Nov 12 14:57:53 BRST 2012
    root em dsasrv09.dsa.org.br:/usr/obj/usr/src/sys/XENHVM amd64
CPU: Intel(R) Xeon(R) CPU E5-2609 0 @ 2.40GHz (2400.06-MHz K8-class CPU)
  Origin = "GenuineIntel"  Id = 0x206d7  Family = 6  Model = 2d  Stepping = 7
  Features=0x781fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,MMX,FXSR,SSE,SSE2>
  Features2=0x83b82203<SSE3,PCLMULQDQ,SSSE3,CX16,SSE4.1,SSE4.2,x2APIC,POPCNT,TSCDLT,AESNI,HV>
  AMD Features=0x28000800<SYSCALL,RDTSCP,LM>
  AMD Features2=0x1<LAHF>
real memory  = 7079985152 (6752 MB)
avail memory = 6788546560 (6474 MB)
Event timer "LAPIC" quality 400
ACPI APIC Table: <Xen HVM>
FreeBSD/SMP: Multiprocessor System Detected: 3 CPUs
FreeBSD/SMP: 3 package(s) x 1 core(s)
 cpu0 (BSP): APIC ID:  0
 cpu1 (AP): APIC ID:  2
 cpu2 (AP): APIC ID:  4
ioapic0: Changing APIC ID to 1
MADT: Forcing active-low polarity and level trigger for SCI
ioapic0 <Version 1.1> irqs 0-47 on motherboard
kbd1 at kbdmux0
acpi0: <Xen> on motherboard
acpi0: Power Button (fixed)
acpi0: Sleep Button (fixed)
acpi0: reservation of 0, a0000 (3) failed
cpu0: <ACPI CPU> on acpi0
cpu1: <ACPI CPU> on acpi0
cpu2: <ACPI CPU> on acpi0
hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff on acpi0
Timecounter "HPET" frequency 62500000 Hz quality 950
attimer0: <AT timer> port 0x40-0x43 irq 0 on acpi0
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
atrtc0: <AT realtime clock> port 0x70-0x71 irq 8 on acpi0
Event timer "RTC" frequency 32768 Hz quality 0
Timecounter "ACPI-fast" frequency 3579545 Hz quality 900
acpi_timer0: <32-bit timer at 3.579545MHz> port 0x1f48-0x1f4b on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
isab0: <PCI-ISA bridge> at device 1.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <Intel PIIX3 WDMA2 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xc220-0xc22f at device 1.1 on pci0
ata0: <ATA channel> at channel 0 on atapci0
ata1: <ATA channel> at channel 1 on atapci0
uhci0: <Intel 82371SB (PIIX3) USB controller> port 0xc200-0xc21f irq 23 at device 1.2 on pci0
usbus0: controller did not stop
usbus0 on uhci0
pci0: <bridge> at device 1.3 (no driver attached)
vgapci0: <VGA-compatible display> mem 0xf0000000-0xf1ffffff,0xf3000000-0xf3000fff irq 24 at device 2.0 on pci0
xenpci0: <Xen Platform Device> port 0xc000-0xc0ff mem 0xf2000000-0xf2ffffff irq 30 at device 3.0 on pci0
xenstore0: <XenStore> on xenpci0
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: [GIANT-LOCKED]
psm0: model IntelliMouse Explorer, device ID 4
fdc0: <floppy drive controller> port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on acpi0
fdc0: does not respond
device_attach: fdc0 attach returned 6
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
ppc0: <Parallel port> port 0x378-0x37f irq 7 on acpi0
ppc0: Generic chipset (NIBBLE-only) in COMPATIBLE mode
ppbus0: <Parallel port bus> on ppc0
plip0: <PLIP network interface> on ppbus0
lpt0: <Printer> on ppbus0
lpt0: Interrupt-driven port
ppi0: <Parallel I/O> on ppbus0
orm0: <ISA Option ROM> at iomem 0xc9000-0xc97ff on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
fdc0: No FDOUT register!
ctl: CAM Target Layer loaded
Timecounters tick every 10.000 msec
usbus0: 12Mbps Full Speed USB v1.0
xenbusb_front0: <Xen Frontend Devices> on xenstore0
ugen0.1: <Intel> at usbus0
uhub0: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus0
xn0: <Virtual Network Interface> at device/vif/0 on xenbusb_front0
xn0: Ethernet address: e6:4d:93:4c:e1:56
xenbusb_back0: <Xen Backend Devices> on xenstore0
xctrl0: <Xen Control Device> on xenstore0
xn0: backend features: feature-sg feature-gso-tcp4
xbd1: 122880MB <Virtual Block Device> at device/vbd/832 on xenbusb_front0
xbd1: attaching as ad1
xbd2: 92160MB <Virtual Block Device> at device/vbd/768 on xenbusb_front0
xbd2: attaching as ad0
uhub0: 2 ports with 2 removable, self powered
ugen0.2: <QEMU 0.10.2> at usbus0
ums0: <Endpoint1 Interrupt Pipe> on usbus0
ums0: 3 buttons and [Z] coordinates ID=0
cd0 at ata1 bus 0 scbus1 target 1 lun 0
cd0: <QEMU QEMU DVD-ROM 0.10> Removable CD-ROM SCSI-0 device 
cd0: 16.700MB/s transfers (WDMA2, ATAPI 12bytes, PIO 65534bytes)
cd0: Attempt to query device size failed: NOT READY, Medium not present
SMP: AP CPU #1 Launched!
SMP: AP CPU #2 Launched!
Trying to mount root from ufs:/dev/ad0p2 [rw]...
xn0: 2 link states coalesced
WARNING: attempt to domain_add(netgraph) after domainfinalize()


On Nov 28, 2012, at 4:49 PM, Alexandre Biancalana wrote:

> Olá!
> 
> 2012/11/28 Deny Codig <deny.santos em gmail.com>:
>> Boa tarde , instalei recentemente o freebsd 9 e o 9.1-rc3 virtualizados no xen juntamente com o xentools , kernel XENHVM , até ai tudo bem , o problema foi depois de levantar o freebsd e colocar 5 redes com 5 placas de redes diferentes , quando ele começa a trafegar dados entre as redes começa a perder pacotes ou seja tudo que passa por dentro dele e vai para outra rede perde muito pacote até ficar lento ao extremo, eu fiz todo tipo de tunning no servidor , tirei o LSO da placa , alterei os maxfiles entre outras alterações nos modulos do kernel e mesmo assim quando começa a ter muito trafego na rede que passa por ele fica tudo muito lento .
> 
> Vamos lá, temos várias "medidas" subjetivas aqui e falta de
> informações... oque é muito trafego ?
> 
> Você poderia mandar o dmesg dessa VM ?
> 
> Poderia mandar um ifconfig -a ?
> 
> Está usando FW ? Qual ?
> 
> Qual o tipo de tráfego que passa por essa maquina ? Como ele é gerado
> (netperf, scp ou é tráfego real) ?
> 
> 
>> Alguem ja teve alguma experencia recente com o XEN + BSD e conseguiu fazer ele rodar PV (para-virtualizado) , creio que o maior problema é que as placas de rede sao virtualizadas e nao conseguem trabalhar corretamente com o xen , no BSD 9.1 ja tivemos uma melhora enorme com relação a velocidade porem ainda tenho problemas com trafego muito grande o problema tambem é que em media na placa de rede aparece Manual e nao a Full Duplex , e nao muda de forma alguma.
> 
> Eu já usei o Free rodando em PV (na verdade PFSense) mas isso foi em
> casa e não tinha mto tráfego passando... Entretanto compilando o
> kernel XENHVM já adiciona drivers PV mesmo rodando em HVM (mais infos
> http://wiki.freebsd.org/FreeBSD/Xen), atualmente utilizo XCP com
> PFSense com kernel XENHVM, não testei ainda a performance de rede, mas
> posso fazê-lo a noite ;-)
> 
> 
>> 
>> Se alguem tiver alguma dica , preciso usar o BSD virtualizado para nosso projeto que esta substituindo as maquinas fisicas , nao quero ter que utilizar o linux para isso pois trabalho com BSd a anos ja .
> 
> É isso ai vamos continuar com o Free ;-)
> -------------------------
> Histórico: http://www.fug.com.br/historico/html/freebsd/
> Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd



Mais detalhes sobre a lista de discussão freebsd