After opening a file with File.new(big_file)
(without closing it) 1016 times (Ubuntu) or 1017 times (CentOS), it seems there is a limit and it raises:
Too many open files @ rb_sysopen - big_file (Errno::EMFILE)
Is there any way to raise that limit?
On my systems, ulimit
is set to unlimited
.
EMFILE
is too many files opened in your process. ENFILE
is too many files opened in the entire system.So Errno::EMFILE
is due to the ruby process opening too many files. This limit is probably set to the default 1024
can be seen with:
$ulimit -n
1024
Instead of:
$ulimit
unlimited
You can raise the limit using this method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With