Meilisearch index sync cause heap out error when MongoDB has high volume data #3687
Replies: 2 comments 4 replies
-
what are your resources when doing this? is it 2 GB RAM? I wonder if this can be alleviated by increasing the maximum heap size for Node.js using the Perhaps this can be revisited. It does use batch/bulk operations for the mongo side, at least. LibreChat/api/models/plugins/mongoMeili.js Lines 35 to 37 in b22f1c1 |
Beta Was this translation helpful? Give feedback.
-
We have also run into this issue where LibreChat crashes due to OOM. We have As well, loading the entire collection into memory seems a bit extreme. |
Beta Was this translation helpful? Give feedback.
-
What happened?
If I check the number of indexes in MongoDB and Meilisearch and they do not match, I restore the Meilisearch indexes from MongoDB, but in doing so I get a heap out error.
In my case, this happened when I exported mongodb data from LibreChat, which had accumulated data after a long period of operation, imported it into mongodb in another environment, and started Librechat. The number of indexes in mongodb and Meilisearch did not match and Index sync was executed, which caused a heap out error. (Please check the attached log)
Referring to the Index Sync code below, it seems that the heap is running out because all the data from mongodb and meilisearch are loaded in-memory.
LibreChat/api/models/plugins/mongoMeili.js
Line 43 in b22f1c1
Steps to Reproduce
mongodump --archive --gzip --uri ${MONGO_URI} > /tmp/mongodb.gz
mongorestore --drop --archive=/tmp/mongodb.gz --gzip --uri ${MONGO_URI}
What browsers are you seeing the problem on?
No response
Relevant log output
Screenshots
No response
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions