Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Jan 2000 01:20:08 -0800
From:      "Scott Hess" <scott@avantgo.com>
To:        "Matthew Dillon" <dillon@apollo.backplane.com>
Cc:        <freebsd-hackers@FreeBSD.ORG>
Subject:   Re: Performance issue with rfork() and single socketpairs versus multiple socketpairs.
Message-ID:  <0be801bf6715$601423d0$1e80000a@avantgo.com>
References:   <01b601bf6696$60701930$1e80000a@avantgo.com> <200001241939.LAA91219@apollo.backplane.com>

next in thread | previous in thread | raw e-mail | index | archive | help
"Matthew Dillon" <dillon@apollo.backplane.com> wrote:
> :Unfortunately, I've found that having a group of processes reading from
a
> :group of socketpairs has better performance than having them all read
from
> :a single socketpair.  I've been unable to determine why.
>
>     The problem is that when you have N processes waiting on a single
>     socket and you write to the socket, all N processes will wake up even
>     though only one will get the data you wrote.
<snip>
>     As an alternative to socket pairs, I would consider using SysV shared
>     memory and SysV semaphores.

OK, so let's say I did spend some time implementing it in terms of semget()
and semop().  Would you be totally apalled if the performance turned out to
be about the same as using a single socketpair?  Do you have a very strong
feeling that it should be significantly better.  [Again, under
3.4-release.]  I don't think I've done anything egregious, but things don't
seem much better.  Unfortunately, I'll have to wait until tomorrow morning
to rip things out and make a suitable example program for posting.

Actually, the performance profile does seem different (for lower loads, the
semaphore solution seems more efficient), but the performance limits seem
much the same between the single socketpair and semaphore versions when I
starts using 16-20 worker processes.  It's possible that I'm doing
something which makes the system intrinsically top out at a given point -
tomorrow I'm going to attempt to make the minimal changes necessary to
adapt multiple socketpairs to the existing system, in the hope that either
the multiple socketpair version is faster in context, or it's slower living
in this set of code than in the original prototype.

Thanks,
scott




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0be801bf6715$601423d0$1e80000a>