Tuning Minion

Minion’s resource requirements scale with its workload. When assigned to locations with more nodes, interfaces, and services, the default settings may be insufficient.

Tuning Java heap memory

  1. Edit the file /etc/sysconfig/minion (RHEL) or /etc/default/minion (Debian)

  2. Uncomment and modify the values for the JAVA_MIN_MEM and JAVA_MAX_MEM variables

    # minimum amount of memory for the Karaf container to allocate
    export JAVA_MIN_MEM=512M
    
    # maximum amount of memory for the Karaf container to allocate
    export JAVA_MAX_MEM=4096M
  3. If Minion is running when this change is made, it must be restarted to take effect.

    systemctl restart minion

Tuning file descriptor limits

  1. Edit the minion unit file:

    systemctl edit minion
  2. In the area dictated by the comments in the editor, add:

    LimitNOFILE=100000
    the value 100000 is used as an example only.
  3. Edit /etc/sysconfig/minion (RHEL) or /etc/default/minion (Debian)

  4. Uncomment and modify the values for the MAX_FD variable:

    # maximum number of file descriptors to allocate
    export MAX_FD=100000
    the value 100000 is used as an example only.
  5. Confirm the unit file reflects the changes:

    # systemctl daemon-reload
    # systemctl cat minion
    [Unit]
    Description=The OpenNMS Minion distributed client.
    Requires=network.target network-online.target
    After=network.target network-online.target
    
    [Service]
    User=minion
    EnvironmentFile=-/opt/minion/etc/minion
    
    PIDFile=/opt/minion/data/log/minion.pid
    Type=forking
    
    ExecStart=/opt/minion/bin/minion start
    ExecStop=/opt/minion/bin/minion stop
    
    AmbientCapabilities=CAP_NET_RAW CAP_NET_BIND_SERVICE
    
    [Install]
    WantedBy=multi-user.target
    
    # /etc/systemd/system/minion.service.d/override.conf
    LimitNOFILE=100000
  6. If the minion is running when this change is made, it must be restarted to take effect.

    systemctl restart minion

Adjusting the minion log level

In many situations it can be beneficial to change the log level to be more or less verbose. Follow these steps to change it.

  1. Edit $MINION_HOME/etc/org.ops4j.pax.logging.cfg

    $MINION_HOME is /opt/minion on RHEL, and /etc/minion on Debian.
  2. Find and modify the logger.opennms section

    # OPENNMS: Display all INFO logs for OpenNMS code
    log4j2.logger.opennms.name = org.opennms
    log4j2.logger.opennms.level = DEBUG
  3. No restart is required to change the log level.