Howto modify systemd DefaultTasksMax / TasksMax / UserTasksMax settings
This document (000015901) is provided subject to the disclaimer at the end of this document.
Environment
SUSE Linux Enterprise Server 12 SP2 and later ServicePacks
SUSE Linux Enterprise Server for SAP Applications 15 GA and later ServicePacks
SUSE Linux Enterprise Server for SAP Applications 12 SP2 and later ServicePacks
Situation
In certain occasions the default resource limitations are not sufficient, or perhaps found to be too restrictive, and some of the of the systemd's TasksMax settings may need specific adjustments.
Resolution
Changing the TasksMax values:
Example of the /etc/systemd/system.conf file:
[Manager] DefaultTasksMax=15288
Example for sshd.service in /etc/systemd/system/sshd.service.d/override.conf file:
[Service] TasksMax=18100
All Users:
Example of /etc/systemd/logind.conf file:
[Login] UserTasksMax = 12288
Individual Users:
Create a drop-in for the individual user. For example, if the target user's UID is 1001, create:
/etc/systemd/system/user-1001.slice.d/50-tasksmax.conf
[Slice] TasksMax=18000
Upon the next login by that user, the value should come into effect. You could also give the following command to change the user's current value on-the-fly:
systemctl set-property user-1001.slice TasksMax=18000
Additional Information
Verifying the current settings :
- Looking at the system level DefaultTasksMax settings:
systemctl show --property DefaultTasksMax
DefaultTasksMax=15288
- Looking for a service (e.g.: sshd.service) TaskMax value:
systemctl status sshd.service |grep -e Tasks
Tasks: 1 (limit: 18100)
- Looking for what is the current TasksMax set for a specific user:
Checking TasksMax value for user repair1 which uid is 1001.
This translates to user-slice : user-1001.slice
Knowing the user-slice we can check the TasksMax value :
systemd-analyze dump | sed -n "/-> Unit user-1001.slice:/,/-> Unit /p"| grep -e "TasksMax="
TasksMax=18000
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:000015901
- Creation Date: 26-Feb-2020
- Modified Date:14-May-2021
-
- SUSE Linux Enterprise Server
- SUSE Linux Enterprise Server for SAP Applications
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com