I was trying to backup my database, having around 50 collections and total records will be somewhere around 80 million. While dumping the collections, I got an error stating
Failed: error writing data for collection `{collection_name} to disk: error reading collection: connection pool for 127.0.0.1:27017 was cleared because another operation failed with: (InterruptedAtShutdown) interrupted at shutdown
I was going through the mongo logs and only thing which I found was,
Interrupted operation as its client disconnected
mongodump verison => 100.6.1 mongo version => 6.0.2
I am unable to find the root cause of the error. Any help will be much appreciated. Thanks!
I see you didn't specify how you used the options of the backup in
mongodump
and what machine specs you used for MongoDB, but please note that taking backups usingmongodump
will affect your MongoDB performance as stated in the documentation.If your data size is larger than the system memory of the database, the
mongodump
will push the working set out of memory, which causes page faults. It's possible that at the moment you don't have any available memory to serve the process, thus MongoDB process got killed (Out of Memory). The workaround for such cases is that you can dump the collections slice by slice, so you backup the subset of data instead of the whole dataset, and compress the backup as well or you can increase the system memory in the server which will increase the WiredTiger cache size as well. The default WiredTiger cache size is 1/2 * (your system memory - 1).