1

I am running Jenkins with lots of jobs which require lots of open files so I have increased file-max limit to 3 million. It still hits 3 million sometimes so I am wondering how far I can go. Can I set /proc/sys/fs/file-max to 10 million?

How do I know what the hard limit of file-max is?

I am running CentOS 7.7 (3.10.X kernel)

Stephen Kitt
  • 411,918
  • 54
  • 1,065
  • 1,164
Satish
  • 1,632
  • 3
  • 34
  • 60

1 Answers1

1

The kernel itself doesn’t impose any limitation on the value of file-max, beyond that imposed by its type (unsigned long, so 4,294,967,295 on typical 32-bit systems, and 18,446,744,073,709,551,615 on typical 64-bit systems).

However each open file consumes around one kilobyte of memory, so you’ll be limited by the amount of physical RAM installed; ten million open files would consume approximately ten gigabytes of memory. The kernel initialises file-max to 10% of the usable memory at boot, which means the “hard” limit on any given system is approximately ten times the default value.

Stephen Kitt
  • 411,918
  • 54
  • 1,065
  • 1,164