Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Jun 2014 15:38:23 -0400
From:      Adrian Chadd <adrian@freebsd.org>
To:        Igor Mozolevsky <igor@hybrid-lab.co.uk>
Cc:        Hackers freeBSD <freebsd-hackers@freebsd.org>, Daniel Janzon <janzon@gmail.com>, Dirk Engling <erdgeist@erdgeist.org>, Ian Lepore <ian@freebsd.org>
Subject:   Re: Best practice for accepting TCP connections on multicore?
Message-ID:  <CAJ-Vmo=qo5gGmD6PAeoGLTRpS=wk0=Bm%2Bc49NHLM2BBhVHuphQ@mail.gmail.com>
In-Reply-To: <CADWvR2getzzd8we%2BYSQS6vq-7kJn2j-3WhQxWQAP9O8GNLWZOQ@mail.gmail.com>
References:  <CAAGHsvDhaqQbwir5P%2BoaH_Qa8VZ0aj9A2SGrn%2B2shJMQ21B6Jw@mail.gmail.com> <alpine.BSF.2.00.1406070252270.21531@erdgeist.org> <CADWvR2gkeNaeVPizq_VubWhEHy3ywURJOdv9C=6PNybwYyFqRg@mail.gmail.com> <CAJ-Vmonm3aZr=kP293x90Am7VzWQQ65cTE8fiTZ6KAECegoZGQ@mail.gmail.com> <1402159374.20883.160.camel@revolution.hippie.lan> <CADWvR2guSYMKEm2HkzXNVuO%2BVS6=_a9jFBmKcSE2BzjYfiaUrQ@mail.gmail.com> <CAJ-Vmom=QOZtn1jQADPZfV10TXD4aoNQT7jhip_sp_=zQ04jog@mail.gmail.com> <CADWvR2getzzd8we%2BYSQS6vq-7kJn2j-3WhQxWQAP9O8GNLWZOQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 7 June 2014 15:26, Igor Mozolevsky <igor@hybrid-lab.co.uk> wrote:

> I did say it was in Java, but so what? By 2008 Sun were going out of their
> way to make Java both scalable and zero-cost. The point I was making was
> that we set off with the assumption that kevent-based sockets are faster,
> therefore server (as  a whole) was assumed to have a higher performance; and
> never bothered to actually measure it. On coding complexity front, from
> slide 36:
>
> The story of Rob Van Behren
> (as remembered by me from a lunch with Rob)
>
> Set out to write a high-performance asynchronous server system
>
> Found that when switching between clients, the code for saving and restoring
> values/state was difficult
>
> Took a step back and wrote a finely-tuned, organized system for saving and
> restoring state between clients
>
> When he was done, he sat back and realized he had written the foundation for
> a threading package

Right, and he implemented a _userland_ threading package. He tried
writing a generic framework for doing this stuff, likely with
coroutines, and yes he ended up with a userland threading library.
This doesn't surprise me.

We can do better. We can batch syscalls. We can batch event updates.
We can batch IO. We can look at doing zero-copy IO. We can schedule
things to keep them hot on CPU cores. He didn't talk about any of
that.

As I said, there's much more to this picture than just "threaded or
not threaded." Take a look at the recentish Yahoo! paper talking about
batched syscalls, for example.

I'm jut tackling a small corner of it. Once it's done I'll likely look
at some VM-light way of doing zero-copy IO. (The VM locking and
refcouting overhead for doing all those 4k operations just sucks.) But
this is all in my spare time, so it'll happen when it happens. I'm
just fed up with it not being done.



-a



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-Vmo=qo5gGmD6PAeoGLTRpS=wk0=Bm%2Bc49NHLM2BBhVHuphQ>