On Wed, Apr 28, 2010 at 4:08 PM, Richard L. Hamilton <[email protected]> wrote:
> AFAIK, the BSDs implement pipe() as a special case of socketpair(),
> and thus pipes are subject to RLIMIT_SBSIZE (SB == socket buffer, I presume).
>
> That rlimit does not exist on Solaris, AFAIK, although the systemwide
> ndd tunables udp_max_buf and tcp_max_buf exist.
>
> I have a shared object somewhere that I can LD_PRELOAD to
> make pipe() for the affected process call socketpair(). As I recall, I'd
> run a shell with that preset and used it for awhile, and nothing seemed
> to break. But that's not a robust test.
>
> If anyone wants it, I could post the source for that, presumably as
> an attachment, since the forums mangle directly posted source.
>
> I'd also played around with pushing bufmod onto a (for Solaris) regular
> STREAMS based pipe, but I never found a way to tell whether it made any
> difference in the behavior. I don't know without digging around if I kept
> any examples of that.
>
> Unless someone can demonstrate a performance problem with the existing
> pipe implementation, I suspect that trying to make ulimit -p settable
> on Solaris is a waste of time...
I did do benchmarks.
Solaris has the SLOWEST pipe implementation I found so far. I finished
my patches, now for DragonflyBSD (FreeBSD coming soon) and numbers are
this:
Solaris 11 build 134, x86:
mkfile 500m testx
time bash -c 'cat <testx | cat | cat | cat | cat | cat | cat | cat |
cat | cat | cat | cat | cat | cat | cat | cat | cat | cat | cat'
>/dev/null
real 0m15.96s
user 0m1.48s
sys 0m23.64s
DragonflyBSD, x86, 64k pipe buffer:
mkfile 500m testx
time bash -c 'cat <testx | cat | cat | cat | cat | cat | cat | cat |
cat | cat | cat | cat | cat | cat | cat | cat | cat | cat | cat'
>/dev/null
real 0m7.10s
user 0m0.55s
sys 0m9.40s
DragonflyBSD, x86, 16k pipe buffer:
mkfile 500m testx
time bash -c 'cat <testx | cat | cat | cat | cat | cat | cat | cat |
cat | cat | cat | cat | cat | cat | cat | cat | cat | cat | cat'
>/dev/null
real 0m10.41s
user 0m0.91s
sys 0m14.38s
DragonflyBSD, x86, 4k pipe buffer:
mkfile 500m testx
time bash -c 'cat <testx | cat | cat | cat | cat | cat | cat | cat |
cat | cat | cat | cat | cat | cat | cat | cat | cat | cat | cat'
>/dev/null
real 0m14.46s
user 0m1.27s
sys 0m20.77s
As you can see the performance on identical hardware differ greatly
and depends on pipe implementation and buffer size.
Chris
--
^---^
(@)v(@) Chris Pickett
| / IT consultant
===m==m=== [email protected]
_______________________________________________
perf-discuss mailing list
[email protected]