Optimizing for frequent indexing

3 views
Skip to first unread message

Oli Sturm

unread,
Sep 3, 2025, 9:16:40 AMSep 3
to mu-di...@googlegroups.com

Hi,

New mu user here. I have an email folder that includes two Maildir hierarchies current and old. I created one index for everything since it seems easier to deal with, especially in mu4e.

I run a script that uses mbsync to update the current Maildir, while the old part doesn’t change. After the mbsync run I want to update the index, and this takes longer than I’d like. I also noticed that the behavior in terms of system load is a bit peculiar.

When I run mu index --muhome=/mufolder, this counts to the number of messages in all folders in around 17 seconds while the mu process consumes around 32% CPU. Then it sits there for another 28 seconds doing nothing I can see, while the mu process consumes 65% CPU. Total time is around 44 seconds.

When I run mu index --muhome=/mufolder --lazy-check, the first part is much quicker, almost instantaneous in fact - but after that the process still sits there for another 28 seconds doing nothing, while the mu process consumes 65% CPU. Total time is just over 28 seconds.

The mysterious bit is what mu does in those 28 seconds. I tried passing -v but there’s no extra output. Is there a way to optimize this behavior?

Thanks
Oli

Oli Sturm

unread,
Sep 3, 2025, 10:29:29 AMSep 3
to mu-di...@googlegroups.com

Hi,

Update: I found the culprit, it is the clean-up process. Disabling it with the --nocleanup flag solves the problem. I noticed that all the multi-gigabyte xapian index files seemed to be touched during every run, so I’m glad this flag exists!

Thanks for reading, hope this update is useful to someone else.
Oli

Reply all
Reply to author
Forward
0 new messages