Bambero wrote:
> # sysctl kern.nfiles ; fstat | wc -l
> kern.nfiles=2470
>     3594
> 
> What's the difference between kern.nfiles and fstat?

fstat includes the program executable itself and its working directories,
which don't count as open files.

> # getcap -f /etc/login.conf mysqld
> mysqld: :openfiles-cur=128:     :openfiles-max=256:
> 
> # su _mysql
> # ulimit -a
> time(cpu-seconds)    unlimited
> file(blocks)         unlimited
> coredump(blocks)     unlimited
> data(kbytes)         33554432
> stack(kbytes)        8192
> lockedmem(kbytes)    10825182
> memory(kbytes)       32472388
> nofiles(descriptors) 128
> processes            1310
> 
> So why mysql is allowed to open more than 256 files:
> 
> # fstat -u _mysql | wc -l
>      998

file limits are per process, not per user.

Reply via email to