- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Anyone ever seen the source code to tee ?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2006 10:21 PM
03-21-2006 10:21 PM
Anyone ever seen the source code to tee ?
$ mkfifo named_pipe
$ zcat $COMPRESSED_FILE | tee named_pipe | wc -l &
$ dbload...(from the named pipe)...
Its reading from SCSI320 15krpm disks and loading into Informix on an xp12k. Its on a 16 way SD32 with tons of cpu and i/o capability.
The objective is to allow database loads direct from compressed files and do a separate count on rows in the uncompressed data at the same time. The w/c output is compared with the number of rows loaded by dbload as an assurance. This method condenses 3 scans up the data files into a single pass, some of which are several Gb.
But: the i/o is low, 600 block/sec being read, zcat has low cpu (3%), the wordcounts are running at about 35%, the data loads at about 50%, but the tee processes are taking 80% cpu.
Does tee read byte by byte or has it a modicum of buffering built in to the program?
Incidentally I am also finding that named pipes aren't as fast as using | . Does that make sense to people? Why?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2006 10:26 PM
03-21-2006 10:26 PM
Re: Anyone ever seen the source code to tee ?
The tee program is known as a â pipe fitting.â tee copies its standard input to its standard output and also duplicates it to the files named on the command line.
More information at, http://www.tldp.org/LDP/abs/html/extmisc.html
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2006 10:50 PM
03-21-2006 10:50 PM
Re: Anyone ever seen the source code to tee ?
The nature of your command makes tee more slow in your case. I am sure that your complete unzip to a file system and read from their and loading into datbase would be much faster.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2006 10:58 PM
03-21-2006 10:58 PM
Re: Anyone ever seen the source code to tee ?
Straight data loads from uncompressed data go at the same rate, but combining them with a named pipe and a tee slows it all down. Its actually a close call i.e.
uncompress, then dbload, then wc -l involves 3 scans up 100Gb of data, but that is only about 15% slower than running all 3 commands in parallel - 100Gb single scan through tee and into wc, but also through a named pipe.
Maybe the named pipe really is writing into the filesystem and reading it back out again - i.e. converting 3 reads into 2 reads and one write which might explain the performance. It appears at the moment that | goes through memory whereas named pipes actually cause the file to grow to 8kb in size and sar -b to go through the roof. True?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2006 11:15 PM
03-21-2006 11:15 PM
Re: Anyone ever seen the source code to tee ?
I know that's not exactly what you're looking for but if it can help you, I've joined the source code of tee in MINIX.
have a look at http://www.minix.org/
Regards.
Pat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2006 11:37 PM
03-21-2006 11:37 PM
Re: Anyone ever seen the source code to tee ?
http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000081050133
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2006 02:27 AM
03-22-2006 02:27 AM
Re: Anyone ever seen the source code to tee ?
Thanks for the help so far. It looks like my bright idea is becoming less bright when tested. It does at least mean that I can save disk space, copy compressed stuff around and load direct into the DB without needing 200Gb of free space to uncompress it beforehand, plus it saves me half an hour of waiting, so not all bad.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2006 12:16 PM
03-22-2006 12:16 PM
Re: Anyone ever seen the source code to tee ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2006 01:10 PM
03-22-2006 01:10 PM