On Friday 13 November 2009 17:14, McKown, John wrote:
>I think you're right. He was worried that instead of his program just
> reading the file(s), the I/O would be: (1) "cat" reading the files from
> disk; (2)writing the contents to the pipe and (3) his program reading the
> pipe. Or about 3x the I/O. But pipes are not hardened to disk (ignoring
> paging?), so it is more like a VIO dataset in z/OS (VIO datasets are
> written to memory only).
I was curious to see what the overhad is, so I made five 1GB files:
# for f in one two three four five; do \
dd if=/dev/urandom of=$f bs=1M count=1024; done
and then tried running a simple tool that would just read through them all to
get a base time:
# time od one two three four five > /dev/null
real 21m13.009s
user 19m52.603s
sys 0m11.557s
Then I tried the named pipe approach:
# mknod pipe p
# time (cat one two three four five > pipe & od -c pipe > /dev/null)
real 58m19.154s
user 56m56.490s
sys 0m20.361s
Now this is just on a laptop, and a very crude measurement, but it sure looks
like there's a bit of overhead in them thar named pipes and cat!
- MacK.
-----
Edmund R. MacKenty
Software Architect
Rocket Software
275 Grove Street · Newton, MA 02466-2272 · USA
Tel: +1.617.614.4321
Email: [email protected]
Web: www.rocketsoftware.com
----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390