[Dovecot] Performance problem with STATUS after upgrade (1.0.15 -> 1.2.2)

Stefan Förster cite+dovecot-users at incertum.net
Mon Aug 3 11:01:40 EEST 2009


Hello list,

after upgrading dovecot from 1.0.15 to 1.2.2 (and carefully reading
through the upgrading notes in the wiki), I got sieve, quota and fts
up and running, but I'm now suffering some kind of performance problem
with the STATUS command.

Symptoms: Reading mail on the IMAP server itself with "mutt", no TLS/SSL,
connected through loopback interface. Whenever I idle a bit and then hit any
key thereafter, for example to change into another mailbox, mutt will send a
number of "STATUS" commands:

#
T 127.0.0.1:53604 -> 127.0.0.1:143 [AP]
  DONE..a0070 STATUS "postfix-buch" (UIDNEXT UIDVALIDITY UNSEEN RECENT)..a0071 STATUS "postfix-users" (UIDNEXT UIDVALIDITY UNSEEN RECENT)..a0072 STATUS "Trash" (UIDNEXT UIDVALIDITY UNSEEN RECENT)..a0073 STATUS "Sent" (UIDNEXT UIDVALID
  ITY UNSEEN RECENT)..a0074 STATUS "mailman-users" (UIDNEXT UIDVALIDITY UNSEEN RECENT)..a0075 STATUS "mailman-developers" (UIDNEXT UIDVALIDITY UNSEEN RECENT)..a0076 STATUS "de-postfix-users" (UIDNEXT UIDVALIDITY UNSEEN RECENT)..a0077 
  STATUS "amavis-users" (UIDNEXT UIDVALIDITY UNSEEN RECENT)..a0078 STATUS "spam" (UIDNEXT UIDVALIDITY UNSEEN RECENT)..a0079 STATUS "localreports" (UIDNEXT UIDVALIDITY UNSEEN RECENT)..a0080 STATUS "Drafts" (UIDNEXT UIDVALIDITY UNSEEN R
  ECENT)..a0081 STATUS "exim-users" (UIDNEXT UIDVALIDITY UNSEEN RECENT)..                                                                                                                                                                 
#

(The whole conversation is available as: http://www.incertum.net/~cite/dovecot-snoop.log)

Those commands take almost one(!) second to complete. I've used strace to
capture what happens and made the results available at
http://www.incertum.net/~cite/imap.log.

With 1.0.15, I never noticed this kind of delay, and reading mail
feels really sluggish at the moment. Is there any way to improve
performance?

Configuration data:

Filesystem mounted to /export/vmailboxes is an ext3:

# tune2fs -l /dev/rootvg/mailhome_lv  | grep "^Filesystem features"
Filesystem features:      has_journal resize_inode dir_index filetype needs_recovery sparse_super large_file

(needs_recovery is set because the filesystem is mounted, I umounted
it, did fsck -Dfy and it didn't display that "feature" when unmounted).

dovecot -n (also available as:
http://www.incertum.net/~cite/dovecot-n.log):
# 1.2.2: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.26-2-amd64 x86_64 Debian 5.0.2 
log_timestamp: %Y-%m-%d %H:%M:%S 
protocols: imap imaps managesieve
listen(default): *:143
listen(imap): *:143
listen(managesieve): *
ssl_listen(default): *:993
ssl_listen(imap): *:993
ssl_listen(managesieve): 
ssl_cert_file: /etc/ssl/owncerts/mail_incertum_net.crt
ssl_key_file: /etc/ssl/private/mail_incertum_net.key
login_dir: /var/run/dovecot/login
login_executable(default): /usr/lib/dovecot/imap-login
login_executable(imap): /usr/lib/dovecot/imap-login
login_executable(managesieve): /usr/lib/dovecot/managesieve-login
verbose_proctitle: yes
mail_privileged_group: vmail
mail_location: maildir:~/Maildir
mbox_write_locks: fcntl dotlock
mail_executable(default): /usr/lib/dovecot/imap
mail_executable(imap): /usr/lib/dovecot/imap
mail_executable(managesieve): /usr/lib/dovecot/managesieve
mail_process_size: 1024
mail_plugins(default): quota imap_quota fts fts_squat
mail_plugins(imap): quota imap_quota fts fts_squat
mail_plugins(managesieve): 
mail_plugin_dir(default): /usr/lib/dovecot/modules/imap
mail_plugin_dir(imap): /usr/lib/dovecot/modules/imap
mail_plugin_dir(managesieve): /usr/lib/dovecot/modules/managesieve
lda:
  postmaster_address: postmaster at incertum.net
  hostname: mail.incertum.net
  mail_plugins: quota sieve
  auth_socket_path: /var/run/dovecot/auth-master
auth default:
  mechanisms: plain login cram-md5
  passdb:
    driver: sql
    args: /etc/dovecot/dovecot-sql.conf
  userdb:
    driver: sql
    args: /etc/dovecot/dovecot-sql.conf
  socket:
    type: listen
    client:
      path: /var/spool/postfix/private/auth
      mode: 432
      user: postfix
      group: sasl
    master:
      path: /var/run/dovecot/auth-master
      mode: 384
      user: vmail
      group: vmail
plugin:
  quota: maildir:User quota
  quota_warning: storage=80%% /usr/local/bin/quota-warning.sh 80
  quota_warning: storage=95%% /usr/local/bin/quota-warning.sh 95
  sieve: ~/.dovecot.sieve
  sieve_storage: ~/sieve
  sieve_extensions: +imapflags
  fts: squat
  fts_squat: partial=4 full=10

SQL-Configuration:

# grep -v '^ *\(#.*\)\?$' dovecot-sql.conf
driver = pgsql
connect = hostaddr=333.33.33.3 port=5432 dbname=secret
user=secret password=secret sslmode=require
default_pass_scheme = PLAIN
password_query = SELECT login AS user, password FROM virtual_user_maps
WHERE login IN ('%u', '%n')
user_query = SELECT vum.uid, vum.gid, ('*:storage=' ||
vum.quota_kbytes || 'k') AS quota_rule, ('/export/vmailboxes/' ||
SUBSTR(vum.login, 1, 1) || '/' || vum.login) AS home FROM
virtual_mailbox_domains AS vmd LEFT JOIN virtual_mailbox_maps AS vmm
ON (vmd.id = vmm.domain) LEFT JOIN virtual_user_maps AS vum ON
(vmm.login = vum.id) WHERE ((vmm.localpart = '%n' AND vmd.name='%d')
OR (vum.login = '%u')) AND vum.active

Memory:

# free -m
             total       used       free     shared    buffers     cached
Mem:          3952       3003        949          0        226       1036
-/+ buffers/cache:       1740       2211
Swap:         7812          5       7807


The version is Debian/unstable's 1.2.2, available at
http://packages.debian.org/sid/dovecot-common, I've made a backport to
Debian/stable.
Any help/insights are really appreciated.


Cheers
Stefan


More information about the dovecot mailing list