jeffsia
jeffsia

Reputation: 369

Openfire process does not follow ulimit nofiles value in limits.conf

I have the following values set in my

/etc/security/limits.conf

*          hard    nofile   1048576
*          soft    nofile   1048576
openfire   hard    nofile   1048576
openfire   soft    nofile   1048576

I expect the openfire process to set its value to the same. But when I do a cat of openfire's PID. It only shows the value of 'Max open files' to be 4096.

cat /proc/178747/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             255821               255821               processes
Max open files            4096                 4096                 files
Max locked memory         65536                65536                bytes
Max address space         unlimited            unlimited            bytes
Max file locks            unlimited            unlimited            locks
Max pending signals       255821               255821               signals
Max msgqueue size         819200               819200               bytes
Max nice priority         0                    0
Max realtime priority     0                    0
Max realtime timeout      unlimited            unlimited            us

How can I configure my machine (Centos 7) so that the Openfire process follows the value set in the limits.conf

Upvotes: 0

Views: 698

Answers (2)

Hubert
Hubert

Reputation: 446

CentOS7 uses systemd which sets its' own limits.

Adding LimitNOFILE=65536 in the [Service] section of /etc/systemd/system/openfire.service and then restarting the service should do the trick.

Background: Systemd ignores the configuration in limits.conf.

  1. There is a default for the max. number of open files which is 4096 on older systems and 64k on newer systems. All "units" not explicitly changing the limits will inherit this.

  2. This default can be overwritten in /etc/systemd/system.conf, option "DefaultLimitNOFILE="

  3. Per "unit" it can be configured in the unit definition file (see above)

Upvotes: 2

Shoaib Ahmad Gondal
Shoaib Ahmad Gondal

Reputation: 646

/etc/security/limits.conf change is handy when system restarts, for current state, you should do "ulimit -n 1048576" on terminal and then restart openfire service and verify. This will apply immediately.

Upvotes: 0

Related Questions