What are the number of open files for a user on linux and system wide for linux? [closed] What are the number of open files for a user on linux and system wide for linux? [closed] unix unix

What are the number of open files for a user on linux and system wide for linux? [closed]


There is no per-user file limit. The ones you need to be aware of are system-wide and per-process. The files-per-process limit multiplied by the processes-per-user limit could theoretically provide a files-per-user limit, but with normal values the product would be so large as to be effectively unlimited.

Also, the original purpose of lsof was to LiSt Open Files, but it has grown and lists other things now, like cwd and mmap regions, which is another reason for it to output more lines than you expect.

The error message "Too many open files" is associated with errno value EMFILE, the per-process limit, which in your case appears to be 1024. If you can find the right options to limit lsof to just displaying actual file descriptors of a single process, you'll probably find that there are 1024 of them, or something very close.

The system-wide file descriptor limit rarely needs to be manually adjusted these days, since its default value is proportional to memory. If you need to, you can find it at /proc/sys/fs/file-max and information about current usage at /proc/sys/fs/file-nr. Your sysctl file has a value of 4096 for file-max, but it's commented out so you shouldn't take it seriously.

If you ever manage to hit the system-wide limit, you'll get errno ENFILE, which translates to the error message "File table overflow" or "Too many open files in system".