<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Stephan,<br>
Thank you for this very interesting description of both the problem
and the solution. I'm curious which Linux distribution you're
using? We're using Ubuntu Xenial (16.04) and find the following
default settings:<br>
<blockquote>
<pre>$ grep -i tasks /etc/systemd/system.conf
#DefaultTasksAccounting=no
#DefaultTasksMax=
</pre>
</blockquote>
so this would seem not to be an issue on Ubuntu systems, at least.<br>
<br>
Cheers,<br>
-nic<br>
<br>
<div class="moz-cite-prefix">On 12/16/2016 02:54 AM, Stephan Lauffer
via Info-cyrus wrote:<br>
</div>
<blockquote
cite="mid:20161216095443.Horde.6PBuJYiFICfDlxAcKwNcdz8@pmail.phfr.de"
type="cite">Hello!
<br>
<br>
While testing 2.5 we struggled over (known) problems like this...:
<br>
<br>
...ssh can't fork process to run service imaps/ipv4: Resource
temporarily unavailable
<br>
<br>
I searchd... and I found your FAQ...
<br>
<br>
<a class="moz-txt-link-freetext" href="https://cyrusimap.org/imap/faqs/o-toomanyprocesses.html">https://cyrusimap.org/imap/faqs/o-toomanyprocesses.html</a>
<br>
<br>
...and this "tcp_keepalive = 1" hint was doing a good job, but not
fixing our problem completely. Less processes as without this
setting but too many at all.
<br>
<br>
Btw we have a murder with 5 backends and each has about 5k mboxes.
With 2.4 we have about 400 imapd processes on the backends (in
normal state) and about 800 on the proxy. Peaks raises this values
for sure.
<br>
<br>
But we still wasn't able to get over a limit of about 500 imapds
on our new system which is running 2.5. Yesterday night I found
our problem:
<br>
<br>
SYSTEMD
<br>
<br>
(and not cyrus-imapd-2.5, but 2.5 was running with systemd
here...)
<br>
<br>
I guess there may be more people out there which may be interested
in a solition (we will add fixes to our systemd scripts of our
suse bulds soon, see
<a class="moz-txt-link-freetext" href="https://build.opensuse.org/package/show/home:nixda:devel/cyrus-imapd">https://build.opensuse.org/package/show/home:nixda:devel/cyrus-imapd</a>).
<br>
<br>
The first problem there is:
<br>
<br>
Systemd does not care about your /etc/security/limits.conf
<br>
<br>
The second problem is:
<br>
<br>
Systemd comes with a new limit called "TasksMax". You will find
this limit f.e. in /etc/systemd/system.conf as
"DefaultTasksMax=512". But you will NOT find this limit in "cat
/proc/`cat /var/run/cyrus.pid`/limits".
<br>
<br>
The solution is to add a file with a systemd override for this
service. F.e. use the systemctl edit <sevice> command...
(like "systemctl edit cyrus-imapd.service") or place a file in
/etc/systemd/system/cyrus-imapd.service.d/override.conf with f.e.:
<br>
<br>
[Service]
<br>
TasksMax=2048
<br>
LimitNOFILE=10000
<br>
<br>
The LimitNOFILE is just a guess... maybe you may not need this
here.
<br>
<br>
After setting this override you will see a status information
about your process count and limit like this:
<br>
<br>
# systemctl status cyrus-imapd.service
<br>
● cyrus-imapd.service - The Cyrus IMAP and POP Mail Server
<br>
Loaded: loaded (/usr/lib/systemd/system/cyrus-imapd.service;
enabled; vendor preset: disabled)
<br>
Drop-In: /etc/systemd/system/cyrus-imapd.service.d
<br>
└─override.conf
<br>
Active: active (running) since Thu 2016-12-15 20:51:17 CET; 12h
ago
<br>
Main PID: 12901 (master)
<br>
Tasks: 326 (limit: 2048)
<br>
[...]
<br>
<br>
<br>
What about adding a short hint to your faq? Yes, it is not a cyrus
problem. And yes, a sysadmin should know... but... I guess systemd
in depth may not be good known as the old ulimit thing and if you
are searching in the web 99% of the hits deal with ulimit.
<br>
<br>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">----
Cyrus Home Page: <a class="moz-txt-link-freetext" href="http://www.cyrusimap.org/">http://www.cyrusimap.org/</a>
List Archives/Info: <a class="moz-txt-link-freetext" href="http://lists.andrew.cmu.edu/pipermail/info-cyrus/">http://lists.andrew.cmu.edu/pipermail/info-cyrus/</a>
To Unsubscribe:
<a class="moz-txt-link-freetext" href="https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus">https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus</a></pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Nic Bernstein <a class="moz-txt-link-abbreviated" href="mailto:nic@onlight.com">nic@onlight.com</a>
Onlight, Inc. <a class="moz-txt-link-abbreviated" href="http://www.onlight.com">www.onlight.com</a>
6525 W Bluemound Road, Suite 24 v. 414.272.4477
Milwaukee, Wisconsin 53213-4073
</pre>
</body>
</html>