file-descriptor-limit

File descriptor limit From Hackepedia

There is several limits a process is restricted to: Limits for all open files in the system, or limits for number of files open in a process: OpenBSD has 2 sysctl's that allow one control over amount of files in the system: There is kern.maxfiles which is setable at boot, and there is kern.nfiles which displays the number of open file descriptors in the system currently. For the process there is another set of limits that one should be aware of:

$ ulimit -n
64

$ ulimit -Hn
1024
This displays the soft and hard limits respectively. One can set the soft limit up to the hard limit but not beyond unless you're root. The default hard limit is compiled into the kernel at compile time and is defined as the following in /usr/include/sys/param.h as NOFILE_MAX:
#define NOFILE_MAX 1024 /* max open files per process (hard) */
Only root can go set the hardlimit above 1024 and the limit to this is kern.maxfiles. The hardlimit can also be set in the /etc/login.conf file as openfiles-max. The softlimit is definable in the said file as openfiles-cur. the /etc/login.conf file as openfiles-max. The softlimit is definable in the said file as openfiles-cur.


Germany - von Hackepedia

Es gibt mehrere Höchstwerte (limits) die ein Programm beinflussen: Höchstwert für alle offenen Dateien im System, oder höchstwert für die nummer der offenen Dateien in einem Prozess (Programm).

OpenBSD hat zwei sysctl's die einem Kontrolle über die nummer der offenen Dateien im System geben. Es gibt kern.maxfiles was gesetzt wird am anfang des Boot-Prozesses und es gibt kern.nfiles was die nummer der offenen Datei- Deskriptoren im System angibt. Für das laufende Programm gibt es noch einen höchstwert das man beachten sollte:

$ ulimit -n
64

$ ulimit -Hn
1024
Diese Höchstwerte zeigen den soft (weichen) und hard (harten) höchstwert an. Man kann den soft-höchstwert bis zum hard-höchstwert erweitern aber nicht mehr ausser man ist root. Der systemgesetzte hard-höchstwert ist ins Kernel kompiliert und ist definiert in /usr/include/sys/param.h als NOFILE_MAX:
#define NOFILE_MAX 1024 /* max open files per process (hard) */
Nur root kann den hard-höchstwert über 1024 setzen und der höchstwert dazu ist definiert in kern.maxfiles. Der hard-höchstwert kann auch in der Datei /etc/login.conf unter openfiles-max definiert werden. Der soft-höchstwert in dieser Datei ist openfiles-cur.

DeutschEnglish
höchstwertlimit