[rabbitmq-discuss] Changing file descriptor limit wihtout restart?

Jakov Sosic jsosic at gmail.com
Sat Jul 5 21:26:26 BST 2014


On 07/05/2014 08:58 PM, Michael Klishin wrote:
> On 5 July 2014 at 22:56:11, Jakov Sosic (jsosic at gmail.com) wrote:
>>> I know I can do it by setting up limits.conf and restarting RabbitMQ
>> nodes but I would prefer to do it without node downtime if possible.
>
> ulimit changes will only be effective after OS process restart.
> This is true for all processes, RabbitMQ or not.

What about write-able limits and prlimit(2)?

Although it seems writeable limits is not affecting running programs, at 
least not on CentOS 6... I have written small C program to verify this:

#include <stdio.h>
#include <limits.h>
#include <unistd.h>

int main(){
	int i=sysconf(_SC_OPEN_MAX);
	int n=0;

	while(n<1000){
		n++;
		printf("Max open files: %d\n", i);
		sleep(5);
	}
	return 0;
}


but, after running it and increasing ulimit via

echo -n "Max open files=4096:4096" > /proc/<pid>/limits

program still reports 1024 :-/


More information about the rabbitmq-discuss mailing list