Updated Dovecot to 2.3.0. Now Excessive resource usage warnings from CSF/LFD

BBM

Verified User
Joined
Jun 8, 2013
Messages
332
Location
Dutch Mountains
Updated Dovecot to 2.3.0. last night and since then CSF/LFD is sending Excessive resource usage warnings every hour;

Code:
Time:         Sun Jan  7 14:02:11 2018 +0100
Account:      dovecot
Resource:     Process Time
Exceeded:     45127 > 1800 (seconds)
Executable:   /usr/libexec/dovecot/stats
Command Line: dovecot/stats [19 connections]
PID:          8780 (Parent PID:8670)
Killed:       No
Code:
Time:         Sun Jan  7 15:02:17 2018 +0100
Account:      dovecot
Resource:     Process Time
Exceeded:     48733 > 1800 (seconds)
Executable:   /usr/libexec/dovecot/stats
Command Line: dovecot/stats [16 connections]
PID:          8780 (Parent PID:8670)
Killed:       No
Tried adding
Code:
exe:/usr/libexec/dovecot/stats
to csf.pignore but the warnings still continue.

I noticed this in the Dovecot changelog:

v2.3.0 2017-12-22 Timo Sirainen <tss@iki.fi>

* Logging rewrite started: Logging is now based on hierarchical events.
This makes it possible to do various things, like: 1) giving
consistent log prefixes, 2) enabling debug logging with finer
granularity, 3) provide logs in more machine readable formats
(e.g. json). Everything isn't finished yet, especially a lot of the
old logging code still needs to be translated to the new way.
* Statistics rewrite started: Stats are now based on (log) events.
It's possible to gather statistics about any event that is logged.
See http://wiki2.dovecot.org/Statistics for details

What needs to be 'told' CSF/LFD to stop the warnings?
 

Awd

Verified User
Joined
Aug 9, 2015
Messages
316
Hi,
Did you restart CSF?
Code:
csf -r
Otherwise try to add this rules also to csf.pignore

exe:/usr/libexec/dovecot/pop3
exe:/usr/libexec/dovecot/pop3-login
exe:/usr/libexec/dovecot/imap-login
or disable Excessive resource usage warnings completely in csf.conf:
PT_USERMEM=0
then restart CSF
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
4,221
Location
Maastricht
I wouldn't disable the PT_USERMEM for this.

to csf.pignore but the warnings still continue.
Awd is correct, just restart csf and if you want to be really sure also restart lfd.

I'm curious if these stats are needed and if now if it would be possible to disable this process from Dovecot.
 

BBM

Verified User
Joined
Jun 8, 2013
Messages
332
Location
Dutch Mountains
The other 3 rules were already present in csf.pignore.
I restarted CSF with "csf -r". Not sure if that also restarts LFD but will restart both.
 
Last edited:

Richard G

Verified User
Joined
Jul 6, 2008
Messages
4,221
Location
Maastricht
Great. Just for future references... "csf -r" will only restart csf, not lfd which is a seperate process and has to be restarted seperately.
 

zmippie

Verified User
Joined
Apr 19, 2015
Messages
142
I'm seeing the same over here. It's on a smallish VPS, and I'm not sure I'm comfortable with Dovecot using this much CPU time (the "exceeded" times are even higher than those that the OP posted). Is there a way to turn down the degree of logging/stats in Dovecot to save on CPU usage?
 

zmippie

Verified User
Joined
Apr 19, 2015
Messages
142
Okay now, I've been looking over the messages LFD generated from /usr/libexec/dovecot/stats a but more closely today, and I think I see a pattern...

Code:
Time:         Thu Jan 25 16:49:39 2018 +0100
Account:      dovecot
Exceeded:     5443 > 1800 (seconds)

Time:         Thu Jan 25 17:49:45 2018 +0100
Account:      dovecot
Exceeded:     9049 > 1800 (seconds)

Time:         Thu Jan 25 18:49:50 2018 +0100
Account:      dovecot
Exceeded:     12654 > 1800 (seconds)

Time:         Thu Jan 25 19:49:55 2018 +0100
Account:      dovecot
Exceeded:     16259 > 1800 (seconds)

Time:         Thu Jan 25 20:50:01 2018 +0100
Account:      dovecot
Exceeded:     19865 > 1800 (seconds)
Duh! That's just a process that runs indefinitely. I didn't notice that yesterday, because I had to restart Dovecot a few times over the course of the day. The exceeded times then looked funky, but it didn't strike me that it had to do with the restarts.
So yes, I think that the earlier advice in this thread suggested was correct: just add it to csf.pignore...

Code:
echo "exe:/usr/libexec/dovecot/stats" >> /etc/csf/csf.pignore
service lfd restart
...and don't forget to restart LFD.

Couldn't find a configuration option to turn off this "stats" process in the Dovecot docs, but I'm not bothered. It doesn't seems to use much CPU.
 
Last edited:

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
13,902
Location
GMT +7.00
The stats process runs by default. But currently there are no statistics logged by default (but this might change):

Code:
# doveadm stats dump
metric_name     field   count   sum     min     max     avg     median  %95
So it does not seem to do anything.... but running idle in memory: https://wiki2.dovecot.org/Statistics

You might want to try and disable it. As of now I don't have information on how to disable this plugin in Dovecot, so feel free to find it out yourself and update us with your results.
 

zmippie

Verified User
Joined
Apr 19, 2015
Messages
142
Alex, I too noticed that the stats did not provide much information. I thought it might have something to do with passing wrong or too little arguments, because I saw the same output as you posted. I'm going to try and find out if the stats module can be disabled.
 
Top