Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re^2: Redirect data and Filehandle manipulation (STDIN x Disk IO)

by mda2 (Hermit)
on Jul 01, 2005 at 15:13 UTC ( #471750=note: print w/replies, xml ) Need Help??

in reply to Re: Recirect data and Filehandle manipulation (STDIN x Disk IO)
in thread Redirect data and Filehandle manipulation (STDIN x Disk IO)

I really need to work without write temp file, to improve performance on postfix smtp servers.

After your response I found references for "< redirection" ("opens the file for input, default unit 0"), and confirm with lsof command:

script < input & # lsof -p PID COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME ... cut ... perl 20316 root 0r REG 8,2 43151 1564123 /root/av/mail.e +xploits perl 20316 root 1u CHR 136,2 4 /dev/pts/2 perl 20316 root 2u CHR 136,2 4 /dev/pts/2

Thank's for your response!

Marco Antonio

Replies are listed 'Best First'.
Re^3: Redirect data and Filehandle manipulation (STDIN x Disk IO)
by Tanktalus (Canon) on Jul 01, 2005 at 17:53 UTC

    To be honest, I would still use a temp file. And then, because this is perl, you could change it from an IO::File to an IO::Scalar later and compare if you're really saving any clock time. I'm betting it's not going to be significant on most modern hardware and OS. HD speeds continue to improve, as do the caching algorithms of the OS.

    This smells of premature optimisation to me.

      I'm using 5 dell servers (2 Xeon 3.2, 2GB ram, hds scsi, inet gbit), on normal traffic 1 G messages daily, but frequently we are target from spams/worms, and content filter is my task to improve performace...

      With normal usage of STDIN or temp file is equal, on hush hours it's the disk io is problem...

      I'm trying it before propose changes on content filter method...

      Perhaps this is exaggerates, but the profit called me attention. Other plataform changes are possible... :(

      Marco Antonio

      Really... I lost us time... it's don't functional with postfix content-filter (node updated).
      I getting all content into a scalar, considering memory/disk io speed, max message size and process limits (to don't use swap).

      Thank's by your attemption!

      Marco Antonio

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://471750]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2019-12-06 05:46 GMT
Find Nodes?
    Voting Booth?
    Strict and warnings: which comes first?

    Results (154 votes). Check out past polls.