ramsess Posted February 4, 2014 (edited) · Report post Уважаемые господа, помогите разобратся с одним вопросом. Есть сервер supermicro на двух 2 6-ядерных Xeon E5-2620 2Ггц, c 10G сетевухой Intel X520-DA2. Карточка сидит на x8 pci-e 5Gbps Операционка FreeBSD 9.1-RELEASE. Машинка используется как агрегатор vlan-ов (их там порядка 2000), плюс ipfw шейпер. В ipfw.conf правил всего 76, весь шейпинг реализован на таблицах в четыре строчки. Из настроек: /boot/loader.conf: hw.ixgbe.rxd=4096 hw.ixgbe.txd=4096 hw.ixgbe.num_queues=12 /etc/sysctl.conf: net.inet.ip.fastforwarding=1 net.inet.ip.intr_queue_maxlen=4096 net.inet.ip.dummynet.io_fast=1 net.inet.ip.dummynet.hash_size=65535 net.inet.ip.dummynet.pipe_slot_limit=2048 kern.ipc.nmbclusters=512000 kern.ipc.maxsockbuf=83886080 kern.ipc.nmbjumbop=256000 hw.intr_storm_threshold=9000 dev.ix.0.rx_processing_limit=4096 dev.ix.1.rx_processing_limit=4096 dev.ix.0.enable_aim=0 dev.ix.0.queue0.interrupt_rate=50000 dev.ix.0.queue1.interrupt_rate=50000 dev.ix.0.queue2.interrupt_rate=50000 dev.ix.0.queue3.interrupt_rate=50000 dev.ix.0.queue4.interrupt_rate=50000 dev.ix.0.queue5.interrupt_rate=50000 dev.ix.0.queue6.interrupt_rate=50000 dev.ix.0.queue7.interrupt_rate=50000 dev.ix.0.queue8.interrupt_rate=50000 dev.ix.0.queue9.interrupt_rate=50000 dev.ix.0.queue10.interrupt_rate=50000 dev.ix.0.queue11.interrupt_rate=50000 При трафике около 250Кpps наблюдаются перегрузка по inetrrupt-ам всех 12 ядер и соответственно потери пакетов. Вопрос в следующем - уперся ли я в апаратные ограничения железа, или дело в недостаточной прямизне рук ? Графики прилагаются: Edited February 4, 2014 by ramsess Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
BETEPAH Posted February 4, 2014 (edited) · Report post Это железо точно вытянет больше. Во фре вообще ничего не шарю, но спрошу, что у вас с поллингом? Ну и стандартно ethtool -K eth0 gso off gro off tso off сделано? Edited February 4, 2014 by BETEPAH Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
DVM-Avgoor Posted February 4, 2014 · Report post а interrupt rate в 50к не многовато? Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
Уфаныч Posted February 4, 2014 · Report post С большой вероятностью Вы упёрлись в net.inet.ip.fastforwarding=1 Попробуйте значение 0 Ещё можно потюнить в /boot/loader.conf net.isr.maxthreads=12 net.isr.bindthreads=1 но это если только будет особая нужда и в 'top -SHP' будут перекосы по ядрам можно будет сделать net.isr.maxthreads=6 net.isr.bindthreads=1 тогда маршрутизацией пакетов будет нагружен только один кристалл из Ваших двух. Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
Hawk128 Posted February 4, 2014 · Report post Что-то не так. У меня такая же карта на Е3-1270. Использую оба порта, 30-40% нагрузки на проходящий трафик более 1.5 Гбит в одну сторону. Дамминет прибит к одному ядру? Очереди от сетевух прибиты жестко? Я бы рекомендовал ограничить hw.ixgbe.num_queues=5. 0-е ядро на дамминет, остальные 5 на очереди. Для начала прибейте все к одну процессору. Потом можно второй порт будет добавить. Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
Tamahome Posted February 7, 2014 · Report post ramsess, это явно не железные ограничения, так как на железе (X3440 штука, 4 ядра) на Linux у меня больше трафика, 5G и 700Kpps(роутинг, шэйпинг каждого юзера(а их там более 6000),ipset) и это не предел. Кстати попробуйте прибить все прерывания к одному физическому процессору. Гипертрэдинг отключить. Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
DVM-Avgoor Posted February 7, 2014 · Report post Может вланы дают такой оверхед? Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
Ivan_83 Posted February 7, 2014 · Report post Не могут они такого оверхэда давать. Особенно если сетевуха занимается этим аппаратно. Но если интересно могу подсказать место в ядре где поменять константу чтобы гарантированно не давали :) Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
DVM-Avgoor Posted February 7, 2014 · Report post Кто знает, тс пропал :) Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
ramsess Posted February 15, 2014 · Report post Я не пропал. Пока еще не закончил эксперименты. Решил включить второй 10Ж интерфейс и вынести на него аплинки. Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
vlad11 Posted February 15, 2014 · Report post В ipfw.conf правил всего 76, весь шейпинг реализован на таблицах в четыре строчки. Покажите, плз. Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
ramsess Posted February 28, 2014 · Report post При включении второго интерфейса суммарная нагружка выросла до 2Гбит, потери пропали, что не может не радовать. Но загрузка ядер interrupt-ами осталась на том же уровне. ipfw.conf: add permit udp from any to xxx.xxx.xxx.248 dst-port 53 via vlan10 out add permit udp from any to xxx.xxx.xxx.253 dst-port 53 via vlan10 out add permit tcp from any to xxx.xxx.xxx.251 dst-port 80 via vlan10 out add permit tcp from any to xxx.xxx.xxx.247 dst-port 80 via vlan10 out add permit tcp from any to xxx.xxx.xxx.248 dst-port 80 via vlan10 out add fwd 127.0.0.1,8003 tcp from table(2) to any dst-port 80 via vlan190 out add fwd 127.0.0.1,8003 tcp from table(2) to any dst-port 80 via vlan191 out add fwd 127.0.0.1,8003 tcp from table(2) to any dst-port 80 via vlan195 out add fwd 127.0.0.1,8003 tcp from table(2) to any dst-port 80 via vlan46 out add deny ip from table(2) to any via vlan190 out add deny ip from table(2) to any via vlan191 out add deny ip from table(2) to any via vlan195 out add deny ip from table(2) to any via vlan46 out add fwd 127.0.0.1,8004 tcp from table(6) to any dst-port 80 via vlan190 out add fwd 127.0.0.1,8004 tcp from table(6) to any dst-port 80 via vlan191 out add fwd 127.0.0.1,8004 tcp from table(6) to any dst-port 80 via vlan195 out add fwd 127.0.0.1,8004 tcp from table(6) to any dst-port 80 via vlan46 out add deny ip from table(6) to any via vlan190 out add deny ip from table(6) to any via vlan191 out add deny ip from table(6) to any via vlan195 out add deny ip from table(6) to any via vlan46 out add fwd 127.0.0.1,8002 tcp from table(3) to any dst-port 80 via vlan190 out add fwd 127.0.0.1,8002 tcp from table(3) to any dst-port 80 via vlan191 out add fwd 127.0.0.1,8002 tcp from table(3) to any dst-port 80 via vlan195 out add fwd 127.0.0.1,8002 tcp from table(3) to any dst-port 80 via vlan46 out add deny ip from table(3) to any via vlan190 out add deny ip from table(3) to any via vlan191 out add deny ip from table(3) to any via vlan195 out add deny ip from table(3) to any via vlan46 out add fwd 127.0.0.1,8008 tcp from table(8) to any dst-port 80 via vlan190 out add fwd 127.0.0.1,8008 tcp from table(8) to any dst-port 80 via vlan191 out add fwd 127.0.0.1,8008 tcp from table(8) to any dst-port 80 via vlan195 out add fwd 127.0.0.1,8008 tcp from table(8) to any dst-port 80 via vlan46 out add deny ip from table(8) to any via vlan190 out add deny ip from table(8) to any via vlan191 out add deny ip from table(8) to any via vlan195 out add deny ip from table(8) to any via vlan46 out add fwd 127.0.0.1,8005 tcp from table(4) to any dst-port 80 via vlan190 out add fwd 127.0.0.1,8005 tcp from table(4) to any dst-port 80 via vlan191 out add fwd 127.0.0.1,8005 tcp from table(4) to any dst-port 80 via vlan195 out add fwd 127.0.0.1,8005 tcp from table(4) to any dst-port 80 via vlan46 out add fwd 127.0.0.1,8012 tcp from table(9) to any dst-port 80 via vlan190 out add fwd 127.0.0.1,8012 tcp from table(9) to any dst-port 80 via vlan191 out add fwd 127.0.0.1,8012 tcp from table(9) to any dst-port 80 via vlan195 out add fwd 127.0.0.1,8012 tcp from table(9) to any dst-port 80 via vlan46 out add 9000 count ip from xxx.xxx.221.0/24 to any via vlan191 out add 9010 count ip from any to xxx.xxx.221.0/24 via vlan191 in pipe 60 config bw 512Kbytes mask src-ip 0xffffffff pipe 61 config bw 5120Kbytes mask dst-ip 0xffffffff pipe 100 config bw 1024Kbytes mask src-ip 0xffffffff pipe 101 config bw 10240Kbytes mask dst-ip 0xffffffff pipe 110 config bw 10Mbit/s mask src-ip 0xffffffff pipe 111 config bw 10Mbit/s mask dst-ip 0xffffffff pipe 150 config bw 1536Kbytes mask src-ip 0xffffffff pipe 151 config bw 10240Kbytes mask dst-ip 0xffffffff pipe 152 config bw 750Kbytes mask src-ip 0xffffffff pipe 153 config bw 1500Kbytes mask dst-ip 0xffffffff pipe 200 config bw 2560Kbytes mask src-ip 0xffffffff pipe 201 config bw 10240Kbytes mask dst-ip 0xffffffff pipe 300 config bw 4096Kbytes mask src-ip 0xffffffff pipe 301 config bw 10240Kbytes mask dst-ip 0xffffffff pipe 302 config bw 1500Kbytes mask src-ip 0xffffffff pipe 303 config bw 3000Kbytes mask dst-ip 0xffffffff pipe 500 config bw 4096Kbytes mask src-ip 0xffffffff pipe 501 config bw 10240Kbytes mask dst-ip 0xffffffff pipe 600 config bw 3600Kbytes mask src-ip 0xffffffff pipe 601 config bw 3000Kbytes mask dst-ip 0xffffffff add 10000 pipe tablearg ip from table(100) to any via vlan190 out add 10010 pipe tablearg ip from table(100) to any via vlan191 out add 10020 pipe tablearg ip from any to table(101) via vlan190 in add 10030 pipe tablearg ip from any to table(101) via vlan191 in Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
DVM-Avgoor Posted February 28, 2014 · Report post Можно попробовать skipto 10000 поставить и поглядеть как будет работать :) Все равно имхо многовато проходов, каждый пакетик матчить по такому списку накладненько. Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
vlad11 Posted February 28, 2014 · Report post При включении второго интерфейса суммарная нагружка выросла до 2Гбит, потери пропали, что не может не радовать. Но загрузка ядер interrupt-ами осталась на том же уровне. ipfw.conf: add fwd 127.0.0.1,8012 tcp from table(9) to any dst-port 80 via vlan190 out add fwd 127.0.0.1,8012 tcp from table(9) to any dst-port 80 via vlan191 out add fwd 127.0.0.1,8012 tcp from table(9) to any dst-port 80 via vlan195 out add fwd 127.0.0.1,8012 tcp from table(9) to any dst-port 80 via vlan46 out Пробовали объединить правила? add fwd 127.0.0.1,8012 tcp from table(9) to any dst-port 80 via vlan190,vlan191,vlan195,vlan46 out Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...