To check ulimit (which generally causes too many files open error), don’t use
ulimit -n
ulimit of each process varies and when you issue the command, it’s issued by
shell you’re logged in.
Instead, to check process’ pid, you should use cat /proc/
/limits
You can get