Reputation: 1415
On Linux, when a process opens a file, the OS will check the max opened files limitation.
If the limitation was 1024, what's the number mean?
Does it represent
Upvotes: 19
Views: 42826
Reputation: 1
If it is a linux , verify the output of:
ulimit -a
It will tell what is the limit on number of open files in the system because there is a way in linux to restrict the number of open files and also set limit on open files to unlimited that will fix the issue.
Upvotes: -1
Reputation: 136525
It is a number of open file descriptors per process. They can all refer to the same file, or different files.
You can see the current limits with ulimit -a
in the shell, or programatically with getrlimit
. The system-wide limits are set in /etc/security/limits.conf
.
The filesystem object model on Linux is:
file descriptor -> file description -> dentry -> inode
dup
creates a new file descriptor to the same file description.
open
creates a new file descriptor and a file description.
Upvotes: 4
Reputation: 3870
You can check the Soft limits and hard limits of your system by ulimit -a
command.
Soft limits could be set by any user while hard limits are changeable only by root. Limits are a property of a process. They are inherited when a child process is created so system-wide limits should be set during the system initialization in init scripts and user limits should be set during user login for example by using pam_limits
.
There are often defaults set when the machine boots. So, even though you may reset your ulimit in an individual shell, you may find that it resets back to the previous value on reboot. You may want to grep your boot scripts for the existence ulimit commands if you want to change the default.
If the limitation was 1024, means you/process can open maximum 1024 files. if you exceed this limit means open
, pipe
and dup
system calls will fail:
RLIMIT_NOFILE:
Specifies a value one greater than the maximum file descriptor number that can be opened by this process. Attempts (
open(2)
,pipe(2)
,dup(2)
, etc.) to exceed this limit yield the errorEMFILE
.
Upvotes: 19