Never Run Your Mongodb as Root User
We have recently had a "to many open files" problem in one of our Mongodb servers. Mongodb kept saying "Out of file descriptors. Waiting one second before trying to accept more connections." and accept no more connections. The first thing came to our mind was that the reason is too much load, our mongodb servers were no longer enough to carry it. But it was wrong. After first research it became clear that it was because of linux's user limits, so our wrong decision: running mongodb servers with the root user. In linux systems, every user has some limits which decide how much system resources they are allowed to consume. These limits prevent one devil user to drain all the system and to make other users to starve of resources. In our linux servers, root user had lower limits than mongodb's suggested limits. Even if the root user had the suggested limits, we could have had the problem any way. Because root user is responsible for other operational works, not...