cpu e spamfoo
Question asked by Sabatino - 9/1/2026 at 8:33 AM
Answered

My current traffic is quite low at the moment.
However, I notice spikes in CPU usage by the spamfoo client.

Since you haven't enabled classification (except for a single domain that gets very little traffic), what are you doing?
Sabatino Traini
      Chief Information Officer
Genial s.r.l. 
Martinsicuro - Italy

Adam De Lay Replied
I noticed the same thing this morning.  Classifications haven't been enabled, but the spamfoo-client could be quite for a few seconds and then jumps back up near 50% CPU.
Sabatino Replied
Is it perhaps performing a learning process for all users who have messages in their junk mail folder?
Sabatino Traini
      Chief Information Officer
Genial s.r.l. 
Martinsicuro - Italy

Adam De Lay Replied
Would be interesting if it was.

I noticed when looking at the spamfoo dashboard for the server, the average scan time seems pretty slow.  For the last hour, it's scanned 1199 messages and the average scan time is 4.4 seconds.
Tim Uzzanti Replied
Employee Post
Hey guys,

SpamFoo only uses CPU when it’s available; it does not take any resources from SmarterMail. Expect it to do more when SmarterMail doesn't have much work to do.
Tim Uzzanti
CEO
SmarterTools Inc.
Adam De Lay Replied
Thanks Tim.

How fast should the average scan time be?  I checked again this morning and for the last hour it's scanned 704 messages with an average scan time of 6 seconds. 
Tim Uzzanti Replied
Employee Post
Lets start by telling us what kind of hardware is your Mail
Server running on. 
Tim Uzzanti
CEO
SmarterTools Inc.
Adam De Lay Replied
Windows Server 2019 Datacenter
Intel Xeon Silver 4110 CPU 2.10Ghz 8 Core
16Gb Ram
Sabatino Replied
Here's my situation:
VM with 6 cores and 16GB of RAM
Win Server 2019 Standard
Sabatino Traini
      Chief Information Officer
Genial s.r.l. 
Martinsicuro - Italy

Adam De Lay Replied
@Sabatino how many domains are you managing on your server?  I've got just shy of 700 on mine.
Sabatino Replied
Sabatino Traini
      Chief Information Officer
Genial s.r.l. 
Martinsicuro - Italy

Tim Uzzanti Replied
Employee Post
I'm not sure what numbers you’re looking at to understand the timing. SpamFoo spends about a second or two on messages and is configured by default to only use CPU when it’s available, up to 50%. They are also implementing OORT functionality, which allows users to dedicate more memory to SpamFoo, which can speed up CPU processing significantly. In addition, GPU will take basically no CPU and will do things in milliseconds. 

If you’re looking at time to process messages in SmarterMail itself, that is a combination of MANY tasks like DNS, RBLs, other spam checks, and more.  

And, as you guys probably already know. All of this is being done across tons of threads and working concurrently since some of these tasks like DNS, RBLs can take seconds, and sometimes these services are being hit hard and can fail to respond, which we end up hitting our timeouts. If you’re worried about message processing speeds, RBLs and URIBLs can be some of the worst culprits.  
Tim Uzzanti
CEO
SmarterTools Inc.
Adam De Lay Replied
I'm looking at the SpamFoo Dashboard.  It's fluctuating between 2-6 seconds of average scan time per hour. 

I did check the RBL and URBL lists and almost all of them are sub 100ms.  

Tim Uzzanti Replied
Employee Post
Does that correlate with your server using high CPU at the same time?  Like I said, SpamFoo uses CPU when it’s available.  It is possible; it is waiting and letting your server do what it needs.  I'm going to reach out to our SpamFoo contact and get more info; we don’t see those kind of times often.  
Tim Uzzanti
CEO
SmarterTools Inc.
Adam De Lay Replied
I don't think so.  Hard to get a solid read because the numbers from spamfoo are just an hourly average.  Smartermail is using an avg of 1-5% CPU per hour.  I see spamfoo acting just as you said where it occasionally jumps up to 50% for a short period of time.  ClamAV occasionally jumps up to 10/20% but it seems like the system is mostly sitting between 10-25% CPU on average.  

If there's a customer that has "unique" issues, it'll be us.  We always seem to be pushing the boundaries of systems due to the volume of customers we process.  
Zach Sylvester Replied
Employee Post Marked As Answer
Hey Everyone, 

Based on the hardware you posted and what we’re seeing, the scan times you’re reporting are within what we would expect and do not indicate a performance issue.

SpamFoo performs a substantial amount of local model processing for every message, including generating multiple embeddings used by its spam detection and classification models. That processing is necessary to maintain detection and classification accuracy.

The Xeon Silver 4110 is an older processor, so a few seconds of processing time for this type of CPU-based inference is not unexpected. The scan-time metric also should not be viewed in isolation as an indication that SpamFoo is negatively affecting SmarterMail.

SpamFoo is designed to perform this processing within a controlled resource footprint. It limits processing concurrency, maintains a relatively small memory footprint, and performs the model inference locally without requiring additional external processing.

What ultimately matters is whether mail flow is being delayed, queues are continually growing, or SmarterMail itself is becoming less responsive. If none of those things are occurring, then there is no performance issue to address here.

Based on the information provided so far, what you’re seeing appears consistent with the workload SpamFoo is performing and the hardware available.

You guys did bring up some interesting topics to discuss with the SpamFoo team though regarding performance. So I will bring those up at our next meeting with them. 

Kind Regards, 

Zach Sylvester

Software Developer
SmarterTools Inc.

Reply to Thread

Enter the verification text