Will Murnane wrote:
> On 8/14/07, Andrew Suffield <[EMAIL PROTECTED]> wrote:
>> That seems correctable. Pass the log through tac, use head instead of
>> tail, and pass the output of head through tac again.
> 'tail' is much faster.  Even with a huge file (the one I tested with
> is 26 gigabytes) it simply mmap()s the file and then scans backwards
> until it's got enough newlines - it took about 1/20th of a second on
> that 26GB file.  Perhaps shorewall is using a different, less
> efficient method?

The log file can have other record types besides netfilter messages. So
Shorewall was piping the output of 'grep' through 'tail' which doesn't
permit that optimization. As I reported in the earlier post, switching to
Andrew's algorithm does improve performance.

-Tom
-- 
Tom Eastep    \ Nothing is foolproof to a sufficiently talented fool
Shoreline,     \ http://shorewall.net
Washington USA  \ [EMAIL PROTECTED]
PGP Public Key   \ https://lists.shorewall.net/teastep.pgp.key

Attachment: signature.asc
Description: OpenPGP digital signature

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Shorewall-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-users

Reply via email to