Internal Statistics

Dr.Web MailD can collect internal statistics of the following kinds:

1.Statistics on SMTP restrictions appliance

2.Statistics on operation of dynamic thread pools and connections.

warning

It is recommended to gether internal statistics on Dr.Web MailD operation to estimate the load and its bandwidth. This information can be used to optimize operation and system resources usage.

Statistics on SMTP restrictions appliance

Statistics on appliance of restrictions on different SMTP session stages is saved to the restrictions.txt file. Restrictions for Receiver are specified in the [Receiver] section of the Dr.Web MailD configuration file. Statistics is saved only if the value of the RestrictionStat parameter in the same is set to Yes.

Statistics records are always added to the end of file. Each record starts with the following lines:

==================================
start:  Tue Oct 9 14:44:15 2008
curr:   Tue Oct 9 14:44:29 2008
period: 0d 0h 0m 14s

where:

start – time of the previous statistics record

curr – time of the current statistics record

period – time interval between the previous and current records.

Further, after an empty line, applied SMTP restrictions are listed (one line for one restriction). For example:

reject_unknown_domain: total: 19   trusted: 0    reject: 0    tempfail: 0

For each restriction, the following information is output:

restriction type;

total count of messages for which this restriction was checked (total);

count of messages which were marked as trusted upon applying of this restriction (trusted);

count of messages which were rejected upon applying of this restriction (reject);

count of messages which senders received Tempfail SMTP status upon applying of this restriction (tempfail).

Please note that statistics is not aggregated. Each saved record contains statistics on applied restrictions between previous and current moments of saving. Statistics on restriction appliance is collected only if Dr.Web MailD is operating in SMTP/LMTP proxy mode.

Statistics on operation of thread pools and connections

Statistics on operation of thread pools and connections is collected if the corresponding option for the pool is enabled (for example, the InPoolOptions and OutPoolOptions parameters in the [Maild] section of Dr.Web MailD configuration file) and the stat parameter value is yes.

Example:

InPoolOptions = auto, stat = yes

Note that for Sender and Receiver components statistics is collected unconditionally because additional parameters (such as timeout, stat and others) are not specified for their pools and even if so, they have no effect.

Aggregated statistics is saved to the log file as a message of Debug verbosity level upon receipt of SIGUSR1 signal or Dr.Web MailD shutdown. Note that if the set log verbosity level is less detailed than Debug, statistics is not logged.

Statistics record looks as in the following example:

size = 50, active = 0, pending = 0, min = 50, max = 500, threshold = 50

where:

size – current size of the pool (number of threads in the pool);

active – number of threads in active state at the moment of record creation;

pending – number of tasks that are wait for free thread in the pool at the moment of record creation;

min – minimal possible number of threads in the pool;

max – maximal possible number of threads in the pool;

threshold – step by which the number of threads in the pool is increased/decreased if necessary.

Statistics is not aggregated. Upon receipt of time signal,the current state of the pool is fixed.

Moreover, separate files with statistics are created for certain pools. Statistics is also saved to such files upon receipt of SIGUSR1 signal and Dr.Web MailD shutdown.

Files with statistics are named according to the following patterns:

name_[callback_](cli|srv)[.unique-id].txt - for statistics on connections;

name_[callback_](thr[N])[.unique-id].txt - for statistics on pools.

where:

name - name of the component (name of the corresponding module without "drweb-" part).

callback - callback of the Receiver interface.

cli - for client connections.

srv - for server connections.

unique-id - for modules started with the unique identifier.

thr - for a thread pool.

If such file already exists, statistics is added to the end of this file.

Each record starts with the following:

==================================
start:  Tue Oct 9 14:44:15 2008
curr:   Tue Oct 9 14:44:29 2008
period: 0d 0h 0m 14s

where:

start – time of the previous statistics record,

curr – time of the current statistics record;

period – time interval between the previous and current records.

For srv a number of created and closed connections and maximum number of elements in different queues are displayed.

closed: 0 (0 num/sec)
total created = 0 (0 num/sec)
max rea = 0 est = 0 don = 0 act = 0

For cli a number of connections created by request and closed on timeout, their average amount and current number are displayed.

created on request = 0 (0 num/sec)
closed by timeout = 0 (0 num/sec)
avg number = 0
current = 2

thr output looks as follows:

min = 2 max = 2147483647 type = 0 freetime = 120
busy max = 0 avg = 0
requests for new threads = 0 (0 num/sec)
creating fails = 0
max processing time = 0 ms; avg = 0 ms
curr = 2 busy = 0

where:

first line contains information on the maximum and minimum number of threads in one pool, type of the pool, maximum time (in seconds) for an additional thread to close upon inactivity;

second line contains information on the maximum and average number of busy threads;

third line contains information on the number and frequency of requests to create additional threads;

fourth line contains information on the number of failed attempts to create additional threads (such failure can be caused by insufficient resources);

fifth line contains information on the maximum and average time of processing the requests, in milliseconds;

sixth line contains information on the current number of threads in a pool and number of busy threads.