Hi All,

We are running Round cube on top of dovecot and postfix as our email echo system. Main problem we are facing is that, roundcube loads really slow for big inboxes (~5000 emails). I found that, while it loads, imap process goes high in terms of CPU utilization(~90%). I asked it in some roundcube support group, They believe that it is related to dovecot not roundcube. Can you shed any light on this issue. Thanks in advance.  

Here is $dovecot -n$ output

xyz@roundcube-internal-server-1:/etc/dovecot$ dovecot -n
# 2.3.16 (7e2e900c1a): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.5.16 (09c29328)
# OS: Linux 5.15.0-1024-kvm x86_64 Ubuntu 22.04.1 LTS
# Hostname: roundcube-internal-server-1
auth_mechanisms = plain login
disable_plaintext_auth = no
listen = *
lock_method = dotlock
mail_always_cache_fields = date.received
mail_cache_min_mail_count = 5000
mail_location = mbox:~/mail:INBOX=/var/mail/%u:INDEX=/var/indexes/isical.ac.in/%n
mail_privileged_group = mail
mail_sort_max_read_count = 100
mailbox_list_index_include_inbox = yes
mailbox_list_index_very_dirty_syncs = yes
maildir_very_dirty_syncs = yes
mbox_dotlock_change_timeout = 1 mins
mbox_lazy_writes = no
mbox_write_locks = dotlock fcntl
namespace inbox {
  inbox = yes
  location =
  prefix =
}
passdb {
  driver = pam
}
protocols = imap pop3
ssl_cert = </etc/dovecot/private/dovecot.pem
ssl_client_ca_dir = /etc/ssl/certs
ssl_dh = # hidden, use -P to show it
ssl_key = # hidden, use -P to show it
userdb {
  driver = passwd
}
protocol !indexer-worker {
  mail_vsize_bg_after_count = 100
}


On a different note we are getting error occasionally of the following type. I dont know if they are related.

Jan 16 15:36:13 roundcube-internal-server-1 dovecot: imap(xyz)<361270><aqauu17ycsvAqL8/>: Error: unlink(/var/mail/xyz.lock) failed: Permission denied (in file-dotlock.c:195)
Jan 16 15:36:13 roundcube-internal-server-1 dovecot: imap(xyz)<361270><aqauu17ycsvAqL8/>: Error: unlink(xyz.lock) failed: Permission denied (in file-dotlock.c:195)
Jan 16 15:36:13 roundcube-internal-server-1 dovecot: imap(xyz)<361270><aqauu17ycsvAqL8/>: Error: Mailbox INBOX: file_dotlock_create(xyz) in directory /var/mail failed: Permission denied (euid=10865(xyz) egid=8(mail) missing +w perm: /var/mail, UNIX perms appear ok (ACL/MAC wrong?), dir owned by 0:8 mode=0771)