Trevor,

you must change the code to do this.

first define a variable, lets say nextLog at the start of the code area of 
assp.pl (near line 120 after the global 'use ... ' section - like

our $nextLog;

next you have to change the 'sub mlogWrite'

I dont have your old code here in vacation - but it should look like

sub mlogWrite {
    return if $WorkerNumber;
    my @m;
    my $items;
    threads->yield();
    &debugWrite();
    threads->yield;
    $items = $mlogQueue->pending();

between the last two lines - how ever, after '&debugWrite();' and before ' 
$items = $mlogQueue->pending();' 

    threads->yield;
    $items = $mlogQueue->pending();

add the following code

   return if $nextlog < time;
   $nextLog = time + 30;


results in

    threads->yield;
    return if $nextlog < time;
    $nextLog = time + 30;
    $items = $mlogQueue->pending();

the 30 defines the log-write-frequence in seconds

Keep in mind, that the rest of the code assumes that all lines are written 
without a delay. So several features will not work like expected - for 
example the GUI -> MaillogTail.

>say, once every 30-60 seconds or longer,

I think the possibly maximum is around 50 seconds. The MainThread is 
monitored by the MaintThread for actions. If the delay is too long, it may 
happen that the assp process will restart.


It is also possible to use the syslog feature of assp and a modified 
assp_monitor.pl (version 1 with assp 2.1.2(11329)). So fail2ban would not 
query the maillog.txt - instead it scanns the file, frequently  written by 
the monitor.
This way you don't need to change the assp code every time after an 
upgrade.

Thomas



Von:    Trevor Jacques <[email protected]>
An:     ASSP development mailing list <[email protected]>, 
Datum:  17.02.2014 01:58
Betreff:        [Assp-test] ASSP log file update frequency




Hello. 

It’s been a long time that I’ve not had to ask a question, here, but here 
goes: I’ve been running 2.1.2(11329) very successfully for quite a while. 
I’ve not yet ready to upgrade from that, but I have encountered a need to 
slow down the frequency at which maillot.txt is written by assp. This is 
because I use fail2ban to read the asap log for failures. It’s a VERY 
successful combination except that, when there’s an SMTP flood of spam 
e-mails from one or more botnets, the Directory Service goes crazy and 
takes up about 100% of the CPU, as it tries to resolve all the changes to 
the asap log. The apps are fine with about 250 SMTP connexions per day, 
but when, as this past week, I get about 5k SMTP connexions per day, it’s 
too much for the directory service. FWIW, I have tested that it’s the asap 
log, rather than others that fail2ban uses, and I’m 100% certain that it’s 
the asap log update frequency that is causing the problems. :-/ 

I anticipate that, if I can slow the frequency at which asap updates the 
log to, say, once every 30-60 seconds or longer, the server would get 
quiet again. 

Does anyone know if there’s a way to change this write frequency, even if 
I have to modify the asap code? 

Thanks. 

T. 
------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk

_______________________________________________
Assp-test mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/assp-test




DISCLAIMER:
*******************************************************
This email and any files transmitted with it may be confidential, legally 
privileged and protected in law and are intended solely for the use of the 

individual to whom it is addressed.
This email was multiple times scanned for viruses. There should be no 
known virus in this email!
*******************************************************


------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Assp-test mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/assp-test

Reply via email to