Any Routine Maintenance Recommended For OpenCore?

Hello,

I was wondering if there was any recommended maintenance that should be performed on the opencore stack to keep it working smoothly (DB cleanup/indexing, queue mainentence, log files, etc). I periodically purge my queues so they are empty. I don’t know if that’s good/bad practice but makes me feel better.

I took a look around the forum and docs, but didn’t find anything related to maintenance. I appreciate any insights the community has on this.

That is an excellent question.

Inside OpenCore, there is a housekeeper that runs by default every 10 minutes and performs most of the essential tasks, such as updating stats about collections, enforcing default indexes on collections, shutting down idle agents if agent plans are enabled, and collecting user storage usage if enabled.

We have been experimenting with adding an intelligent indexing wizard to OpenCore. I wrote a small agent that can scan the database profiling data and come up with recommendations on what indexes to add or drop to make everything run smoothly. It does this by summarizing those and sending them to OpenAI. We want to “bake that in” to the OpenCore interface and OpenCore itself, but we had to put it on hold for a while. However, you can do this yourself too; it can really help to understand what kind of load your use of the system places on the database, making it a very educational exercise. It’s somewhat of a hassle and a lengthy process if you do not have a license for OpenCore, but it is definitely doable, or you can switch from using a local database to using MongoDB Atlas, where this feature is also built-in.

For collections that can grow big over time, you can configure them with a TTL (Time To Live). This will make the database automatically delete objects that are older than XX seconds. These are handy for collections like Audit that can become quite large. Using this on collections where you store data yourself could be an option too.

Unfortunately, we cannot use that on the workitems collection (since that would leave any files attached stuck in the files collection), so while writing this, I’m also adding this to the backlog. It could be beneficial to add to the housekeeper, allowing you to configure it to purge old completed workitems.

The number one thing I see people neglect, which is the most important, is backing up the database. Please, please, please remember to set up an external job to ensure you have a backup of the database, or if you are running on a virtual environment, take a snapshot of the VM once in a while.

3 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.