Page 1 of 1

Heavy, frequent CPU usage

PostPosted: Mon May 02, 2011 10:27 pm
by BillNace
Greetings,

Whenever my system is idle for any length of time (5 min+), both cores start getting pounded, in the 50-90% range. The culprit is always mds and/or hazelfolderwatch. Are they fighting over metadata? What can I do to settle them down.

Context:
Macbook Air (saw the same behavior on my MacBook Pro), the currently selling version (Fall 2010? introduction).
Fairly stable filesystem. I'm not adding / changing more than 50-100 files per day. Some of that churn is from Dropbox synchronization.
Fairly simple hazel ruleset. Yes, I do test for each file on the system (which is a bunch), but it was my understanding that hazel used the event-based stuff in the filesystem to watch for changes.
The ruleset simply descends into each folder, tests the "type" of each file (PDF, Pages, Numbers, Keynote, OmniGroup, Image, Microsoft) and then applies a color and runs a short applescript to "not show extensions."

Hmmm. As I typed the ruleset description, it occurs to me that perhaps I should put a guard on the file to not do anything if the file hasn't been changed since hazel last looked at it or such. I thought that was somewhat built in (that Hazel tries to be good about only looking at changed files, but still....).

Any ideas?

Cheers,
Bill Nace

Re: Heavy, frequent CPU usage

PostPosted: Tue May 03, 2011 9:57 am
by Mr_Noodle
You are having Hazel scan your whole hard drive? That's a very bad idea. With the current version, it uses an older file event system but even with the newer one coming up in 3.0, that doesn't relieve the load all that much. All it does is basically wake you up; you still have to scan things to see what actually changed.

As a test for yourself, select your home folder and do Get Info. See how long it takes before it calculates the size (and also notice the amount of disk activity going on). This is only doing size calculations which is a pretty fast operation yet it takes a bit of time and resources to do. Not something you want to have your machine constantly doing.

I suggest limiting your rules to places where files come into your system which should catch most of the cases.