Configure ulimit

As your infrastructure grows and you use Puppet Enterprise (PE) to manage more agents, you might need to increase the number of allowed file handles per client.

PE services can require as much as one file handle per connected client. The default ulimit settings for most operating systems can only support up to about 200 clients. To support more clients, you need to increase the number of allowed file handles.

You can increase file handle limits for these PE services:
  • pe-orchestration-services
  • pe-puppetdb
  • pe-console-services
  • pe-puppetserver
  • pe-puppet
Where and how you configure ulimit depends on the agent's platform. We've provided instructions to:
Tip: In these instructions, replace <PE_SERVICE> with the name of the service you're configuring. For example, if you're configuring ulimit for the PuppetDB service, replace <PE_SERVICE> with pe-puppetdb.

Additionally, these instructions use 32678 as a sample ulimit value. Change this value according to your needs.

Configure ulimit using systemd

With systemd, the allowed number of open file handles is controlled by the LimitNOFILE setting in the .service file each PE service.

  1. Locate the systemd .service file for the PE service you want to configure and copy the file path. The default file path is:
    /usr/lib/systemd/system/<PE_SERVICE>.service
    For example, the file path for the PuppetDB service systemd file is:
    /usr/lib/systemd/system/pe-puppetdb.service
    For a list of service names, refer to Configure ulimit.
  2. Using the file path you determined in the previous step, run the following commands to increase the ulimit. Make sure to set the LimitNOFILE value to the desired file handles limit.
    mkdir /etc/systemd/system/<PE_SERVICE>.service.d
    echo "[Service]LimitNOFILE=32678" > /etc/systemd/system/<PE_SERVICE>.service.d/limits.conf
    systemctl daemon-reload
  3. To confirm the change, run:
    systemctl show <PE_SERVICE> | grep LimitNOFILE
  4. Repeat these steps to configure ulimit for other PE services.

Configure ulimit using upstart

For Ubuntu and Red Hat systems, the allowed number of open file handles is specified in system configuration files for each PE service.

  1. Locate the file for the PE service you want to configure. The location depends on the platform, and the file name matches the PE service name (as listed in Configure ulimit).
    • Ubuntu: /etc/default/<PE_SERVICE>
    • Red Hat: /etc/sysconfig/<PE_SERVICE>
  2. Set the ulimit setting on the last line of the file as follows:
    ulimit -n <ULIMIT_VALUE>
    For example, this configuration set the allowed number of open files to 32,678:
    ulimit -n 32678

Configure ulimit on other init systems

The ulimit controls the number of processes and file handles that a PE service user can open and process.

To increase the ulimit for a PE service user:

  1. Open the limits.conf file located at: /etc/security/limits.conf
  2. Add these lines to the file, specifying the specific service user's name and the desired ulimit value:
    <PE_SERVICE_USER> soft nofile <VALUE>
    <PE_SERVICE_USER> hard nofile <VALUE>
    For example, this configuration sets the ulimit value to 32,678 for the pe-puppet service user:
    pe-puppet soft nofile 32678
    pe-puppet hard nofile 32678