1

Topic: dovecot index cache keeps growing

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.5.2 MARIADB edition
- Deployed with iRedMail Easy or the downloadable installer? Download
- Linux/BSD distribution name and version: Ubuntu 20.04 LTS
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): Mysql
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? Yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
i am using mdbox format.

Couple email accounts get their cache file growing up to 250Mb size. I get following error in /var/log/dovecot/imap.log:
Fatal: master: service(imap): child 3464478 returned error 83 (Out of memory (service imap { vsz_limit=256 MB }, you may need to increase it) - set CORE_OUTOFMEM=1 environment to get core dump)

i made changes in file /etc/dovecot/conf.d/10-master.conf
default_vsz_limit = 0
and
service imap {
  # Most of the memory goes to mmap()ing files. You may need to increase this
  # limit if you have huge mailboxes.
vsz_limit = $default_vsz_limit

  # Max. number of IMAP processes (connections)
  #process_limit = 1024
}
restarted dovecot, but still getting error above.

If i delete the cache file in user's INBOX directory, emails can be loaded and read. But after around 1 week, the cache file grows again up to 250Mb and errors pop up.
-rw------- 1 vmail vmail 243M Jan 25 10:07 dovecot.index.cache

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Stable release is out.

2

Re: dovecot index cache keeps growing

dave.opc wrote:

i made changes in file /etc/dovecot/conf.d/10-master.conf

Dovecot is configured to use only /etc/dovecot/dovecot.conf, not /etc/dovecot/conf.d/*.

3

Re: dovecot index cache keeps growing

ZhangHuangbin wrote:
dave.opc wrote:

i made changes in file /etc/dovecot/conf.d/10-master.conf

Dovecot is configured to use only /etc/dovecot/dovecot.conf, not /etc/dovecot/conf.d/*.

Ok, so here is what i got in /etc/dovecot/dovecot.conf
vsz_limit = 1024MB

But in logs i get: Out of memory (service imap vsz_limit=256 MB)

How is this possible?

4

Re: dovecot index cache keeps growing

Increase the "vsz_limit" inside "service imap {}" config block.

5 (edited by dave.opc Yesterday 17:12:59)

Re: dovecot index cache keeps growing

ZhangHuangbin wrote:

Increase the "vsz_limit" inside "service imap {}" config block.

It's already more than i get error in logs.
I can set more than 1024, but how is this helping with 256Mb error that i get?

Post's attachments

Screenshot 2023-01-29 121138.png
Screenshot 2023-01-29 121138.png 34.16 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

6

Re: dovecot index cache keeps growing

For those who face this problem i got a solution. Not exactly solving this problem, but at least users are able to read their emails.
I created a cron job, which deletes large (180Mb+ in my case) cache files every morning 8am
* 8 * * * /usr/bin/find /var/vmail/vmail1/ -type f -size +180M -name "*.cache" -exec rm {} +

7

Re: dovecot index cache keeps growing

The screenshot shows "service imap-login {...}", but what we are talking about is "service imap {...}". Please read carefully.