5.3. Milter Stats Interpretation


Available from version 1.8.

5.3.1. Overview

milter.stats is a file located in /opt/msh-traffic-policy/var/log/ directory, it contains information about internal message processing.

Example milter.stats file:

ActiveCount: 10
PoolSize: 10
CorePoolSize: 10
LargestPoolSize: 10
MaximumPoolSize: 20
TaskCount: 39039
CompletedTaskCount: 39038
CurrentQueueSize: 14
MaximumQueueSize: 20

Milter stats file by default is updated once per 60 seconds.

5.3.2. Parameters ActiveCount

The approximate number of messages that are simultaneously processed by the application. PoolSize

The number of messages that can be processed immediately without waiting in queue. If CurrentQueueSize is less than MaximumQueueSize then this value is equal CorePoolSize. CorePoolSize

The core pool size, this value is always MaximumPoolSize / 2. LargestPoolSize

The largest number of messages that have ever simultaneously been processed. MaximumPoolSize

The maximum allowed number of messages which could be processed simultaneously, this value is set with POOL_SIZE parameter.

If higher value then more CPU application will use. TaskCount

The approximate total number of messages that have ever been scheduled for processing. CompletedTaskCount

The approximate total number of messages that have completed processing. CurrentQueueSize

The current size of message queue. MaximumQueueSize

The maximum size of message queue, this value is set with QUEUE_SIZE parameter.

If higher value then more memory application will use, but not more than JAVA_XMX value.

5.3.3. Analyse

These parameters are most important:

  • PoolSize
  • CurrentQueueSize

PoolSize shows how many messages can be processed simultaneously and immadiately. CurrentQueueSize shows how many messages are waiting in queue for processing.

How it works:

  • If fewer than CorePoolSize messages are processed then application always prefers to work on a new arriving message than queing. How many messages is currently processed shows ActiveCount value.
  • If ActiveCount is equal or more to CorePoolSize then application prefers queuing rather than work on a new message.
  • If a message cannot be queued (CurrentQueueSize equal to MaximumQueueSize) then application start to work on a message and increase PoolSize unless exceed MaximumPoolSize.

5.3.4. When POOL_SIZE and QUEUE_SIZE need to be adjusted?

  • PoolSize and CurrentQueueSize are 75% or more of their maximum
  • there are SMFIC_OPTNEG connection timeout warnings in /var/log/maillog file
  • there are Message skipped from milter processing, no space in queue warnings in /opt/msh-traffic-policy/var/log/milter-XXXXX.log file

then POOL_SIZE and QUEUE_SIZE should be increased.

5.3.5. Change interval when stats file is updated

By default milter.stats file is updated once per 60 seconds, interval can be changed with STATS_UPDATE_TIME parameter.

Edit /opt/msh-traffic-policy/etc/config.cf file and add this line:


Where XXX is a value in seconds, minimum value is one second.

Restart msh-tp-milter service to apply changes:

/etc/init.d/msh-tp-milter restart