Re: perl multithreading performance



dniq00@xxxxxxxxx wrote:
Hello, oh almighty perl gurus!

I'm trying to implement multithreaded processing for the humongous
amount of logs that I'm currently processing in 1 process on a 4-CPU
server.

What the script does is for each line it checks if the line contains
GET request, and if it does - goes through a list of pre-compiled
regular expressions, trying to find a matching one. [...]

Any ideas why in the world it's so slow? I did some research and
couldn't find a lot of info, other than the way I do it pretty much
the way it should be done, unless I'm missing something...

Another, much easier/faster approach, would be:

grep ' GET ' file | your_script.pl

The earlier you can filter out the work that's needed, the better, and you're not going to get much faster than grep. The more refined you
can make that initial filtering of data to only send lines you're
interested in, to your program, the better.
.



Relevant Pages

  • Re: inbound queue ?
    ... Exchange Server 2007: Managing And Filtering Anti-Spam Agent Logs ... (connection filter, content filter, et al), amongst other things. ...
    (microsoft.public.exchange.admin)
  • Re: inbound queue ?
    ... Exchange Server 2007: Managing And Filtering Anti-Spam Agent Logs ... (connection filter, content filter, et al), amongst other things. ...
    (microsoft.public.exchange.admin)
  • Re: SBS 2003 into a Syslog server
    ... I need something to filter them. ... I can't seem to find much filtering help in the Free Kiwi program. ... I would like to centralize my logs and make my SBS server a Syslog ...
    (microsoft.public.windows.server.sbs)
  • Re: SBS 2003 into a Syslog server
    ... I need something to filter them. ... I can't seem to find much filtering help in the Free Kiwi program. ... I would like to centralize my logs and make my SBS server a Syslog ...
    (microsoft.public.windows.server.sbs)
  • Re: March 29, 2006 total eclipse - IT admins WORST NIGHTMARE
    ... and NewsProxy is the answer for that. ... > Comcast news server. ... simply filters out what I dont want on the network. ... NewsProxy - Network level killfile and content filter for Usenet. ...
    (comp.security.firewalls)