nmh - very slow scanning folders

1 minute read

I started having problems within MH-E recently - folder completion was taking a very long time - between 1-2 minutes!

After posting to the MH-E mailing list, Jeffrey Honig questioned if it was a locking issue. He was right, and removing the locks resulted in a massive speedup.


Jeffrey> I have 510 folders and it takes 2 seconds. ?My first guess Jeffrey> would be file locking. ?Do you have any links to Jeffrey> directories outside your home dir where you can not write Jeffrey> .lock files. ? Is nmh configured for .lock files? Thanks

Good call!

cd ~/Mail     
find . | egrep -i "\.lock"

produced

./ebay/.mh_sequences.lock    
./Trust/SMTL/.mh_sequences.lock    
./non-urgent/.mh_sequences.lock    
./Contacts/andy.xxxxxxx/.mh_sequences.lock    
./Contacts/linuxemporium/.mh_sequences.lock   `

I removed all of these. Now:

/usr/bin/mh/folders -noheader -norecurse -nototal +Contacts     
0.08s user 0.19s system 28% cpu 0.956 total

Thanks for that. Would never have thought of it being a locking issue.

Just to demonstrate that it was these locking files:

touch ./Contacts/andy.xxxxxxx/.mh_sequences.lock     
time /usr/bin/mh/folders -noheader -norecurse -nototal +Contacts     
0.08s user 0.21s system 0% cpu 1:16.00 total

rm ./Contacts/andy.xxxxxxx/.mh_sequences.lock     
time /usr/bin/mh/folders -noheader -norecurse -nototal +Contacts     
0.07s user 0.22s system 26% cpu 1.107 total

I.e., 1 min 16 sec with the lock in place, 1.1 sec without.

Thanks Jeffrey.

Regards Pete

Leave a Comment