|
From: Michael B. <Mic...@In...> - 2005-01-03 16:19:34
|
How did your test work out?=20 Thanks, Michael=20 -----Original Message----- From: sgdailey [mailto:sgd...@ro...]=20 Sent: Wednesday, December 29, 2004 6:30 PM To: ipt...@li... Subject: [Iptablelog-users] Using Memoize to speed up DNS Thanks to Michael Brown for pointing me in the right direction on the delay I was experiencing in the web page updates. I have modified feed_db.pl a little bit to use memoize to speed up name lookups. Memoize is a Perl module and can be downloaded here. http://perl.plover.com/Memoize/Memoize-1.01.tar.gz Memoize will cache results of a function, next time that function is called it will see if the arguments already have a cached result and if so will simply use the cached results instead of calling the function again. Here are the changes I made to feed_db.pl line 30 or so looks like this: use Socket; just add these next three lines under that line: use Memoize; memoize 'mygethostbyaddr'; sub mygethostbyaddr { gethostbyaddr(@_) }; I haven't tested it extensively yet but I'm hoping it wont continuously look up a host that has probed a thousand ports. I am about to flood the log and see how it handles it. I will post results. Thanks again to Michael Brown sgdailey ------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ Iptablelog-users mailing list Ipt...@li... https://lists.sourceforge.net/lists/listinfo/iptablelog-users |