Spotlight's Impact on PowerBook Battery Life? 161
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?"
Umm.. (Score:5, Funny)
Re:Umm.. (Score:2, Informative)
What do you consider an average load? (Score:2, Informative)
After you install, files are indexed as they are written. It really takes very cpu time or other resources to do this. If you don't believe me do some performance profiling.
If you did an upgrade install, you are already working with a sorely fragmented disk. Additionally, batteries age. Maybe it's these two factors that are
Re:What do you consider an average load? (Score:5, Insightful)
Re:What do you consider an average load? (Score:5, Informative)
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!
Re:What do you consider an average load? (Score:2)
If it doesn't what would?
TIA
Re:What do you consider an average load? (Score:2)
You would need to add that one as well.
Too bad my battery blows (Score:3, Informative)
I wish there was a way of disabling spotlight during certain times. especially when I'm running a script that's creating dozens of files only to trash them again later. I think it's taking a bit of a performance hit from spotlight.
Re:Too bad my battery blows (Score:3, Informative)
Assuming your script always creates it's files in the same location, add that location to the privacy tab in Spotlight prefs. It should then ignore that directory.
Here's some more info [thexlab.com]
Re:Too bad my battery blows (Score:4, Informative)
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.
Re:Too bad my battery blows (Score:2)
SpotDark? Wow, that's clever.
Okay, not really.
Lithium batteries (Score:3, Insightful)
Once they finally do, they are thrilled to discover that it's like having a new laptop again, with nice long battery life.
Re:Lithium batteries (Score:2)
Here's a script to print out battery info... (Score:5, Informative)
[ -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...
Re:Here's a script to print out battery info... (Score:2)
./battery.sh: line 3:
sed: 2: "/| *{/,/| *}/ { # Comment added to fool lameness filter
However, which ioreg produces
Cheers,
Ian
Re:Here's a script to print out battery info... (Score:4, Informative)
Re:Here's a script to print out battery info... (Score:3, Informative)
LoL - so it's a race, is it? (Score:2)
Nice script.
Re:Here's a script to print out battery info... (Score:5, Informative)
Maybe I should have bought that sed and awk book
#!/usr/bin/perl
my $info = `/usr/sbin/ioreg -p IODeviceTree -n "battery" -w 0`;
my $batteryinfo = $info;
$batteryinfo =~ s/\n//g;
$batteryinfo =~ s/^.*\"(IOBatteryInfo)\" = \(\{(.*)\}\).*$/$1\n$2/g;
$batteryinfo =~ s/\"([\w ]*)\"=/\t$1:
$batteryinfo =~ s/,/\n/g;
print $batteryinfo . "\n\n";
Does the trick too though, and is easily modifiable to log the fields too. It outputs in the format:
IOBatteryInfo
Capacity: 4400
Amperage: 18446744073709550638
Cycle Count: 9
Current: 3262
Voltage: 11655
Flags: 4
AbsoluteMaxCapacity: 4400
God, do I have to type in loads of standard english text here to get it to submit? Bah! Well, here I am, stuck at home waiting for a delivery of a hard drive and drive enclosure. I'm sitting on my iBook wondering when it will turn up. I should be at work, but I can get away with not turning up as I can work from home. Foo foo foo foo. Is that a van I can hear? It appears not, no, wait, yes it is! Hurrah, a parcel! Fun fun fun fun. Gosh, I wonder if this is enough text.
No, it is not enough text. Sheesh, how frustrating. For a site for geeks, it is remarkably frustrating to post geeky stuff.
I'm just going to add logging to the script above, and then I can do what I said I'd do above.
Re:Here's a script to print out battery info... (Score:2)
Re:Here's a script to print out battery info... (Score:2)
Guess we will never know...
Dude, ACPI is your friend (Score:3, Interesting)
present: yes
design capacity: 6600 mAh
last full capacity: 5312 mAh
battery technology: rechargeable
design voltage: 14800 mV
design capacity warning: 300 mAh
design capacity low: 200 mAh
capacity granularity 1: 32 mAh
capacity granularity 2: 32 mAh
model number: 01NT
serial number: 16412
battery type: LION
OEM info: LGC-LGC
Re:Dude, ACPI is your friend (Score:2, Informative)
Re:Dude, ACPI is your friend (Score:2)
Re:Here's a script to print out battery info... (Score:2)
IOBatteryInfo
Capacity: 2947
Amperage: 0
Cycle Count: 226
Current: 2942
Voltage: 12414
Flags: 1090519045
Re:Here's a script to print out battery info... (Score:2, Informative)
You've had 226 recharge cycles on the battery, and the capacity is under 3000mAh now, instead of the original 4200. You've lost around 1250mAh @ 12V over the 18 months.
Did you run that with the external power in though? I only get 12.4V when it is plugged in.
Whether you want another battery is up to you though. Is the battery life getting to be an issue?
Re:Here's a script to print out battery info... (Score:2)
Plugged in: IOBatteryInfo
Capacity: 2947
Amperage: 0
Cycle Count: 226
Current: 2942
Voltage: 12413
Flags: 1090519045
Yes, your battery is going (Score:2)
Re:Here's a script to print out battery info... (Score:2)
Re:Here's a script to print out battery info... (Score:2)
something is totally screwed up. why is my capacity like 6x the absol
Re:Here's a script to print out battery info... (Score:2)
didn't do shit.
after that, my battery life went from ~4-5 hours (with normal use) down to about 2 hours within a couple weeks.
Wha
Re:Here's a script to print out battery info... (Score:5, Informative)
Profiler doesn't give you the max capacity. (Score:2)
Fixed version of script (Score:2)
Spotlight? Could be anything (Score:2, Informative)
Spotlight doesn't do that much work that I would honestly expect it to significantly impact battery life.
Perhaps if you used spotlight to find all your files, as it would take some effort to search the index and list all the files. But I doubt you search for that many files in a session.
It is far more likely there is another process which is effecting battery life, or your battery is starting to show some wear and tear.
Re:Spotlight? Could be anything (Score:5, Interesting)
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.
Re:Spotlight? Could be anything (Score:4, Informative)
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.
Re:Turning off spotlight? (Score:4, Informative)
Re:Spotlight? Could be anything (Score:2)
To answer your question (Score:5, Informative)
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.
Re:To answer your question (Score:2)
On the other hand, while a tad less intuitive, you could go to the "privacy" tab in the spotlight preference pane and enter or drag volumes / folders and possibly files that you don't want indexed, drag them back out if you need them to be indexed.
Re:To answer your question (Score:2, Informative)
What I recommend is that you read the Ars T [arstechnica.com]
Re:To answer your question (Score:5, Informative)
It should be noted that although you can turn off the Spotlight service itself, using the above mentioned "sudo mdutil -i off
Re:To answer your question (Score:3, Informative)
Re:To answer your question (Score:2)
Re:To answer your question (Score:2)
Does Spotlight find by content for you?
Re:To answer your question (Score:2)
You blame the user's perception of a difference in battery life post OS upgrade to their usage habits? The user's work habits completely changed on an OS upgrade? I particularly like the implied solution that the user shouldn't do any work. Better: just turn it off and leave it plugged in at home. Lots of juice in the battery then.
Here's a clue: One big rule is to keep the hard drive spun down as much as possible. To this end, laptops and
Re:To answer your question (Score:2)
My usage habits have changed as OSes have been upgraded. I use Dashboard and Spotlight all the time now. Whereas before I used Apps like Calculator and Safari to hit maps.google.com, I have widgets. I don't browse all over my hard drive looking for files because I have "smart folders" from Spotlight.
Hell, even when I used Windows and Linux my useag
Re:To answer your question (Score:2)
Which is exactly what I didn't mean. The kinds of high-level tasks a user engages in are rather unlikely to have changed as a result of an OS upgrade alone. E.g. things such as "developing Ruby code", "playing music", or "working on a video project", etc. In your case, these are "doing arithmetic" and "checking a map". The apps involved should be irrelevant, especially in this case. Why? Because whe
I've had a lot of problems with my PB since 10.4 (Score:4, Informative)
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.
Re:I've had a lot of problems with my PB since 10. (Score:3, Insightful)
Widgets really aren't that big a harm, unless you install and use a hundred of them. Frankly, on my iBook, I use 3 widgets, and could live without 2 of them (the TV guide I won't give up).
Mail.app has nev
Pfft. (Score:2)
I wouldn't mind the memory requirements if they were worthwhile but - as I said and you seem to confirm - 150 megs of virtual memory so you can view your netflix queue seems a bit extreme.
Re:Pfft. (Score:2)
I didn't really confirm the widget memory usage either.. my machine really doesn't use too terribly much to deal with Dashboard, but I guess YMMV. Secondly, as I have 1,256MB of ram, and as it wasn't very expensive in view of the cost of the entire platform, I don't really notice too much anymore when it comes to memory. My machine performs very well for most every d
Unfortunately (Score:2)
They *did* do a lot of nice stuff at the system level - launchd is interesting if a pain (because it adds a new barrier to making Linux system enhancements work with Mac) but they threw so much new syntactic sugar on top of everything as to force a migration to Intel just to get faster chips.
Tiger's new Sync model also broke the Exchange/iCal sync program I was using (groupcal), and caused a mysterious new bug in an op
Re:I've had a lot of problems with my PB since 10. (Score:2)
Each widget consumes 20MB of RAM, then consume a lot more of virtual memory. Some third party widgets don't know how to put themselves to sleep when Dashboard is off, so they continue to take CPU power.
Even on a system with 1.5GB RAM, I just decided to not use Dashboard, there are too many memory hogs and Dashboard really isn't useful enough. I think using Quicksilver to call up certain web sites and apps is quicker anyway.
Re:I've had a lot of problems with my PB since 10. (Score:2)
I've been forced to slim down to only one widget left running (although I have several more that I'd really like to keep open constantly), and to keep an eye on the number of apps I have resident at any particular time.
I had no such memory concerns under Panther. I would have thought 768MB would be ample, but it appears not. I'm looking to move to 1GB RAM, and hoping that Apple continue to clean up Tiger.
The 10.4.2 update consider
Re:I've had a lot of problems with my PB since 10. (Score:2)
I ahve a half a dozen widgets, itunes, safari(or firefox) is always runningI use fire for IM'ing and that is always up as well as iterm. I then start a game up and still nothing stutters. Heck I can run Photoshop with it and nothing happens.
The one bug I have found is that Safari has a probelm letting go of threads once they are formed. So after a week of runing non stop it has 40-50 threads on it's ow
Re:I've had a lot of problems with my PB since 10. (Score:4, Informative)
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.
Re:I've had a lot of problems with my PB since 10. (Score:2)
Safari, NewsFire, Sciral Consistency, iCal, Mail, Adium, Colloquy, iTunes, Activity Monitor, XCode.
I also used to run a local apache+postgresql dev environment, under Panther. 768MB RAM was still ample for this workload. But yes, Tiger has higher memory requirements and my usage is perhaps heavier than that of an average user
Re:I've had a lot of problems with my PB since 10. (Score:3, Informative)
Unless you really want to write it... then nevermind.
Battery-eating Tiger (Score:2)
But if you never launch Dashboard, the widgets don't load.
Tiger has slightly shortened battery life on my 1.5GHz 12" 'Book (from 3:30 or so to 3:10 or so in my usual use). I haven't gone digging to find out why, but I'm suspicious of changes at a deeper level than S
False (Score:3, Insightful)
False. Windows XP runs great in 512 MB RAM.
"as I can currently tell you, running Windows XP on a box with 192 megs of ram and crying every time I try to close winamp."
How about comparing apples to apples? You're comparing an 192 MB RAM machine with XP, to a 512 MB RAM machine with Tiger. We're talking more that 2.5 times differenc
Re:I've had a lot of problems with my PB since 10. (Score:2)
My powerbook has had one gig from the beginning, and I havent had any probs. Tiger's pretty memory hungry, perhaps you should grad another half gig. The sim I got from new egg was around 50 bucks, so good deal. Check it out.
Re:I've had a lot of problems with my PB since 10. (Score:2)
You, me, and everyone I've talked to. (Score:2)
Safari also eats memory, and benefits from a regular termination and restart.
Tiger's Mail is deeply flawed, especially when dealing with IMAP accounts. It often freezes when receiving new IMAP messages. It deletes IMAP emails without moving them to the Trash properly (settings to the contrary regardless), so I ha
Easy (Score:5, Informative)
Re:Easy (Score:2)
Disable Dashboard and Spotlight here (Score:3, Interesting)
http://software.filkifan.com/ [filkifan.com]
Mighty Mouse dissected detailed pictures and 76 widgets at once
http://homepage.mac.com/hogfish/PhotoAlbum2.html [mac.com]
Watching my DotMac bandwidth get Slashmelted - PRICELESS
Re:Disable Dashboard and Spotlight here (Score:2)
i've been waiting for someone to take apart their mighty mouse and post pictures.
P.S. I hate you for having the 30" monitor
Have you confirmed it? (Score:5, Informative)
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.
If you just got 10.4, ... (Score:3, Informative)
I know that performance on my dual 2ghz G5 with 5gb RAM took a huge hit for about the first 24 hours after I installed Tiger. I have a lot of disk space (almost 2TB) hung off my machine, thus the long indexing time.
Once that's over, the other replies are right - Spotlight doesn't take up much in the way of resources. But during the initial index, the hit's pretty big and it would not surprise me if it hurt battery life too.
D
Re:If you just got 10.4, ... (Score:2)
The problem is, with casual use of the computer while this is happening, indexing periods can drag for hours in the background. Some people have recommended a complete reindexing should be done at night while you're not using your computer, to ensure the
Re:If you just got 10.4, ... (Score:2)
D
Swapping and slow disk. (Score:3, Interesting)
Re:Swapping and slow disk. (Score:2)
Re:Swapping and slow disk. (Score:3, Informative)
What about Dashboard? (Score:3, Informative)
Re:What about Dashboard? (Score:2)
I can confirm that one of the first versions would get into a state where it would eat up all available CPU. Unfortunately, they all show up with the same name under top, and I wasn't thinking and didn't try to view complete command lines... This seems to have stopped since 10.4.2.
Re:What about Dashboard? (Score:2)
not Spotlight's fault, it's a problem with OS X (Score:5, Informative)
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
Re:not Spotlight's fault, it's a problem with OS X (Score:2)
My new iBook says it has 4 hours and 40 minutes of battery currently (just removed the power cord from a full charge). This is less than the 6 hours I expected of it, although 4.7 hours is still pretty good. I wonder if it would increase if I installed SideTrack?
hmmm (Score:2)
Could be Dashboard - Try This Command (Score:5, Informative)
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
How about a script to it for you? (Score:2)
display dialog "Dashboard on or off?" buttons {"On", "Off"} default button "On"
copy the button returned of the result to theSel
if theSel is equal to "Off" then
do shell script "defaults write com.apple.dashboard mcx-disabled -boolean YES"
end if
if theSel is equal to "On" then
do shell script "defaults write com.apple
It's not spotlight (Score:4, Informative)
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.
To turn Spotlight off... (Score:5, Informative)
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.
CPU Load A Possible Factor, Watching Energy Use (Score:3, Interesting)
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!)
Re:CPU Load A Possible Factor, Watching Energy Use (Score:2)
you betcha ! Crank up some old moldy (and poorly behaved) system 7/8 app under classic. See if you can get it to crash (which shouldn't be all that difficult). Then kick back and watch 'truBlueEnvironment' red-line the CPU usage on Activity Monitor. weeeeeeeee!
Switch from Dashboard to Konfabulator. (Score:2)
I've noticed that other programs that have gone to webkit from doing straight Aqua/Quartz layout have become slower and more CPU-hungry. It makes sense, Webkit is doing a lot more work, and it's got to re-render a lot more material when a script change changes the content.
Powerbook battery life sucks badly, period (Score:2)
My 1ghz 15" Albook is lucky to manage 2.5hrs, and that's with a new battery. Perhaps the 12" model with a smaller screen might be a little better.
I've considered going back to a older TiBook running linux, not OSX, for long trips on the road with frequent battery use. I wish Apple would address this; I suspect it is a problem borne out of the choice and clock rate of chip. I'll be very happy when a intel mobile is available - if I don't get a T21 thinkp
Yup. (Score:2)
They did - it's the main reason they're moving to Intel chips; they couldn't get PPC chips with the power characteristics they needed.
17" 1GHz Aluminum PowerBook (Score:2)
I barely get 2. (Score:2)
battery usage (Score:2, Informative)
Screen brightness (Score:2)
Ow my battery (Score:3, Funny)
graphics chip a factor (Score:2)
Tiger uses 3D acceleration for lots more basic gui stuff than Panther did. The laptop graphics chips run hot and drain power. Them being constantly in use for basic stuff is what makes Tiger drain the battery faster. As the chip is running all the time the fan is in use more often which drains the battery even faster. This was really noticeable on my Tibook when I installed Tiger.
Apple needs to add an option in Energy Saver to drop back to software for everything when running on b
Exclude the Entourage database file from Spotlight (Score:2, Informative)
Spotlight can't see into Entourage anyway, so you aren't loosing any functionality by telling Spotlight to ignore that
Re:Kill unused processes (Score:2, Funny)
Re:Kill unused processes (Score:4, Informative)
you$ man kextunload