Linux has a limit on how many files can be opened. Each process also has limits on how many files can be opened. You can check the limits of the process by doing the following steps
Checking the file limits of a running process
first you need to find the process id. You can do that by the following command
ps aux | grep process-name
Then run the following command replacing XXX with the process id you got from the command above
cat /proc/XXX/limits