# Too Many Open Files/Open Connections Issue for MongoDB

**URL:** <https://forums.percona.com/t/too-many-open-files-open-connections-issue-for-mongodb/37262>\
**Category:** MongoDB\
**Created:** [March 18, 2025, 4:10pm UTC](https://forums.percona.com/t/too-many-open-files-open-connections-issue-for-mongodb/37262 "2025-03-18T16:10:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tsquare](https://avatars.discourse-cdn.com/v4/letter/t/ec9cab/32.png) [@tsquare](https://forums.percona.com/u/tsquare)\
**Post date:** [March 18, 2025, 4:10pm UTC](https://forums.percona.com/t/too-many-open-files-open-connections-issue-for-mongodb/37262/1 "2025-03-18T16:10:14Z")

</div>

We recently ran into an issue where we have a single replica set Opening too many connections. On average, the number of connections hover around 50000. Each replica set uses 5k to 10k connections. However, this particular replica set immediately consume all of these and eventually crash the software. We can’t run it longer than 2 minutes before this happens. Any administration advice would be helpful. We are running 8 CPU, 32 GB RAM, VMs with 1 TB storage each. We have migrated the machine, rebooted, and restarted mongo.

ulimit -n is 64000 and ulimit -u is 64000. Right now we have maxNumberOfConnections set to 62000. This prevents the software from dying, but causes a host of connection problems since we are using all of the resources. We are using 7.0.16

Thanks

---

<div class="post-metadata">

**Author:** ![Ivan\_Groenewold](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ivan_groenewold/32/6299_2.png) [@Ivan\_Groenewold](https://forums.percona.com/u/Ivan_Groenewold)\
**Post date:** [March 19, 2025, 11:36am UTC](https://forums.percona.com/t/too-many-open-files-open-connections-issue-for-mongodb/37262/2 "2025-03-19T11:36:29Z")

</div>

Hi, it is hard to say why that is happening without looking at the system in practice. I suggest you consider a [consulting engagement](https://www.percona.com/resources/percona-consulting) with Percona

---

<div class="post-metadata">

**Author:** ![ROHIT\_KHURANA](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/rohit_khurana/32/2760_2.png) [@ROHIT\_KHURANA](https://forums.percona.com/u/ROHIT_KHURANA)\
**Post date:** [March 25, 2025, 4:12am UTC](https://forums.percona.com/t/too-many-open-files-open-connections-issue-for-mongodb/37262/3 "2025-03-25T04:12:27Z")

</div>

What’s the OS you are having
