• Delicious
  • Sales: 0800 634 6513
    General: 0845 053 0371

news and info

Background log writer

The diagnostic log files which VPOP3 generates can add a lot of extra disk load to a VPOP3 server. For this reason, VPOP3 doesn’t usually write data to the log files as soon as the event happens. The log file entries are held in memory until the “background log file writer” gets around to it, and writes them to the actual disk files. This generally works well, however if the disk is exceptionally slow (e.g. failing disks, or RAID5 SATA drives on a busy system) then it has been known to lead to out-of-memory errors.

The reason that this background writing system is necessary for VPOP3, where other servers may write log files immediately without serious consequences, is because VPOP3 can write to many different log files to make reading them easier. Depending on the settings, it can also write a lot of data to the log files – especially if session logs are enabled. This can cause a lot of disk seek activity, which slows disk access down across the whole PC.

In versions of VPOP3 prior to v6.7, the behaviour of the background log file writer was fixed in the software, but in v6.7, we added configuration options to customize the behaviour. This can be used to decrease disk load further, or to make the log files be refreshed more frequently.


You can customise and monitor the behaviour of the log file writer by going to Settings -> Diagnostics -> Log File Writer

Log Writer Settings

If you turn off ‘Enable logging to file’, then VPOP3 will just discard all logging entries. This is not recommended for normal use, but may be useful as a diagnostic tool to see if performance problems are being caused by VPOP3’s logging.

The settings on this page tell VPOP3 how to change how often to write data to the log files, and how to automatically adjust its behaviour depending on the current load.

VPOP3 writes log file data in ‘bursts’, rather than as the log entries are generated. The main thing you can configure is how long to wait between these bursts. The first 4 settings let you configure this.

Min time between log writer bursts and Max time between log writer bursts set limits for the time between the bursts. In the screenshot above, this means that the delay between bursts can be between 0 and 10 seconds.

The If lines written < X then increase time between bursts and If lines written > y then decrease time between bursts settings tell VPOP3 how to adjust the time depending on load. They mean that if there is lots of data to log, VPOP3 will wait less time between writes, but if there isn’t much data then it will increase the time between the writes, to avoid writing lots of small chunks of data.

The Only write to disk if at least x lines waiting to be written setting prevents VPOP3 writing small bits of data. On a hard disk, each write will probably incur a delay – eg because of disk latency (waiting for the disk to rotate to the correct position) or seek time (moving the write head to the correct track on the disk), so writing small bits of data unnecessarily is not a good idea.

The Always write if oldest line is over x ms old setting prevents stale data sitting in memory for a long time. This overrides the previous setting. For instance, if VPOP3 is just logging errors, it may just generate one log entry every hour – if you had told VPOP3 not to write to disk if there are less than 10 lines to log, there could be a 10 hour delay before the first error is logged, which would not be very helpful, so you can limit the maximum time to delay.

The Current time between log writer bursts value shows how long VPOP3 is currently waiting between bursts of writing to disk.

The Log file stats section shows the current statistics. For instance, how many writes have taken place in the last 10 minutes, and how many lines & bytes were written in that time, and so on. This can help you see if certain log files may be causing a lot of disk access.

The pop3clt.log, smtpclt.log, smtpsvr.log, smtpclt.log, imapsvr.log, nntpsvr.log, nntpclt.log files are Session Logs which can be enabled/disabled on the Session Logs tab. If you have lots of writes to the VPOP3.log file, you may want to decrease the logging level on the General tab.


An advanced, but very effective way of decreasing disk load is to set up a RAM disk (e.g. http://en.wikipedia.org/wiki/List_of_RAM_drive_software#Microsoft_Windows) and have VPOP3 write its log files to that. Since you will rarely want to access diagnostic log files after a computer reboot, this works well. If you have a RAM disk, then you can change the background log file writer configuration so that it writes to the log files more frequently, as disk seek times are not an issue.

Using an SSD for log files is not recommended. It will work fine, but SSDs have limited write cycles, so using them for write-heavy tasks such as log files will reduce the lifetime of the SSD.

Share this!

Post a Comment