ulimit -S -n in /etc/rabbitmq/rabbitmq-env.conf doesn't work

426 views
Skip to first unread message

Khitai Pang

unread,
May 4, 2017, 11:59:00 AM5/4/17
to rabbitm...@googlegroups.com
Hi,

I need to increase file descriptors limit of rabbitmq to 400000 on
CentOS 7.3. First I increased the system limit to 1000000:

> cat /proc/sys/fs/file-max
1000000

Then I added the following in /etc/security/limits.conf:

rabbitmq soft nofile 400000
rabbitmq hard nofile 400000

> su - rabbitmq -s /bin/sh -c 'ulimit -n'
400000

and the following in /etc/rabbitmq/rabbitmq-env.conf:

ulimit -S -n 400000

After rebooting, rabbitmq beam process max open files is still 1024/4096:

> cat /proc/[rabbitmq beam pid]/limits | grep "Max open files"
Max open files 1024 4096 files


Any idea? Is it caused by pam_limits.so not being used?


Thanks
Khitai

Michael Klishin

unread,
May 4, 2017, 12:04:35 PM5/4/17
to rabbitm...@googlegroups.com
CentOS 7.x uses systemd which uses its own way of configuring system limits.

See Controlling System Limits on Linux in http://www.rabbitmq.com/install-rpm.html.

Khitai

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send an email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ

Khitai Pang

unread,
May 4, 2017, 12:49:00 PM5/4/17
to rabbitm...@googlegroups.com
Hi Michael,

Yes I already tried /etc/systemd/system/rabbitmq-server.service.d/limits.conf, it works like a charm.  I was just wondering why invoking ulimit in /etc/rabbitmq/rabbitmq-env.conf doesn't work.  Actually the document says "The most straightforward way to adjust the per-user limit for RabbitMQ on distributions that do not use systemd is to edit the rabbitmq-env.conf to invoke ulimit before the service is started.", apparently I missed "on distributions that do not use systemd".


Thanks
Khitai
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages