Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Mar 2015 18:58:55 +0300
From:      Slawa Olhovchenkov <slw@zxy.spb.ru>
To:        Adrian Chadd <adrian@freebsd.org>
Cc:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Re: irq cpu binding
Message-ID:  <20150329155855.GO23643@zxy.spb.ru>
In-Reply-To: <CAJ-Vmo=zzg82rk_jnsCVJCG8qp-fAWWYfcjpbxBznJH39cBTxA@mail.gmail.com>
References:  <20150328224634.GH23643@zxy.spb.ru> <CAJ-VmokwGgHGP6AjBcGbyJShBPX6dyJjjNeCBcjxLi1obaiRtQ@mail.gmail.com> <20150328230533.GI23643@zxy.spb.ru> <CAJ-VmongWE_z7Rod8-SoFmyiLqiTbHtSaAwjgAs05L_Z3jrWXA@mail.gmail.com> <20150328234116.GJ23643@zxy.spb.ru> <CAJ-VmokSHHm3kMwz=bp7VbgZwADD2_pEr27NdzUfkGq1U=x_sw@mail.gmail.com> <20150329003354.GK23643@zxy.spb.ru> <CAJ-VmonmeeTaSOpSJCJTP7yTeno1LEt-dt9wEhNHk36oY6yY7Q@mail.gmail.com> <20150329081902.GN23643@zxy.spb.ru> <CAJ-Vmo=zzg82rk_jnsCVJCG8qp-fAWWYfcjpbxBznJH39cBTxA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Mar 29, 2015 at 08:20:25AM -0700, Adrian Chadd wrote:

> >> The other half of the network stack - the sending side - also needs to
> >> be either on the same or nearby CPU, or you still end up with lock
> >> contention and cache thrashing.
> >
> > For incoming connections this will be automatuc -- sending will be
> > from CPU binding to receiving queue.
> >
> > Outgoing connections is more complex case, yes.
> > Need to transfer FD (with re-binding) and signaling (from kernel to
> > application) about prefered CPU. Prefered CPU is CPU give SYN-ACK.
> > And this need assistance from application. But I am currently can't
> > remember application massive servering outgouing connections.
> 
> Or you realise you need to rewrite your userland application so it
> doesn't have to do this, and instead uses an IOCP/libdispatch style IO
> API to register for IO events and get IO completions to occur in any
> given completion thread.

nginx is multi-process application, not multi-thread, for example.

> Then it doesn't have to care about moving descriptors around - it just
> creates an outbound socket, and then the IO completion callbacks will
> happen wherever they need to happen. If that needs to shuffle around
> due to RSS rebalancing then it'll "just happen".
> 
> And yeah, I know of plenty of applications doing massive outbound
> connections - anything being an intermediary HTTP proxy. :)

Hmm, yes and no :)
Yes, proxy do outbound connections, but proxy crossover inbound and
outbound connections and in general this connections pined to
different CPU. Is this perfomance gain?..



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150329155855.GO23643>