I recently changed my system to Apple Mac Pro M2 on latest MacOS 13.3.1.
I’m able to install MongoDB successfully, but whenever I’m trying to mongorestore from a dump on my local, I’m always facing either of these issues:
1.Failed:<collection_name>: error creating collection <collection_name>: error running create command: (TooManyFilesOpen) 24: Too many open files - where <collection_name> is random every time. or,
2. Failed:<collection_name>: error reading database: connection() error occurred during connection handshake: connection(localhost:27017[-8]) socket was unexpectedly closed: EOF
Mostly it’s “too many open files” and in this restore process few or more collections get missed and service also gets stopped.
I tried all 4.4.19, 5.0 and 6.0 versions of MongoDB. All results in same. My current database tools version is 100.7.0 and file descriptors value is 64000 “ulimit -S -n 64000” in .zshrc.
I also realised that the service also itself gets stopped when I’m just using Compass to access DB.
Can anyone please provide any help on it? I’m starting to believe that this is related to M2 chips only.
This created a daemon so that on system boot it can set the maxfiles limit. My belief is that this problem is only with M2 systems, because I have many colleagues who’re using an M1 mac and no one had ever faced such issue with same open files or maxfiles limit.
In case if someone has better explanation do let me know. Thanks!