If you encounter a problem with MongoDB with the below error. Its worth checking that your Linux OS does not have an override for your sysctl.conf settings called etc/security/limits.d/90-nproc.conf
[initandlisten] pthread_create failed: errno:11 Resource temporarily unavailable [initandlisten] can’t create new thread, closing connection
Add a new conf file after with the updated details in the /etc/security/limits.d/ folder entitled 91.mongod.conf. Ensure that the number is after the previous conf file to ensure it gets loaded last.
root - nofile 21000 mongod - nofile 21000 mongod soft nproc 62848 mongod hard nproc 62848