From 4d181ea5237918130b9aaca611479e57ff2696df Mon Sep 17 00:00:00 2001 From: Silvio Moioli Date: Wed, 20 Sep 2017 14:35:11 +0200 Subject: [PATCH] process_count_max: add defaults and documentation --- conf/minion | 6 ++++++ doc/ref/configuration/minion.rst | 17 +++++++++++++++++ salt/config/__init__.py | 4 ++++ 3 files changed, 27 insertions(+) diff --git a/conf/minion b/conf/minion index fa5caf317b..0cef29a6e1 100644 --- a/conf/minion +++ b/conf/minion @@ -689,6 +689,12 @@ # for a full explanation. #multiprocessing: True +# Limit the maximum amount of processes or threads created by salt-minion. +# This is useful to avoid resource exhaustion in case the minion receives more +# publications than it is able to handle, as it limits the number of spawned +# processes or threads. -1 disables the limit. +#process_count_max: 20 + ##### Logging settings ##### ########################################## diff --git a/doc/ref/configuration/minion.rst b/doc/ref/configuration/minion.rst index 3438bfca03..5dafffaadd 100644 --- a/doc/ref/configuration/minion.rst +++ b/doc/ref/configuration/minion.rst @@ -2419,6 +2419,23 @@ executed in a thread. multiprocessing: True +.. conf_minion:: process_count_max + +``process_count_max`` +------- + +.. versionadded:: Oxygen + +Default: ``20`` + +Limit the maximum amount of processes or threads created by ``salt-minion``. +This is useful to avoid resource exhaustion in case the minion receives more +publications than it is able to handle, as it limits the number of spawned +processes or threads. ``-1`` disables the limit. + +.. code-block:: yaml + + process_count_max: 20 .. _minion-logging-settings: diff --git a/salt/config/__init__.py b/salt/config/__init__.py index 6a89e1f485..fea68eb70a 100644 --- a/salt/config/__init__.py +++ b/salt/config/__init__.py @@ -337,6 +337,9 @@ VALID_OPTS = { # Whether or not processes should be forked when needed. The alternative is to use threading. 'multiprocessing': bool, + # Maximum number of concurrently active processes at any given point in time + 'process_count_max': int, + # Whether or not the salt minion should run scheduled mine updates 'mine_enabled': bool, @@ -1258,6 +1261,7 @@ DEFAULT_MINION_OPTS = { 'auto_accept': True, 'autosign_timeout': 120, 'multiprocessing': True, + 'process_count_max': 20, 'mine_enabled': True, 'mine_return_job': False, 'mine_interval': 60,