Named pipe buffer size

From: DAUBIGNE Sebastien - BOR ( SDaubigne@bordeaux-bersol.sema.slb.com ) (SDaubigne@bordeaux-bersol.sema.slb.com)
Date: Thu Mar 27 2003 - 13:09:50 EST


I'm looking for some kernel parameter to tune the named pipe (fifo) buffer
size.

For instance, if I start this :

> mkfifo /tmp/fifo1
> dd if=/dev/zero of=/tmp/fifo1 bs=65536 &
[1] 9293
> dd if=/tmp/fifo1 of=/dev/null bs=65536 &
[2] 9261

Well, the pipe writer issue 64kb writes to the pipe (truss output) :

9293/1: read(3, "\0\0\0\0\0\0\0\0\0\0\0\0".., 65536) = 65536
9293/1: write(4, "\0\0\0\0\0\0\0\0\0\0\0\0".., 65536) = 65536

But the pipe reader gets 10kb reads from the pipe, although it asks for 64kb
:

9261/1: read(3, "\0\0\0\0\0\0\0\0\0\0\0\0".., 65536) = 10240
9261/1: write(4, "\0\0\0\0\0\0\0\0\0\0\0\0".., 10240) = 10240

I guess there is some kernel parameter that limit the in-memory pipe buffer
to 10k, thus the writer process write syscalls are blocked until the reader
process has issued 7 reads (7x10k).

This generates more reader syscalls, more memory copy operations and more
kernel CPU consumption. Suppose I want to make 1 Mb I/O to reduce kernel
CPU, the 10k buffer limit will not help.

Is there any way to tune up the buffer size ?

---
Sebastien DAUBIGNE 
sdaubigne@bordeaux-bersol.sema.slb.com
<mailto:sdaubigne@bordeaux-bersol.sema.slb.com>  - (+33)5.57.26.56.36
SchlumbergerSema - SGS/DWH/Pessac
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers


This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:26:04 EDT