From: Marek Kierdelewicz <marek@piasta.pl>
To: MontyRee <chulmin2@hotmail.com>
Cc: netfilter@vger.kernel.org
Subject: Re: iptables use only one cpu core.
Date: Fri, 26 Feb 2010 08:07:20 +0100 [thread overview]
Message-ID: <20100226080720.3a25159d@catlap> (raw)
In-Reply-To: <BLU149-W31E11A0A84D21AC4C9F3B7853F0@phx.gbl>
>Hi all.
Hello
>When I send lots of queries to the iptables enabled NAT system,
>I found that NAT system use only 1 cpu core even this system has 4
>cores. So the (TPS)performance result was not good.
You probably use just one nic that is singlequeue and capable of
directing interrupts to one core. There are two good solutions:
1) Put n*NICs into the box, where n-number of cores. Distribute traffic
between those nics (Etherchannel on switch + bonding[1] on Linux side).
Then use smp affinity settings to bind different nics (irqs) to
different Cores. It can be done with simple script below:
ETH0_IRQ=`cat /proc/interrupts|grep eth0|cut -d: -f1`
ETH1_IRQ=`cat /proc/interrupts|grep eth1|cut -d: -f1`
ETH2_IRQ=`cat /proc/interrupts|grep eth2|cut -d: -f1`
ETH3_IRQ=`cat /proc/interrupts|grep eth3|cut -d: -f1`
echo 1 > /proc/irq/$ETH0_IRQ/smp_affinity
echo 2 > /proc/irq/$ETH1_IRQ/smp_affinity
echo 4 > /proc/irq/$ETH2_IRQ/smp_affinity
echo 8 > /proc/irq/$ETH3_IRQ/smp_affinity
2) Use intel nic with chip >=82575 (igb driver) [2]. Those nics support
MULTIQUEUE. In your case can have 4 separate irq-rx vectors on one
nic. Basicly hardware on NIC chip is doing the same the
bonding/etherchannel done in 1).
[1]http://www.linuxfoundation.org/collaborate/workgroups/networking/bonding
[2]http://download.intel.com/design/network/applnots/319935.pdf
prev parent reply other threads:[~2010-02-26 7:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-26 4:55 iptables use only one cpu core MontyRee
2010-02-26 7:07 ` Marek Kierdelewicz [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100226080720.3a25159d@catlap \
--to=marek@piasta.pl \
--cc=chulmin2@hotmail.com \
--cc=netfilter@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox