Reputation: 190
I have a Linux Server (CentOS) with 32GB RAM.
I installed the MongoDB with a Java application. But sometimes, the MongoDB stops to work. So I need to restart it.
I already used the ulimit
linux command to change te open files limit to 64000
, but the problem still happens.
I'd like to know if somebody have some experience with MongoDB and can give me some tip about this problem.
Upvotes: 1
Views: 159
Reputation: 6233
If you're getting "too many connections," it's quite possible you're opening too many MongoClients
. In general, you need only open the one client and its internal connection pool will manage everything for you. This isn't always possible, though, so you'll want to make sure you properly manage the scope of each MongoClient
and call close()
on it when you're done.
Upvotes: 1