Autore: Marko Lalic Data: To: exim-users Oggetto: [exim] Limiting the number of pipe processes
Hello,
I am wondering if there is a way to set an exact limit to the number
of processes spawned by piping received messages to other processes.
Additionally, it would be nice if this setting could be applied on a
per-domain basis (or router/transport).
In the scenario I have, each received message needs to be processed by
a Python script. However, it can happen that a few hundred mails are
received in the same time causing a large number of processes to be
spawned. This in turn makes the system go OOM crashing other important
services. Thus, I would like to be able to specify a maximum number of
processes which should be allowed.
The solution I have found so far is to set queue_only_load to a value
which was experimentally determined to /usually/ be enough to limit
the number of processes to something that does not cause problems.
Unfortunately, that is an inexact approximation of the desired
behavior as the upper bound on the number of processes isn't constant;
it depends on other processes the system may be running. Moreover, the
value which needs to be set will vary from system to system.
Further alternatives include modifying the logic of the application
itself to consume a spooled list of emails (and delivering the
received messages to the spool, instead of a process), but it would be
more elegant if the problem could be solved using exim's facilities.