Most UNIX-like operating systems, including Linux and macOS, provide ways to limit and control the usage of system resources such as threads, files, and network connections on a per-process and per-user basis. These “ulimits” prevent single users from using too many system resources. (https://docs.mongodb.com/manual/reference/ulimit/)
How to increase ulimit
# vi /etc/sysctl.conf
fs.file-max = 500000
#sysctl -p
# vi /etc/security/limits.conf
* soft nofile 60000
* hard nofile 60000
Note: '*' would apply the limit to all users on your system (except for root). If you only want the limit to apply for a single user or for the root user, you would need to replace * with the user.
reboot
Resource
https://glassonionblog.wordpress.com/2013/01/27/increase-ulimit-and-file-descriptors-limit/