
Power Wastage on an Idle Laptop - dezgeg
https://randomascii.wordpress.com/2016/03/08/power-wastage-on-an-idle-laptop/
======
evmar
If you're on Linux and jealous: a similar (but different in a lot of ways too)
tool for doing an analysis like this is called "powertop".

~~~
jsnell
I've never gotten useful results from powertop. The model it builds to
correlate system events vs. observed power usage always diverges with reality
very quickly. In the good case it'll just do something a little silly like
conclude that the CPU fan is the ultimate source of all power consumption. In
the bad case it'll be something like think that a pair of linux veths uses 3kW
(not a typo) of power.

~~~
smcl
I was the same - mixed results at best. I figured that manually playing with
this all the time was the wrong solution and installed TLP instead which seems
to work pretty nicely. Not sure if it is mentioned in the linked article, so
if not then check it here: [http://linrunner.de/en/tlp/docs/tlp-linux-
advanced-power-man...](http://linrunner.de/en/tlp/docs/tlp-linux-advanced-
power-management.html)

------
neves
I didn't make a real trace, but was impressed when I saw the amount of CPU was
being wasted for the the three cloud drives that I had: Microsoft OneDrive,
DropBox and Google Drive. They all offer some free extra space when you login
from a new machine and I accepted all of them. When I disabled them all my
machine were much more responsive.

~~~
revelation
You'd be amazed at the amount of _disk IO_ wasted by these programs, then.

Can somebody tell the Dropbox developers that _right after boot_ is the exact
wrong time to kill disk performance with a massive number of very random, very
short reads? Jesus. People want to use their newly booted PC, not wait for
Dropbox to realize nothing has changed after all while it chokes the browser
being started.

I figure they don't notice because they have two PCIE 512GB SSD disks in a
raid0 in their dev boxes. They need to test this stuff with spinning rust.

~~~
steven777400
I'm a developer for a large organization and every year or two I snag a laptop
on the way out of the bottom of the replacement cycle. When I have it out
people sometimes come by and are shocked, "You're a developer, what are you
doing with that thing? It must be the oldest laptop in the whole agency!"

And I tell them, "Exactly. If I make my app run well on this laptop, I know
for sure it will run acceptably on every machine here."

~~~
CaptSpify
A company I used to work for had a slow DSL line, with a ~7 year old pc, that
they'd use to test their web-apps. That way, if it was responsive on that,
then it'd be responsive on the customer's pc. I wish more companies tried
this, instead of pushing the limit of what their expensive work-provided
desktops could do.

~~~
ragix
This guy has a good write up on using netem to impair a connection to simulate
a wan connection.

Pretty handy for testing. I've used it to simulate a bad uplink in between a
dslam and bras.

[https://www.excentis.com/blog/use-linux-traffic-control-
impa...](https://www.excentis.com/blog/use-linux-traffic-control-impairment-
node-test-environment-part-1)

~~~
scruple
I was going to recommend traffic manipulation and traffic shaping with netem
and tc. I set this up at my last employer in the lab for use with our
networked IP radios and such. Stimulating poor network conditions has been a
mainstay in my testing ever since, even now that I work on web apps and
distributed services.

------
phillc73
As an aside, because I'm genuinely curious, can anyone explain the modern
English trend of adding "age" suffix to some words? E.g. Wastage, Usage.

The title of this post would read just as well as "Power Waste on an Idle
Laptop".

I also see "Usage" quite a lot on GitHub Readme pages, where I think "Use"
would suffice.

Many words seem to be shortened for common use. E.g. Photograph to photo.

Why extend the length of other words?

~~~
castis
[https://en.wiktionary.org/wiki/-age](https://en.wiktionary.org/wiki/-age) has
some information on the subject. Seems the convention was created to turn
nouns into verbs?

~~~
phillc73
Thanks.

Of the six potential uses, I think this one is most relevant:

"Forming nouns indicating a process, action or result. E.g. blockage,
slippage, shrinkage"

Yet in this case the extension to "wastage" still feels somehow redundant. For
example, I wouldn't say "Household wastage in modern society".

~~~
sp332
I would use "waste" to refer to the physical result, a bunch of trash or
whatever. "Wastage" to me is the act, the production of waste.

------
ldom66
"I have a special set of skills and if you violate these rules then I will
hunt down your process and kill it." Great writing

~~~
lorenzk
It's a quote from 96 hours:

"Bryan: [...] But what I do have are a very particular set of skills, skills I
have acquired over a very long career. Skills that make me a nightmare for
people like you. If you let my daughter go now, that'll be the end of it. I
will not look for you, I will not pursue you. But if you don't, I will look
for you, I will find you, and I will kill you."

Source:
[http://www.imdb.com/title/tt0936501/quotes](http://www.imdb.com/title/tt0936501/quotes)

~~~
sandebert
Typo? It's from Taken.

~~~
cellularmitosis
Looks like you are both correct:
[https://de.wikipedia.org/wiki/96_Hours](https://de.wikipedia.org/wiki/96_Hours)

~~~
kyberias
How does that link prove anything?

~~~
cellularmitosis
The first four words on that page are "96 Hours (Originaltitel: Taken)".

I don't speak any german, but I have a pretty good idea of what that means.

------
gmac
_If you really can’t figure out how to avoid polling then be smart about it.
Waking up every second may seem very conservative, but if every long running
program does it then your CPU may get woken up dozens of times per second._

My understanding was that this shouldn't be true since Windows 7 (and on Mac,
since Mavericks):
[https://en.wikipedia.org/wiki/Timer_coalescing](https://en.wikipedia.org/wiki/Timer_coalescing)

~~~
brucedawson
The rules on timer coalescing are complex and they depend on the details of
the timers. So, the timers may get coalesced, but it's hardly guaranteed,
especially if the different wakeup frequencies are slightly different.

I suspect very few programs are using SetCoalescableTimer, but I'll add that
as a suggestion.

------
fowl2
A slightly easier option is "powercfg -energy" \- does a 1 minute sample and
spits out a little html report.

Also includes some info about driver/firmware limitations, wake up sources,
supported power states etc.

------
Kenji
Don't forget to disable Windows Defender which does lots of realtime scanning
and hogs CPU resources and disk IO. A complete piece of trash that
automatically deletes false positives. Never have I been so disappointed with
Windows 10 than after upgrading and seeing this thing enabling itself and
running.

(To the downvoters: I would love to hear feedback about why I'm mistaken here.
Windows 7 didn't need such an authoritarian defender (auto-deleting things,
scanning, etc.) and it felt just as safe)

~~~
tomaskafka
I see Defender as a symptom - as it monitors the files, it only checks files
that _some other process_ opens. Go solve a problem of second process
regularly accessing files on idle PC.

~~~
brucedawson
I hope that you are correct. That was also my assumption but I have not
validated it.

------
hauget
If you're on a Mac and using OSX, I highly suggest checking out Turbo Boost
switcher [https://github.com/rugarciap/Turbo-Boost-
Switcher](https://github.com/rugarciap/Turbo-Boost-Switcher) It's given me at
least an hour more of battery life on my aging Macbook Pro 13 (2011). Another
handy tool on OSX is CoconutBattery which is basically the closest I've found
to PowerTop for monitoring power usage (I know ActivityMonitor somewhat shows
power usage BUT it makes my fans & CPU spin like crazy when it's gathering
info!)

~~~
astrange
Try "powermetrics" on the command line.

------
TheTravCav
I can just imagine a sql server team meeting where they discuss sql server's
effect on laptop battery life. Given sql server's intended environment, I
almost wonder if its activity is intentional.

~~~
brucedawson
Power consumption is a concern even in data centers, but yeah, the power cost
of this inefficiency is probably inconsequential in situations where sqlservr
is actually being used.

But, VS installed and started sqlservr on _millions_ of developer machines so
they should have paid some attention to this issue. Super sloppy.

~~~
teh_klev
> Super sloppy.

You don't need to install SQL Server Express, just pay a bit more attention to
what you're installing.

~~~
brucedawson
What if I need it occasionally? Should I stop and start the server process as
needed?

If so, why? Why shouldn't it just behave reasonably? Computers should be _our_
slaves.

~~~
tfiner
So true, if only more users realized this. I for one really appreciate your
work this.

Users don't understand that computer resources like CPU time and battery level
are really their property. It is an awful like paying a hidden poor quality
tax.

It is not unreasonable to expect software to not waste CPU and battery time.

------
perlgeek
I can imagine many valid use cases for an RDMS waking up regularly, and a
laptop really isn't the environment it was originally developed for.

The really questionable thing is automatically installing it along with Visual
Studio.

~~~
brucedawson
Waking up every minute is fine. Spending 1.5 s of CPU time doing nothing... I
think I could improve on that. That's enough CPU time to drag down overall
performance slightly when the machine is not idle.

------
zokier
I would have liked to see bit more discussion/analysis on CPU power states,
wakeups and frequency scaling. My understanding CPU usage might not be always
perfect proxy for energy usage.

~~~
brucedawson
Yeah, I thought about that, but I wasn't sure I could say anything
authoritatively enough beyond "CPU consumption wastes power, and so does
waking up". Apple's energy monitor seems to use that for its model so I guess
it's not too bad.

------
ryanolsonx
I wonder if anyone will do an analysis like this for Mac

~~~
pkaye
On (recent) Macs, they have the Energy Impact numbers on the Activity Monitor.
It can give a metric on which applications are taking up the most energy.
However it doesn't show many of the system processes...

~~~
masklinn
For those interested in the way Energy Impact is computed:
[https://blog.mozilla.org/nnethercote/2015/08/26/what-does-
th...](https://blog.mozilla.org/nnethercote/2015/08/26/what-does-the-os-x-
activity-monitors-energy-impact-actually-measure/)

In 10.9 it was a simple function of on-CPU time and wakeups with each wakeup
counted as 500µs of CPU time, in 10.10 a bunch of new counters were added
(with machine-specific conversions to CPU time estimates) variables were added
to the mix: whether the process was in "background" QoS, the number of disk
read/writes, GPU usage and network activity (in packets#)

