[FUG-BR] RES: RES: freebsd 8.2 - tuning de rede

2011-03-16 Por tôpico Eduardo Schoedler
Em 15/03/2011 08:47, Luiz Otavio O Souza escreveu:
 E que depende do tamanho máximo da fila, configurado aqui:
 
 # sysctl net.inet.ip.intr_queue_maxlen
 net.inet.ip.intr_queue_maxlen: 256
 
 (256 me parece pouco para um ambiente de alto trafego, com várias
 placas/interfaces)

Cuidado ao mexer com o tamanho das filas, existe um problema chamado
Bufferbloat.

Alguma referência:

http://gettys.wordpress.com/2010/12/13/mitigations-and-solutions-of-bufferbl
oat-in-home-routers-and-operating-systems/

http://gettys.wordpress.com/2010/11/29/home-router-puzzle-piece-one-fun-with
-your-switch/
http://gettys.wordpress.com/2010/12/02/home-router-puzzle-piece-two-fun-with
-wireless/

--
Eduardo Schoedler

-
Histórico: http://www.fug.com.br/historico/html/freebsd/
Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd


Re: [FUG-BR] RES: RES: freebsd 8.2 - tuning de rede

2011-03-16 Por tôpico Luiz Otavio O Souza
On Mar 16, 2011, at 10:44 AM, Eduardo Schoedler wrote:
 Em 15/03/2011 08:47, Luiz Otavio O Souza escreveu:
 E que depende do tamanho máximo da fila, configurado aqui:
 
 # sysctl net.inet.ip.intr_queue_maxlen
 net.inet.ip.intr_queue_maxlen: 256
 
 (256 me parece pouco para um ambiente de alto trafego, com várias
 placas/interfaces)
 
 Cuidado ao mexer com o tamanho das filas, existe um problema chamado
 Bufferbloat.
 
 Alguma referência:
 
 http://gettys.wordpress.com/2010/12/13/mitigations-and-solutions-of-bufferbl
 oat-in-home-routers-and-operating-systems/
 
 http://gettys.wordpress.com/2010/11/29/home-router-puzzle-piece-one-fun-with
 -your-switch/
 http://gettys.wordpress.com/2010/12/02/home-router-puzzle-piece-two-fun-with
 -wireless/

Eduardo,

Isso é mais comum no envio, onde você define um buffer muito grande e só começa 
trabalhar (enviar de fato) quando os dados atingem a metade do buffer (por 
exemplo).

Mas nesse caso, trata-se de pacotes recebidos, a placa de rede já recebeu o 
pacote (já esta com ele na memória) e ele foi descartado pois a fila de 
processamento de pacotes para o protocolo 'IP' encheu...

Como ele tem CPU sobrando e tinha drops nessa fila, eu apontei a sysctl que ele 
precisa alterar para evitar os drops.

É de esperar alguma cautela por parte do 'operador', pois como já comentei, 
toda alteração que você faz e se distancia do 'GENERIC', seu risco aumenta, 
aqui não é diferente.

Mas também é de se esperar que um sistema 'genérico' precise de alguns ajustes 
para se comportar bem em operações mais exigentes (como um router de alto 
trafego), a questão é entender e alterar só o que é preciso (e evitar criar 
novas mutações dos muitos bugs já existentes :)).

[]'s
Luiz
-
Histórico: http://www.fug.com.br/historico/html/freebsd/
Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd


[FUG-BR] RES: RES: freebsd 8.2 - tuning de rede

2011-03-15 Por tôpico Eduardo Schoedler
Em 15/03/2011 09:24, kmkz bleh escreveu:
 A propósito, bce suporta polling?

As minhas não.

# dmesg | grep bce
bce0: Broadcom NetXtreme II BCM5716 1000Base-T (C0) mem
0xd800-0xd9ff irq 16 at device 0.0 on pci5

# ifconfig -m bce0
bce0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST metric 0 mtu 1500
 
capabilities=c01bbRXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCS
UM,TSO4,VLAN_HWTSO,LINKSTATE

Já tentou colocar uma placa de rede Intel nesse servidor ?
Não gosto dessas Broadcom, em testes com iperf o desempenho delas nem
chegava perto de ~900Mbps, coisa que as Intel fazia tranquilamente.

Abs.

--
Eduardo Schoedler

-
Histórico: http://www.fug.com.br/historico/html/freebsd/
Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd


[FUG-BR] RES: RES: freebsd 8.2 - tuning de rede

2011-03-11 Por tôpico Eduardo Schoedler
Para fazer o teste do flood (-f), você precisa aumentar a quantidade de
pacotes icmp no sysctl.

# sysctl net.inet.icmp.icmplim=0


Gosto de fazer teste com pacotes a cada 20ms, com tamanho maior:

# ping -s 1400 -i 0.02 -c 1000 -q x.x.x.2
PING x.x.x.2 (x.x.x.2): 1400 data bytes

--- x.x.x.2 ping statistics ---
1000 packets transmitted, 1000 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.111/0.114/0.201/0.005 ms

--
Eduardo Schoedler


 -Mensagem original-
 De: freebsd-boun...@fug.com.br [mailto:freebsd-boun...@fug.com.br] Em
 nome de Rafael Henrique Faria
 Enviada em: sexta-feira, 11 de março de 2011 12:00
 Para: Lista Brasileira de Discussão sobre FreeBSD (FUG-BR)
 Assunto: Re: [FUG-BR] RES: freebsd 8.2 - tuning de rede
 
 Você chegou a testar com o ping -f para ver a real perda de pacotes?
 
 root@freud rafaelhfaria # ifconfig lagg0
 lagg0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST metric 0 mtu
 1500
 options=19bRXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4
 ether 00:1f:29:58:ee:b2
 inet 172.30.0.1 netmask 0x broadcast 172.30.255.255
 inet6 fe80::21f:29ff:fe58:eeb2%lagg0 prefixlen 64 scopeid 0x6
 nd6 options=3PERFORMNUD,ACCEPT_RTADV
 media: Ethernet autoselect
 status: active
 laggproto lacp
 laggport: em2 flags=1cACTIVE,COLLECTING,DISTRIBUTING
 laggport: em1 flags=1cACTIVE,COLLECTING,DISTRIBUTING
 laggport: em0 flags=1cACTIVE,COLLECTING,DISTRIBUTING
 
 
 root@freud rafaelhfaria # ping -f 172.30.1.1
 PING 172.30.1.1 (172.30.1.1): 56 data bytes
 ..^C.
 --- 172.30.1.1 ping statistics ---
 398758 packets transmitted, 398756 packets received, 0.0% packet loss
 round-trip min/avg/max/stddev = 0.060/0.108/11.330/0.038 ms
 root@freud rafaelhfaria #
 
 Perdendo 2 pacotes entre quase 400 mil pacotes, acredito que seja
 aceitável.
 Porém no meu caso, tenho um Switch D-Link DGS-3100 no meio, e apenas
 esta
 máquina está usando Link Aggregation. A outra possui apenas uma conexão
 com
 o switch.
 
 --
 Rafael Henrique da Silva Faria
 -
 Histórico: http://www.fug.com.br/historico/html/freebsd/
 Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd

-
Histórico: http://www.fug.com.br/historico/html/freebsd/
Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd


[FUG-BR] RES: RES: freebsd 8.2 - tuning de rede

2011-03-11 Por tôpico Eduardo Schoedler
Meus mbufs estão bem menores:
kern.ipc.nmbclusters=65536

--
Eduardo Schoedler

 -Mensagem original-
 De: freebsd-boun...@fug.com.br [mailto:freebsd-boun...@fug.com.br] Em
 nome de kmkz bleh
 Enviada em: sexta-feira, 11 de março de 2011 12:06
 Para: Rafael Henrique Faria
 Cc: Lista Brasileira de Discussão sobre FreeBSD (FUG-BR)
 Assunto: Re: [FUG-BR] RES: freebsd 8.2 - tuning de rede
 
 Outra coisa que estou vendo, é que além dos pacotes perdidos, ainda
 tenho
 
 ping: sendto: No buffer space available
 
 Mas já aumentei muito o kern.ipc.nmbclusters (no momento deixei
 4194304).
 
 gw-ija# netstat -nm
 6521/3724/10245 mbufs in use (current/cache/total)
 6517/3713/10230/4194304 mbuf clusters in use (current/cache/total/max)
 *6516/2956 mbuf+clusters out of packet secondary zone in use
 (current/cache)
 *
 0/0/0/12800 4k (page size) jumbo clusters in use
 (current/cache/total/max)
 0/0/0/6400 9k jumbo clusters in use (current/cache/total/max)
 0/0/0/3200 16k jumbo clusters in use (current/cache/total/max)
 14688K/8357K/23045K bytes allocated to network (current/cache/total)
 0/0/0 requests for mbufs denied (mbufs/clusters/mbuf+clusters)
 0/0/0 requests for jumbo clusters denied (4k/9k/16k)
 0/6/6656 sfbufs in use (current/peak/max)
 0 requests for sfbufs denied
 0 requests for sfbufs delayed
 0 requests for I/O initiated by sendfile
 0 calls to protocol drain routines
 
 Mas não esta fazendo efeito...
 
 Em 11 de março de 2011 11:59, Rafael Henrique Faria 
 rafaelhfa...@cenadigital.com.br escreveu:
 
  Você chegou a testar com o ping -f para ver a real perda de
 pacotes?
 
  root@freud rafaelhfaria # ifconfig lagg0
  lagg0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST metric 0
 mtu 1500
 
 options=19bRXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4
  ether 00:1f:29:58:ee:b2
  inet 172.30.0.1 netmask 0x broadcast 172.30.255.255
  inet6 fe80::21f:29ff:fe58:eeb2%lagg0 prefixlen 64 scopeid 0x6
  nd6 options=3PERFORMNUD,ACCEPT_RTADV
  media: Ethernet autoselect
  status: active
  laggproto lacp
  laggport: em2 flags=1cACTIVE,COLLECTING,DISTRIBUTING
  laggport: em1 flags=1cACTIVE,COLLECTING,DISTRIBUTING
  laggport: em0 flags=1cACTIVE,COLLECTING,DISTRIBUTING
 
 
  root@freud rafaelhfaria # ping -f 172.30.1.1
  PING 172.30.1.1 (172.30.1.1): 56 data bytes
  ..^C.
  --- 172.30.1.1 ping statistics ---
  398758 packets transmitted, 398756 packets received, 0.0% packet loss
  round-trip min/avg/max/stddev = 0.060/0.108/11.330/0.038 ms
  root@freud rafaelhfaria #
 
  Perdendo 2 pacotes entre quase 400 mil pacotes, acredito que seja
  aceitável.
  Porém no meu caso, tenho um Switch D-Link DGS-3100 no meio, e apenas
 esta
  máquina está usando Link Aggregation. A outra possui apenas uma
 conexão com
  o switch.
 
  --
  Rafael Henrique da Silva Faria
 
 -
 Histórico: http://www.fug.com.br/historico/html/freebsd/
 Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd

-
Histórico: http://www.fug.com.br/historico/html/freebsd/
Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd