Spotlight's Impact on PowerBook Battery Life?
Viltvodlian Deoderan asks: "So, Spotlight for Mac OS X Tiger is very cool. I can now let my innate ability to disorganize things shine through. However, when using my PowerBook unplugged, it seems that my battery lasts a noticeably less time. A close reading of Ars Technica's description of how spotlight works suggests that this is due to keeping the index file up-to-date on disk. Has anyone else noticed the same thing? Does someone have a better explanation for why my battery seems to drain out, prematurely? Is there some way real-time indexing can be turned off to conserve power?"
Try turning off the pr0n. you're welcome.
From here: /Volumes/Backup .
To turn indexing on or off for a volume, run sudo mdutil -i on volume name or sudo mdutil -i off volume name, respectively. For example, if you want to turn off indexing for a volume called Backup, the command would be sudo mdutil -i off
Now to give you some grief about it:
This is pretty basic stuff - the less the hardware is used, the less power it will consume. If Spotlight, or any other app, is accessing the disk, then it will need power to do so. Likewise, if Spotlight is doing a bunch of searching through it's index that has to be loaded into RAM from the disk and those queries must be computed by the OS, then the disk and OS and RAM are all getting a workout.
What I recommend is that you check out what it is you are doing. If you are copy and moving files all over the place, or mounting and unmounting CDs, those processes would cause HD/CD usage as well as Spotlight indexing on top of that. Likewise, if you are doing a lot of Spotlight searching, there will be more usage because you are querying a DBMS.
Perhaps your battery is just coincidentally needed a replacement and/or non-spotlight related OS tweeks are changing power consumption.
I only came here to do two things; kick some ass, and drink some beer...looks like we're almost out of beer.
I've got half a gig, but I'm swapping constantly and apps like Safari regularly swell to consume all available RAM.
Widgets that access the internet regularly consume a hundred megs of swap and mdimport will start eating processor at random moments. Mail.app regularly tries to index the hundreds of thousands of files on my company's Exchange server and comes to a screeching halt.
Frankly, Tiger's been a major disappointment.
Clear, Dark Skies
Drag the volume you don't want indexed into the Privacy pane in Spotlight preferences.
No, I've experienced this too with a quite new iBook. Before Tiger I'd get battery life of just under 6 hours. Afterwards I'm lucky to get 5.
I believe it's correctly attributed to Spotlight, as every now and again, even when the machine is sitting plugged in and resting on my kitchen counter, I can hear it whirl it's harddisk as if it's indexing.
I would like a control panel applet to tune Spotlight, but I can wait. I already did my part in the deal (gave them an email and a submission on their website).
And for the trolls of the world, Apple's not perfect either. This is the first time this kind of tool has been included in an operating system, and it's something that will take quite a bit of time to tune and work out correctly. To be honest, in all of my works to do something similar, I've came out with the same results to a much lower quality, and any tool I've seen to do the same will probably harm my battery's life even more.
"Victory means exit strategy, and it's important for the President to explain to us what the exit strategy is." G.W.Bush
DisableTigerFeatures 1.0.3 - FREE
http://software.filkifan.com/
Mighty Mouse dissected detailed pictures and 76 widgets at once
http://homepage.mac.com/hogfish/PhotoAlbum2.html
Watching my DotMac bandwidth get Slashmelted - PRICELESS
I'm not saying that it *isn't* Spotlight, but just about anything could be chewing up your battery. Widgets, indexing, screen savers, or even poor Engergy Saver settings. Have you checked to make sure that Spotlight is what's killing your battery?
0 808165343661
Several people have been complaining about a bug in Tiger and the 2005 Powerbooks that has to do with the trackpad:
http://www.macosxhints.com/article.php?story=2005
It seems that the new tracking features eat up a lot of processor time (and thus, a lot of battery as well).
Again, I'm not dissing the Spotlight issue: it's definitely something to look at. But if you're still having trouble, you might check on other factors that can kill your battery life.
#!/bin/bash
/usr/sbin/ioreg ] && \ /usr/sbin/ioreg -p IODeviceTree -n "battery" -w 0 | \ /^[{}]/!p
[ -x
sed -ne '/| *{/,/| *}/ {
s/^[ |]*//g
}' | \
awk '/IOBatteryInfo/ {
A=$3 $4
gsub("[{}()\"]","", A)
gsub(","," ",A)
print($1, $2, A)
}'
# EOF
Save that as a shell script, when you run it from terminal it will produce info like this:
"IOBatteryInfo" = Capacity=4046 Amperage=1157 CycleCount=483 Current=2837 Voltage=12187 Flags=838860807 AbsoluteMaxCapacity=4400
The difference between AbsoluteMaxCapacity and Capacity gives you an idea of how much my battery has faded since it was new...
Clear, Dark Skies
All it does now is respond to new files being created or files being changed. It doesn't need to scan for these as it is told directly by the operating system when the changes take place.
The constant disk access must be some other process.
Read this:
0 808165343661
http://www.macosxhints.com/article.php?story=2005
It is actually a bug with the driver for the new USB scrolling trackpad. This has been noted in various forums and Apple are aware of this problem.
If you plug in an external mouse and disable the trackpad, or replace the driver with SideTrack, the problem goes away.
This only effects the 2005 Powerbooks, and causes much higher CPU and memory load.
Will
per mere, per terras
Open Terminal and type this command, followed by return:
defaults write com.apple.dashboard mcx-disabled -boolean YES
Restart the dock, dashboard is dead.
To get dashboard back type:
defaults write com.apple.dashboard mcx-disabled -boolean NO
Spotlight put the machine through hell for a few days while it indexed everything it could find -- then it went to sleep.
Dashboard was eating battery life by 20% and increasing wait times on certain apps significantly -- that is until I killed it. Battery life instantly jumped right back up.
Spotlight is a one off issue that lasts about a day -- Dashboard is the ongoing PITA.
Mod me up, mod me down, flame me, praise me -- whatever you do, you help prove I exist...
Use /sbin/kextunload to remove kernel extensions (what drivers in OS X tend to be) that are in memory, not kill.
you$ man kextunload
Mikey-San
Karma: +Eleventy billion (mostly affected by watching Celebrity Jeopardy)
What if his script is deployed on machines he has no direct control over? (Say, he's writing the script for people to download.)
Original poster: I'm not sure what the purpose of your script is, but if you can, create a temporary folder called "MyScriptFiles.noindex" and write your temp files to that instead. Folders with a ".noindex" suffix don't get indexed by SpotDark.
Mikey-San
Karma: +Eleventy billion (mostly affected by watching Celebrity Jeopardy)
I have 512MB in my iBook, and I never noticed issues when running Dashboard, Mail, Safari, Terminal, etc, at the same time. Hell even running Eclipse it wasn't too bad, except waking up from sleep.
What I have done though is turn off Dashboard, and I'm going to write an application to log the battery power using ioreg (from a post above) from a full charge, then compare it to running with Dashboard from a full charge.
Every time you modify a file, it is re-indexed. If you are downloading a lot of files, or touching a lot of files, then it is a good idea to add the folder containing them to the privacy list in the Spotlight settings in System Preferences. I have ~/tmp set to ignore, and I do anything here that I don't mind not being indexed. Although considering how rarely I use Spotlight, I should probably add a lot more...
I am TheRaven on Soylent News
I am TheRaven on Soylent News
Add this to /etc/hostconfig:
SPOTLIGHT=-NO-
Reboot, and you're done. The indexing service won't even load at boot. The spotlight icon will still be in the corner but will do absolutely nothing when you type in a string.
And by the way, a watched pot also never boils. I think you're just imagining that it's sucking up all your battery. But hey, it may use a few extra cycles and use up your battery a little quicker.
I just wasted your mod points! HA!
1. Open spotlight preferences, select privacy tab /tmp
2. Open finder window
3. Select go to folder in the finder menu
4. Type
5. Drag tmp folder to privacy list in spotlight preferences tab.
6. profit!
seSales, Point of Sale software for OS X.
I haven't yet used a meter to see how much the power comsumption is going up, but through use of the menubar utility Menu Meters, I've caught CPU use being unexpectedly high at times. Even without meausuring the power I'm certain that it increases, as my old TiBook fires up the fan after these periods of high CPU activity.
The primary source of unexpected CPU load for me turned out to be certain animated banner/skyscraper animated ads. I haven't looked at page source to figure out just what they were, but I suspect Flash. Reloading pages and getting the ads to change has brought the CPU use back to very low levels while sitting on a page. I've even seen these high-cpu ads on Slashdot at times.
Although I haven't seen a problem with any Apple-supplied Dashboard Widgets, some third-party widgets use more CPU than I'd expect when they're in the background.
The Options section of the Energy Saver control panel allows setting reduced processor performance. That helps too. Separate settings are available for battery and adaptor operation. I find myself using the "reduced" setting even for adaptor operation at times just because I don't like the computer to get so hot. It's fine on a glass desktop or coffee table, but really cooks on a bedspread!
Activity Monitor should help spot processes that are using the CPU heavily. It and Menu Meters can show disk activity also, but I haven't found a way to tell which processes are using the disk. I haven't noticed much activity I'd attribute to Spotlight, except when first connecting a Firewire drive.
It is very easy to see what's going on with power consumption if you measure the power going into the AC adaptor (best done when you've reached the fully charged state, but you can still see changes while charging).
I use a small meter I picked up at Radio Shack called the "Kill A Watt". It makes it very easy to see how much effect things like screen brightness settings have (a bunch).
I think many on Slashdot would find one of those meters useful. They're very handy for spotting things around the house that use power even when off. Using one was enough to get me to swap most of my generic AC adaptors with transformers for the variety with switching supplies (most easily identified by their lower weight).
Tests revealed that even my soldering stations had the transformer cores energized when "off". I rewired them to put the power switch before the transformer instead of after. Metering also easily showed the effects of over (and under) clocking PCs here. Watching power consumption everywhere not only helps laptop battery life, but the environment and the the budget. A fast and dirty rule of thumb I use for estimating cost is $1 a month for every 10 Watts that's consumed 24 hours a day. (Those AC adaptors, cable/satellite boxes, routers, VCRs, microwave ovens, doorbells, thermostats, amplified speakers, remote-control devices etc are probably all using some power all the time!)
Yeah powering a spotlight with my PowerBook really drains the battery.