1

Topic: high memory consumption of slapd

==== Required information ====
- iRedMail version: v0.4.1
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  ldap
- Web server (Apache or Nginx): apache
- Linux/BSD distribution name and version: Debian wheezy in a Docker container (Host: Ubuntu 14.04)
- Related log if you're reporting an issue:
====

After installing iredmail, the slapd process consumes ~350MB of RAM. This seems to be way too much. There is hardly any data yet on the system, it's just a plain and fresh install.

Two questions:
1. Is such a memory consumption expected or does it indicate a bug or bad config?
2. What can I do to reduce the memory consumption? Ideally I would like to run it on a machine with 512MB RAM but currently slapd gets killed after some time even with 1024MB.

Please let me know what more information would help you to identify the issue.

Thanks a lot, help highly appreciated!
Nils

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: high memory consumption of slapd

iRedMail won't function on 512MB due to Amavis. 1GB Minimum unless you want to disable Virus/Spam/Dkim/Spf scanning+verification. I've no idea about your SlapD issue, so await Zhang to reply about that.

3

Re: high memory consumption of slapd

neuplarl wrote:

After installing iredmail, the slapd process consumes ~350MB of RAM. This seems to be way too much. There is hardly any data yet on the system, it's just a plain and fresh install.

This is not normal. Could you please show us proof of this memory usage? for example, a screenshot of command 'top -u openldap', or something similar.

neuplarl wrote:

1. Is such a memory consumption expected or does it indicate a bug or bad config?

Hard to say, we need to troubleshoot and find the root cause first.

neuplarl wrote:

2. What can I do to reduce the memory consumption? Ideally I would like to run it on a machine with 512MB RAM but currently slapd gets killed after some time even with 1024MB.

As @7t3chguy mentioned, 1GB memory on server is required for a low-traffic mail server for all features to fully functional. If you really want to use 512MB, you should consider reduce the concurrent process email in Amavisd to only one (for low-traffic server, it should be ok).

4 (edited by neuplarl 2015-04-14 13:48:48)

Re: high memory consumption of slapd

ZhangHuangbin wrote:
neuplarl wrote:

After installing iredmail, the slapd process consumes ~350MB of RAM. This seems to be way too much. There is hardly any data yet on the system, it's just a plain and fresh install.

This is not normal. Could you please show us proof of this memory usage? for example, a screenshot of command 'top -u openldap', or something similar.

Sure, please see the attached screenshot.

I recognized that slapd is started with the root users. I wanted to try with openldap user, but that user does not have a shell set and I wonder if something is wrong with that.
Here is an extract from /etc/passwd
> openldap:x:107:110:OpenLDAP Server Account,,,:/var/lib/ldap:/bin/false


ZhangHuangbin wrote:
neuplarl wrote:

1. Is such a memory consumption expected or does it indicate a bug or bad config?

Hard to say, we need to troubleshoot and find the root cause first.

Please let me know which further information I could provide to solve this.

Thanks a lot

Post's attachments

Screenshot_2015-04-14_07:33:33_Selection_001.png
Screenshot_2015-04-14_07:33:33_Selection_001.png 55.04 kb, file has never been downloaded. 

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

5 (edited by neuplarl 2015-04-15 00:27:29)

Re: high memory consumption of slapd

It's related to this ulimit issue with Docker: https://github.com/docker/docker/issues/8231

Setting ulimit -n 1024 before starting the slapd services solves the issue. Memory consumption is down to ~24MB.

Whether this is a slapd or a Docker issue is being my understanding at the moment, but I don't think it's iRedMail specific.