Below example is shown from a test environment to configure ulimit under SystemD for MQ resource.
Sample configuration:
WebSphereMQ MQ_Res (
Critical = 0
QueueManager = QM1
CommandServer = 1
MQVer = "9.3"
SecondLevelMonitor = 5
MonitorListener = 1
MQInstallationPath = "/opt/mqm"
OfflineWaitLimit = 2
RestartLimit = 3
)
The vcs-MQ_Res-QM.service file was auto-created by VCS, here the naming of the service file is vcs-
Example from lab:
# systemctl status vcs-MQ_Res-QM.service
● vcs-MQ_Res-QM.service - Veritas WebSphereMQ service file
Loaded: loaded (/etc/systemd/system/vcs-MQ_Res-QM.service; disabled; vendor preset: disabled)
Active: active (running) since Wed 2024-02-21 01:21:53 PST; 45min ago
Process: 1064635 ExecStart=/opt/mqm/bin/strmqm QM1 (code=exited, status=0/SUCCESS)
Main PID: 1064638 (amqzxma0)
Tasks: 153 (limit: 100612)
Memory: 165.3M
CGroup: /system.slice/vcs-MQ_Res-QM.service
├─1064638 /opt/mqm/bin/amqzxma0 -m QM1 -u mqm
├─1064648 /opt/mqm/bin/amqzfuma -m QM1
├─1064652 /opt/mqm/bin/amqzmgr0 -m QM1
├─1064655 /opt/mqm/bin/amqzmuc0 -m QM1
├─1064680 /opt/mqm/bin/amqzmur0 -m QM1
├─1064694 /opt/mqm/bin/amqzmuf0 -m QM1
├─1064698 /opt/mqm/bin/amqrrmfa -m QM1 -t2332800 -s2592000 -p2592000 -g5184000 -c3600
├─1064704 /opt/mqm/bin/amqpcsea QM1
├─1064706 /bin/sh /opt/mqm//bin/amqp.sh start -m QM1 -d /mqmnt/data/QM1//. -g /var/mqm//.
├─1064707 /opt/mqm/bin/runmqchi -m QM1 -q SYSTEM.CHANNEL.INITQ -r
├─1064719 /opt/mqm/bin/amqzlaa0 -mQM1 -fip0
├─1064724 /bin/sh /opt/mqm/amqp/bin/controlAMQP_mqm.sh start -m QM1 -d /mqmnt/data/QM1//. -g /var/mqm//.
├─1064729 /opt/mqm/bin/runmqlsr -r -m QM1 -t TCP -p 1419
├─1064731 /opt/mqm/bin/amqfqpub -mQM1
├─1064763 /opt/mqm/bin/amqfcxba -m QM1
└─1064791 /opt/mqm/amqp/bin/../../java/jre64/jre/bin/java -Dcom.ibm.mq.mqxr.service.type=amqp -Dcom.ibm.msg.client.config.location=file:////mqmnt/data/QM1//./amq>
Current limits can be checked as:
# cat /proc/
- Current ulimit values:
# cat /proc/1064704/limits
Limit Soft Limit Hard Limit Units
Max cpu time unlimited unlimited seconds
Max file size unlimited unlimited bytes
Max data size unlimited unlimited bytes
Max stack size 8388608 unlimited bytes
Max core file size 0 unlimited bytes
Max resident set unlimited unlimited bytes
Max processes 62882 62882 processes >> Default Values
Max open files 1024 262144 files >> Default Values
Max locked memory 65536 65536 bytes
Max address space unlimited unlimited bytes
Max file locks unlimited unlimited locks
Max pending signals 62882 62882 signals
Max msgqueue size 819200 819200 bytes
Max nice priority 0 0
Max realtime priority 0 0
Max realtime timeout unlimited unlimited us
Content of the service file as below:
# systemctl cat vcs-MQ_Res-QM.servcie
[Unit]
Description=Veritas WebSphereMQ service file
[Service]
Type=forking
Restart=no
KillMode=none
SendSIGKILL=no
EnvironmentFile=
ExecStart=/opt/mqm/bin/strmqm QM1
TimeoutStartSec=289
User=mqm
SuccessExitStatus=30
[Install]
WantedBy=multi-user.target
Creating limits.conf
# mkdir -p /etc/systemd/system/vcs-MQ_Res-QM.service.d
# cd /etc/systemd/system/vcs-MQ_Res-QM.service.d
# vi limits.conf
[Service]
LimitNOFILE=10240
LimitNPROC=4096
The above value can be checked with the MQ vendor and can vary depending on customer's environment.
Reloading Service and Managing MQM Service Group:
# systemct daemon-reload
Stop/Start the MQ resource to update the changes
Updated Ulimit Values can be seen below.
After creating limits.conf, the updated ulimit values are:
# systemctl status vcs-MQ_Res-QM.service
● vcs-MQ_Res-QM.service - Veritas WebSphereMQ service file
Loaded: loaded (/etc/systemd/system/vcs-MQ_Res-QM.service; disabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/vcs-MQ_Res-QM.service.d
└─limits.conf
Active: active (running) since Wed 2024-02-21 03:12:32 PST; 1min 50s ago
Process: 1141725 ExecStart=/opt/mqm/bin/strmqm QM1 (code=exited, status=0/SUCCESS)
Main PID: 1141728 (amqzxma0)
Tasks: 153 (limit: 100612)
Memory: 158.7M
CGroup: /system.slice/vcs-MQ_Res-QM.service
├─1141728 /opt/mqm/bin/amqzxma0 -m QM1 -u mqm
├─1141738 /opt/mqm/bin/amqzfuma -m QM1
├─1141742 /opt/mqm/bin/amqzmgr0 -m QM1
├─1141745 /opt/mqm/bin/amqzmuc0 -m QM1
├─1141770 /opt/mqm/bin/amqzmur0 -m QM1
├─1141785 /opt/mqm/bin/amqzmuf0 -m QM1
├─1141791 /opt/mqm/bin/amqrrmfa -m QM1 -t2332800 -s2592000 -p2592000 -g5184000 -c3600
├─1141800 /opt/mqm/bin/amqpcsea QM1
├─1141801 /bin/sh /opt/mqm//bin/amqp.sh start -m QM1 -d /mqmnt/data/QM1//. -g /var/mqm//.
├─1141802 /opt/mqm/bin/runmqchi -m QM1 -q SYSTEM.CHANNEL.INITQ -r
├─1141813 /opt/mqm/bin/amqfqpub -mQM1
├─1141817 /opt/mqm/bin/amqzlaa0 -mQM1 -fip0
├─1141822 /bin/sh /opt/mqm/amqp/bin/controlAMQP_mqm.sh start -m QM1 -d /mqmnt/data/QM1//. -g /var/mqm//.
├─1141846 /opt/mqm/bin/runmqlsr -r -m QM1 -t TCP -p 1419
├─1141847 /opt/mqm/bin/amqfcxba -m QM1
└─1141896 /opt/mqm/amqp/bin/../../java/jre64/jre/bin/java -Dcom.ibm.mq.mqxr.service.type=amqp -Dcom.ibm.msg.client.config.location=file:////mqmnt/data/QM1//./amq>
# cat /proc/1141800/limits
Limit Soft Limit Hard Limit Units
Max cpu time unlimited unlimited seconds
Max file size unlimited unlimited bytes
Max data size unlimited unlimited bytes
Max stack size 8388608 unlimited bytes
Max core file size 0 unlimited bytes
Max resident set unlimited unlimited bytes
Max processes 4096 4096 processes >> Updated Values
Max open files 10240 10240 files >> Updated Values
Max locked memory 65536 65536 bytes
Max address space unlimited unlimited bytes
Max file locks unlimited unlimited locks
Max pending signals 62882 62882 signals
Max msgqueue size 819200 819200 bytes
Max nice priority 0 0
Max realtime priority 0 0
Max realtime timeout unlimited unlimited us