You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Pedro David Marco <pe...@yahoo.com> on 2018/08/04 09:15:13 UTC

Asynchronous checks with AsyncLoop for no DNS stuff

I would like to run asynchronous checks via AsyncLoop... does anyone know of any plugin, or sort of code, or framework that uses AsyncLoop for no DNS related checks? 
Thanks...
----PedroD

Re: Asynchronous checks with AsyncLoop for no DNS stuff

Posted by John Hardin <jh...@impsec.org>.
On Sun, 5 Aug 2018, RW wrote:

> On Sat, 4 Aug 2018 16:18:35 -0700 (PDT)
> John Hardin wrote:
>
>> On Sat, 4 Aug 2018, RW wrote:
>>
>>> On Sat, 4 Aug 2018 17:14:18 +0000 (UTC)
>>> Pedro David Marco wrote:
>>>
>>>>
>>>> Async dns lookups work nice... but it would be great to run
>>>> asynchronously checks for Atachments content for example..
>>>
>>> I don't think there would be a benefit in parallelizing anything
>>> that's CPU limited.
>>
>> Modulo multi-core hardware...
>
> Spamassassin usually runs with multiple spamd or amavisd child
> processes. As you increase the number of active child processes you
> eventually hit a limit to the throughput by either using all the CPU
> time, or you hit a bottleneck such database access.
>
> If SA is CPU limited then parallelizing a CPU limited plugin doesn't
> increase the achievable throughput and neither does it affect the
> number of child processes needed to reach that limit.
>
> If it is hitting a bottleneck then the extra parallelization wont
> increase the throughput, but it could reduce the number of child
> processes needed if you turn-off network tests.

Oh, agreed. I was just pointing out the analysis is somewhat more complex 
than "unlikely benefit in parallelizing anything that's CPU limited."

-- 
  John Hardin KA7OHZ                    http://www.impsec.org/~jhardin/
  jhardin@impsec.org    FALaholic #11174     pgpk -a jhardin@impsec.org
  key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
   My sidearm is a piece of emergency equipment. It absolutely must
   be reliable, not "smart".
-----------------------------------------------------------------------
  Tomorrow: the 73rd anniversary of the Hiroshima bombing

Re: Asynchronous checks with AsyncLoop for no DNS stuff

Posted by RW <rw...@googlemail.com>.
On Sat, 4 Aug 2018 16:18:35 -0700 (PDT)
John Hardin wrote:

> On Sat, 4 Aug 2018, RW wrote:
> 
> > On Sat, 4 Aug 2018 17:14:18 +0000 (UTC)
> > Pedro David Marco wrote:
> >  
> >>
> >> Async dns lookups work nice... but it would be great to run
> >> asynchronously checks for Atachments content for example..  
> >
> > I don't think there would be a benefit in parallelizing anything
> > that's CPU limited.  
> 
> Modulo multi-core hardware...

Spamassassin usually runs with multiple spamd or amavisd child
processes. As you increase the number of active child processes you
eventually hit a limit to the throughput by either using all the CPU
time, or you hit a bottleneck such database access. 

If SA is CPU limited then parallelizing a CPU limited plugin doesn't
increase the achievable throughput and neither does it affect the
number of child processes needed to reach that limit.

If it is hitting a bottleneck then the extra parallelization wont
increase the throughput, but it could reduce the number of child
processes needed if you turn-off network tests.

Re: Asynchronous checks with AsyncLoop for no DNS stuff

Posted by John Hardin <jh...@impsec.org>.
On Sat, 4 Aug 2018, RW wrote:

> On Sat, 4 Aug 2018 17:14:18 +0000 (UTC)
> Pedro David Marco wrote:
>
>>
>> Async dns lookups work nice... but it would be great to run
>> asynchronously checks for Atachments content for example..
>
> I don't think there would be a benefit in parallelizing anything that's
> CPU limited.

Modulo multi-core hardware...

-- 
  John Hardin KA7OHZ                    http://www.impsec.org/~jhardin/
  jhardin@impsec.org    FALaholic #11174     pgpk -a jhardin@impsec.org
  key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
   W-w-w-w-w-where did he learn to n-n-negotiate like that?
-----------------------------------------------------------------------
  Today: the 283rd anniversary of John Peter Zenger's acquittal

Re: Asynchronous checks with AsyncLoop for no DNS stuff

Posted by RW <rw...@googlemail.com>.
On Sat, 4 Aug 2018 17:14:18 +0000 (UTC)
Pedro David Marco wrote:

>  
> Async dns lookups work nice... but it would be great to run
> asynchronously checks for Atachments content for example..

I don't think there would be a benefit in parallelizing anything that's
CPU limited. It may help a bit with systems that are poorly tuned
and it would help improving the latency on lightly loaded systems, but
neither of those are sensible optimizations.  

Where there is room for improvement is in networks plugins like Razor,
DCC etc.


Re: Asynchronous checks with AsyncLoop for no DNS stuff

Posted by Pedro David Marco <pe...@yahoo.com>.
 
Async dns lookups work nice... but it would be great to run asynchronously checks for Atachments content for example..


    On Saturday, August 4, 2018, 3:41:24 PM GMT+2, Benny Pedersen <me...@junc.eu> wrote:  
 Pedro David Marco skrev den 2018-08-04 11:15:
> I would like to run asynchronous checks via AsyncLoop... does anyone
> know of any plugin, or sort of code, or framework that uses AsyncLoop
> for no DNS related checks?

why ?

spamassassin is using async dns lookups, so why another solution ?

give more info

if its for no dns relations its more problematic to make it async, since 
we always have to wait for results, would it not give better results 
with perl compiled with ithreads ?
  

Re: Asynchronous checks with AsyncLoop for no DNS stuff

Posted by Benny Pedersen <me...@junc.eu>.
Pedro David Marco skrev den 2018-08-04 11:15:
> I would like to run asynchronous checks via AsyncLoop... does anyone
> know of any plugin, or sort of code, or framework that uses AsyncLoop
> for no DNS related checks?

why ?

spamassassin is using async dns lookups, so why another solution ?

give more info

if its for no dns relations its more problematic to make it async, since 
we always have to wait for results, would it not give better results 
with perl compiled with ithreads ?