SUSE Support

Here When You Need Us

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 15 GA and later ServicePacks
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:

Global:
The global DefaultTasksMax is configured only in /etc/systemd/system.conf

Example of the  /etc/systemd/system.conf file:
[Manager]
DefaultTasksMax=15288
 
Unit/Service:
The TasksMax setting for Unit/Service files can be configured as below 

Example for sshd.service in /etc/systemd/system/sshd.service.d/override.conf file:
[Service] 
TasksMax=18100

All Users:
The TasksMax setting for all users can be done in /etc/systemd/logind.conf file using UserTasksMax .

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
which will return:
DefaultTasksMax=15288
 
  • Looking for a service (e.g.:  sshd.service) TaskMax value:
systemctl status sshd.service |grep -e Tasks
which will return:
Tasks: 1 (limit: 18100)
  • Looking for what is the current TasksMax set for a specific user:
As example:
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="
which will return :
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

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.