Ubuntu – Too many open files

filesulimit

when i open Lutris and then LOL client , this happening. And game never work good. I tried many things but never can change the open file limit. How can fix this ?

Waiting on children  
Waiting on children  
eventfd: Too many open files  
eventfd: Too many open files  
eventfd: Too many open files  
esync: write: Bad file descriptor  
eventfd: Too many open files  
eventfd: Too many open files  
eventfd: Too many open files  
esync: write: Bad file descriptor  
eventfd: Too many open files  
eventfd: Too many open files  
eventfd: Too many open files  
eventfd: Too many open files  
eventfd: Too many open files  
eventfd: Too many open files  
eventfd: Too many open files  
eventfd: Too many open files  
eventfd: Too many open files  
eventfd: Too many open files  
eventfd: Too many open files  
eventfd: Too many open files  
eventfd: Too many open files  
eventfd: Too many open files  

also there is my limits info

~$ ulimit -a  
core file size          (blocks, -c) 0  
data seg size           (kbytes, -d) unlimited  
scheduling priority             (-e) 0  
file size               (blocks, -f) unlimited  
pending signals                 (-i) 15106  
max locked memory       (kbytes, -l) 16384  
max memory size         (kbytes, -m) unlimited  
open files                      (-n) 1024  
pipe size            (512 bytes, -p) 8  
POSIX message queues     (bytes, -q) 819200  
real-time priority              (-r) 0  
stack size              (kbytes, -s) 8192  
cpu time               (seconds, -t) unlimited  
max user processes              (-u) 15106  
virtual memory          (kbytes, -v) unlimited  
file locks                      (-x) unlimited  

Best Answer

When the "Too Many Open Files" error message is written to the logs, it indicates that all available file handles for the process have been used (this includes sockets as well).

In a majority of cases, this is the result of file handles being leaked by some part of the application. ulimit is command in unix/linux which allows to set system limits for all properties.

ulimit is command in unix/linux which allows to set system limits for all properties in your case you need to increase max. no. of open files count

ulimit -n   <large value in your case 1000000>

or 

sysctl -w fs.file-max=1000000

and

/etc/security/limits.conf or /etc/sysctl.conf:
change 

fs.file-max = 1000000

To determine if the number of open files is growing over a period of time, issue lsof to report the open files against a PID on a periodic basis. For example:

lsof -p [PID] -r [interval in seconds, 1800 for 30 minutes] > lsof.out

This is especially useful if you don't have access to the lsof command:

ls -al /proc/PID/fd

Guidelines for setting ulimits

Related Question