I would like to know what nofile and nproc in ulimits is for, preferably with examples. Specifically, what is their role in database?
With respect to mongodb the two parameters are as follows:
nofile: -n: file descriptors
nofile to 64000. However, you may need to change it to higher values based on your requirement(with WiredTiger storage engine in particular). Provided you do testing on your environments using these values.nproc: -u: processes/threads
MongoDB uses processes to track each internal thread or pthread as a system process. e.g replication thread
MongoDB shows a startup warning if nproc is not set as expected. This is generally set as 1/2 of the nofile for mongodb deployments