[HN Gopher] Principles of Green Software Engineering
       ___________________________________________________________________
        
       Principles of Green Software Engineering
        
       Author : nrsapt
       Score  : 108 points
       Date   : 2021-09-22 11:54 UTC (11 hours ago)
        
 (HTM) web link (principles.green)
 (TXT) w3m dump (principles.green)
        
       | lincpa wrote:
       | 10 Principles of Scientific Software Engineering
       | 
       | https://github.com/linpengcheng/PurefunctionPipelineDataflow...
        
       | sergiotapia wrote:
       | Thought experiment: what would happen to energy and pollution if
       | magically, all existing software on earth suddenly was written in
       | high performing C?
        
       | anonymoushn wrote:
       | It seems hard to achieve most of these goals independent of
       | programming language and framework. At Facebook, the Instagram
       | team has built tooling to inform engineers how many millions of
       | dollars each line of their Python code costs to execute, but the
       | easiest way for them to save those dollars and Joules is to not
       | run back APIs used by billions of people with Python
        
         | the-dude wrote:
         | Until I did a year of Plone development, I always thought
         | webapps were IO bound.
        
           | [deleted]
        
       | open-source-ux wrote:
       | The topic of ranking programming languages by energy efficiency
       | has been discussed before on Hacker News. Here is the paper
       | previously discussed which has been updated in 2021:
       | 
       |  _Energy Efficiency across Programming Languages_ :
       | https://sites.google.com/view/energy-efficiency-languages
       | 
       | I'm glad to see new(ish) languages take performance seriously:
       | Rust, Go, Nim, Crystal, Julia. Some of the most popular languages
       | (we all know which ones) are the least performative. But they
       | make life easier for developers, or as programmers love to say
       | 'more productive'. On the other hand, when it's programmers who
       | are on the receiving end of slow, resource intensive apps,
       | they'll complain loudly.
       | 
       | When performance is an issue in running programs, a common
       | response is: hardware is cheap, just add another energy-guzzling
       | server or use a more powerful computer.
       | 
       | This attitude is embarrassing when you consider that in every
       | other industry there is a push for reduced resource usage and
       | lower energy consumption. I don't think it's controversial to say
       | a typed, compiled language gives you good performance for free
       | (and the reduced computing resources that implies).
       | 
       |  _Aside_ : When PHP 7 was released, Rasmus Lerdorf, the creator
       | of PHP, said the performance improvements meant fewer servers,
       | smaller memory use and reduced CPU activity - all of which
       | equalled less power or electricity consumed. (And remember this
       | is an interpreted language.)
       | 
       | When you consider the millions of servers in use, that additional
       | language efficiency adds up to a substantial saving in
       | electricity use. You can watch a segment from his presentation
       | below where he talks about this, including the calculations he
       | made of potential CO2 savings:
       | 
       |  _Rasmus Lerdorf - "PHP in 2018" (extract from the 15 min mark)_:
       | https://youtu.be/umxGUWYmiSw?t=15m16s
        
       | ttiurani wrote:
       | > These eight principles form a shared understanding of what it
       | means to be a Green Software Engineer independent of: Application
       | domain, Industry...
       | 
       | Let me stop this right there. We as software engineers have to
       | stop turning a blind eye to the impacts of the actual businesses
       | our code is for. It isn't "green software engineering" if the
       | businesses we are helping are by design net negative for the
       | environment.
       | 
       | Don't help the ad industry create more needs that don't increase
       | well-being, either directly by working for them or via
       | monetization of some other service. Don't work for surveillance
       | capitalists. Don't build software for industries selling vanity
       | commodities or ones that are based on planned obsolesence. In
       | general, make sure the purpose of your code isn't to accelerate
       | overconsumption.
       | 
       | After that is taken care of, these are solid points.
        
       | ericb wrote:
       | I wonder if this might be penny wise and pound foolish.
       | 
       | Hypothetically, if it takes even a single week longer to make
       | code much more efficient and only 20% of that workforce is
       | driving to work, making coffee, running their laptops, etc, do
       | you come out ahead?
        
         | throwaway894345 wrote:
         | Unless we have systemic change (e.g., border adjusted carbon
         | tax), anything we try to do as individuals is going to be penny
         | wise and pound foolish. Most of our carbon footprint comes from
         | industry (including transporting goods). Much of that
         | presumably comes from our trade with China both in terms of
         | their lax pollution laws and then transporting goods across the
         | Pacific. None of that is going to change unless we stop
         | pretending that pollution is free, which is to say we need to
         | pass some carbon pricing scheme so that companies have an
         | incentive to reduce the amount of pollution in the goods they
         | sell us. Greener items will inherently be _cheaper_ , and it
         | will give local manufacturing a competitive advantage (bringing
         | back jobs).
        
           | adrianN wrote:
           | Not buying stuff you don't need and the like are measures and
           | individual can take that don't have hidden carbon downsides.
        
             | throwaway894345 wrote:
             | But they don't even amount to a rounding error. It might be
             | a big personal sacrifice to give up your SUV or meat or
             | whatever, but you shouldn't delude yourself into thinking
             | you're doing anything for the environment because it's not
             | even a drop in the ocean. It's literally negligible,
             | immeasurable, etc. The only thing we can reasonably do is
             | lobby our legislators for carbon pricing, including giving
             | or volunteering with http://citizensclimatelobby.org.
             | 
             | All of the lifestyle changes we make that give us the warm
             | fuzzies won't make a difference and certainly won't get us
             | where we need to be with respect to global temperature
             | change.
        
               | lupire wrote:
               | I'll play that game.
               | 
               | First, > It might be a big personal sacrifice to give up
               | your SUV or meat or whatever.
               | 
               | No, it's not. It saves money and makes you healthier.
               | 
               | > lobby our legislators
               | 
               | Has such a tiny percent chance of success that it's
               | effectively just a drop on the ocean. If enough people (a
               | majority!) cared that they convinced legislators, then
               | that same majority could have a substantial effect by
               | buying less junk.
        
               | adrianN wrote:
               | You are right of course, I also don't think that
               | individual action is terribly meaningful. I just wanted
               | to address the "penny wise, pound foolish" part.
               | Fractional pennies can be saved by individuals without
               | expending pounds of carbon elsewhere.
        
             | scoopdewoop wrote:
             | Shaming individuals for consumption confuses the political
             | reality around us. It does nothing to actually bring about
             | material change, and distracts from the real causes.
             | Besides that, its tedious and rude.
        
         | hinkley wrote:
         | The XKCD comic on these needs a separate column for open
         | source.
         | 
         | If thousands of companies are using my library, then there
         | really is a case to be made for making it as efficient as we
         | can within the bounds of maintenance concerns.
        
           | ericb wrote:
           | I think the multiplier is a good point and adds an
           | interesting dimension to this question.
           | 
           | For example, a SaaS app with mainly one running instance has
           | a really low multiplier vs. a popular open source project.
        
         | zokier wrote:
         | More directly how many cpu hours are needed to be saved to
         | compensate for the carbon footprint of a single SV engineer?
         | I'm guessing that a lot.
        
       | guilhas wrote:
       | So no more Electron apps
        
       | exdsq wrote:
       | Does this really matter to a "normal" software engineer? Or is
       | this something that only really matters to the cloud engineers at
       | AWS and the hardware engineers at Intel? I'd like this to be real
       | but I'm sceptical it's just fluff.
        
       | kodah wrote:
       | This reads like the ultimate goal is writing computationally
       | efficient software. The key tool to measuring non-performant code
       | would be asymptotics and specifically Big Omega and Big Theta,
       | because you need to shrink the total window size as well as shift
       | it _down_. Engineers hate being evaluated on whether they know
       | Big O, much less we hardly test on Big Theta. Secondary to that,
       | it 's increasingly difficult to find engineers who even have a
       | general mastery of asymptotics and algorithmic efficiency.
        
       | jillesvangurp wrote:
       | Instead of micromanaging performance and energy usage; use data
       | centers that use clean energy. It's dirty energy that we need to
       | stop using. Clean energy, we should feel less constrained about
       | (without wasting it obviously). Long term when we have a surplus,
       | it shouldn't matter how much we use. Short term, increased demand
       | actually grows the renewable supply mostly because that is the
       | cheapest way to meet that demand. The more renewables, the less
       | economical non renewable becomes. So, not all energy usage is
       | bad.
       | 
       | Most of the big cloud providers already are implementing agendas
       | to become sustainable:
       | 
       | - https://sustainability.aboutamazon.com/environment/the-cloud...
       | AWS is planning to be carbon neutral by 2025
       | 
       | - https://cloud.google.com/sustainability, Google claims to be
       | carbon neutral now but are also planning to switch to 100%
       | renewable energy by 2030. I guess they are planting trees or
       | something.
       | 
       | - https://azure.microsoft.com/en-us/global-infrastructure/sust...
       | Azure is planning to using 100% renewable energy by 2025
       | 
       | Otherwise, maybe optimize your cost with cloud usage and
       | indirectly save some energy. If you don't need it and it's
       | running, it's costing you and the planet something. So, win win
       | if you fix that. Also, as MS helpfully suggests, on premise is
       | way more inefficient than their solution. While that is somewhat
       | self serving, it's also probably true. If you us on premise,
       | maybe consider picking your energy supplier more carefully.
       | 
       | I guess, in the future, having strong guarantees from suppliers
       | about sustainability could potentially mean advertising your own
       | sustainability. Few companies do this right now. But it's
       | potentially a big deal when your customers start appreciating, or
       | better, demanding that you run your business sustainably. Right
       | now, few companies care about this. It's a mindset change that
       | needs to happen.
        
         | lwouis wrote:
         | There is no such thing as "clean energy". Energy always entails
         | environmental impact. As an example, a wind turbine has large
         | environment impact:
         | 
         | * During its production: mining to get the metals, heavy metal
         | work like making steel, cement, resins, etc. Digging large
         | mines, driving trucks all around with heavy materials
         | 
         | * During its operations: noise, visual pollution, often
         | destroying wildlife sites as people don't want them close to
         | their living areas
         | 
         | * After its operations: mostly unrecyclable, composite
         | materials like resins, cement; often burried/landfilled
         | 
         | > Google claims to be carbon neutral now but are also planning
         | to switch to 100% renewable energy by 2030. I guess they are
         | planting trees or something.
         | 
         | I think this is a good representation of what the common person
         | think. "They must be dealing with the pollution issues, right?
         | Trees, hydrogen, electric cars, it's all going to be ok,
         | right?".
         | 
         | Start looking up data on this topic, and prepare for a deep
         | dive into how no-one is actually doing anything significant
         | about it, while calling everything green. No-one is "carbon
         | neutral". It's complete marketing / green-washing. Google
         | footprint on our ecosystem is large.
        
           | iamstupidsimple wrote:
           | > During its operations: noise, visual pollution, often
           | destroying wildlife sites as people don't want them close to
           | their living areas
           | 
           | The UK's mostly solved this by putting turbines a couple
           | miles off the coast. And the benefit of having that renewable
           | energy vastly outweighs the environmental impact of "noise".
        
           | mdp2021 wrote:
           | I was similarly surprised when I read about a few ecological
           | downsides of solar power.
           | 
           | What is the best material you found on "full comprehensive
           | costs (including downsides and externalities) of energy
           | sources"?
        
             | snoopx31 wrote:
             | You can try talks from this guy, he's a french energy and
             | climate expert. I found that he explained very well the
             | root of the issue between growth, energy and climate
             | impact.
             | 
             | Here is a talk he did for the MIT media lab in english:
             | https://youtu.be/s254IPHXgVA
        
       | yitchelle wrote:
       | Worked on a project where if our product exceeds a power
       | consumption threshold, we would be penalised financially. x
       | dollars per kilowatt per month per instance. It adds up fast!
        
       | marsven_422 wrote:
       | Sounds like something for the diversity hires.
        
       | sylvainr65 wrote:
       | I don't follow. We wrote fax softwares that eliminated the need
       | to buy a fax. We wrote accounting softwares that eliminated the
       | need to have hundred of accountants to get to the office every
       | day, using cars! We wrote softwares that eliminated the need to
       | sell and buy physical encyclopedias, dictionaries, watches, photo
       | albums, typewriters, books, compasses, maps, calculators,
       | tickets, cameras, VHS, calendars, answering machines, telephones,
       | flashlights, radios, newspapers, agendas, snail mail, sound
       | systems, physical money. We wrote softwares that get anything
       | delivered to your door without having you getting in your car and
       | spending hours in 3 physical stores. We wrote softwares that make
       | it possible to share your neighbor car for a little fee. We wrote
       | softwares that can assess climate changes effects.
       | 
       | To me, softwares are the greenest inventions ever.
        
       | Terretta wrote:
       | Computational efficiency is great, but Principle 6, "Reduce the
       | amount of data", is out of place. Where data is information and
       | informed decisions are better decisions, less data results in
       | worse decisions and inevitably more energy usage down the line.
       | So something is wrong or some qualification is missing in this
       | phrase.
       | 
       | Also note that people are carbon so I read Principle 1 as reduce
       | the amount of people (seats and time) it takes to make the
       | software and make the apps quick to use so people don't waste
       | time waiting on them.
        
       | OscarCunningham wrote:
       | If only we had a carbon tax, these could all be replaced with
       | 'save money'.
        
         | throwaway894345 wrote:
         | I often feel that all of these "personal responsibility"
         | initiatives are distractions from passing a carbon tax as well.
         | Polluters have a long history of campaigning for personal
         | responsibility solutions so they can continue polluting (going
         | back to the "Crying Indian" ad in the 70s). Of course I think
         | everyone should lower their carbon footprint, but we're never
         | going to come close without carbon tax and border adjustments.
         | Of course if you're writing your legislators regularly to
         | advocate for a carbon tax _and_ writing Green Software or
         | eating vegan or whatever, then great, but by far the best use
         | of your time is contacting your politicians.
         | 
         | Similarly, I suspect polluters love the Democrats' climate
         | policy or even the Green New Deal which would have tax-payers
         | spend _trillions_ on programs that are tenuously related to
         | climate ("climate justice") rather than inhibiting polluters or
         | making them foot the bill. Don't get me wrong, I don't think
         | the Republicans would do better, but it's really hard to see us
         | spend trillions and not take climate seriously, all the whole
         | smugly bragging about how _we're the ones who believe
         | scientists_.
        
         | davidw wrote:
         | I think this is the right answer. Otherwise, there are just too
         | many variables to juggle.
        
       | fnord77 wrote:
       | I've been having the same so of thoughts for a few years. glad
       | someone is writing this down.
       | 
       | so many inefficient systems/languages/algorithms are being used
       | at scale, it is really disheartening. For instance, Python is the
       | Ford F250 double cab dually of the software engineering world.
        
       | krono wrote:
       | None of the websites or posts on this topic that I've come across
       | contain any numbers.
       | 
       | Would it really make a difference for the average project? Honest
       | question.
        
         | jasoncabot wrote:
         | https://lowimpact.organicbasics.com/eur
         | 
         | Is an example website that I enjoyed that shows you how much
         | carbon you're effectively saving by viewing their low impact
         | version for each request.
        
           | pelasaco wrote:
           | "We use cookies to save energy, reduce data transfer and
           | gather statistics."
        
           | mk89 wrote:
           | That's a really interesting product/website. I just looked
           | at:
           | 
           | https://lowimpact.organicbasics.com/eur/collections/all-
           | mens...
           | 
           | You have to click on the images to actually see the real
           | clothes you'd like to buy. I understand green/eco but I
           | wonder who would ever use a website like this to buy any kind
           | of (physical) goods? It kills entirely the UX and obviously
           | it saves the company money in terms of cpu/memory/bandwidth
           | used.
           | 
           | What about the costs of me having to go back and forth to see
           | all the items one by one, therefore triggering more pages
           | views? What about the mobile experience?
        
           | krono wrote:
           | Thanks, that's a very interesting resource.
           | 
           | I browsed around for about 5 minutes and apparently saved
           | 153.74g. A Dutch person's average yearly emissions mount to
           | about 9 metric tonnes.
           | 
           | Very.. very roughly that's 15% of my hourly emissions.
           | 
           | Considering I'd be very unlikely to order from a website like
           | this, just imagine what we're saving on logistics in addition
           | to that! :)
           | 
           | Joking aside, the impact is infinitely larger than I had
           | expected. It could also be that my quick math is off.. I'll
           | have to check later.
        
       | agustif wrote:
       | Go solar, or go home
       | 
       | https://solar.lowtechmagazine.com/es/2020/08/how-sustainable...
        
       | mfer wrote:
       | I'm reminded of the waste many CI sets do. Where they download
       | the same set of dependencies at the same versions for each run.
       | No effort put into caching thing.
       | 
       | There is so much bandwidth used because of that (I've seen the
       | numbers for some projects and it's HUGE).
        
         | hinkley wrote:
         | I have to turn off caching because it doesn't play well with
         | our JFrog cache.
         | 
         | JFrog gets the artifacts on premises, but causes issues trying
         | to get them to the build agent. The opportunity costs of having
         | false negatives and positives from CI builds are simply not
         | worth it.
        
       | PoissonVache wrote:
       | My mom keeps bothering me to turn off the light before I leave
       | home while any of the Youtube video she watch costs as much
       | energy as keeping my light on for days/months. If only people
       | were more aware of the energy cost of Internet.
        
         | hinkley wrote:
         | The power budget on big screen TVs has snuck up on people and
         | doesn't get enough air time.
         | 
         | In many houses the TV is using more power than the fridge, and
         | in some cases more than your old fridge did.
         | 
         | My partner also complains about lights or leaving the fridge
         | door open while I fetch food or drink from several containers,
         | but then leaves the TV on counting on it to turn itself off (in
         | an hour).
         | 
         | I think I'm going to have to explain conductivity and heat
         | capacity, and remind everyone that I replaced all of the lights
         | in the house with LEDs (some of which were goddamned
         | expensive).
        
         | pjc50 wrote:
         | I'd want numbers for that; youtube is fairly efficient,
         | especially on a mobile device.
         | 
         | Coincidentally I found a thread recently (in French) claiming
         | that it was more energy-efficient to watch Netflix than
         | broadcast TV:
         | https://twitter.com/pbeyssac/status/1439977593315512320
        
         | oytis wrote:
         | Now I feel really old, but your mom probably remembers time
         | when a bright lightbulb would consume twice as much energy as a
         | modern laptop (which was like 10-15 years ago)
        
         | Torwald wrote:
         | Correct me if I am wrong, but I think saving energy is the
         | wrong overall way to go. Better is to be 100% renewable (or
         | otherwise "green") when generating energy, so that consumption
         | ceases to be an issue.
        
           | burkaman wrote:
           | The right thing is to do both, because we don't have time to
           | relax and wait for the grid to be 100% renewable. Using less
           | energy means we can convert the grid more quickly.
        
       | throwaway2016a wrote:
       | It seems most of these boil down to: build more efficient
       | software.
       | 
       | Software that is more efficient with the network and CPU is also
       | cheaper to run. So the incentives are generally aligned. When I
       | deploy a system I want it to run on 5 servers not 50 for cost
       | reasons not because I'm being green. If I'm being green by
       | accident, that's a bonus.
       | 
       | I'm glad on the "measure" side it gives examples of how to
       | measure (though I can't vouch for how good they are).
       | 
       | But really, as a web app developer (which is most of HN, I think)
       | this doesn't apply "too" much beyond just increasing hardware
       | efficiency which you'll want to do anyway. It intuitively seems
       | graphics and GPU heavy apps are the biggest offenders.
        
         | BoxOfRain wrote:
         | I do wonder how many kW of power things that HN generally
         | disparages as bloated (Electron being the main one people talk
         | about) actually adds up to versus more efficient technologies?
        
           | musingsole wrote:
           | If the result or information presented by the most
           | horrendous, energy inefficient, blockchain-backed, cloud
           | replicated app results in a SINGLE person NOT traveling for a
           | weekend, the carbon savings would completely demolish any
           | cost for the software overhead.
           | 
           | /Devil's Champion Argument Incoming/: Facebook's part in
           | effectively coordinating most people in most parts of the
           | world to stay home during the pandemic has probably weighted
           | their carbon ledger forever into the black. Or at least 5
           | years of dedicated bitcoin mining.
           | 
           | These green engineering ideas are interesting but taking them
           | seriously would be the epitome of engineers optimizing the
           | wrong thing.
        
             | horsawlarway wrote:
             | I agree 100%.
             | 
             | Reading through this thread has me damn well convinced that
             | most folks have _zero_ idea how much power things in their
             | homes use.
        
               | BoxOfRain wrote:
               | It's interesting, I've been planning to move onto a
               | sailing yacht for a while and part of the planning
               | process has involved figuring out an energy budget which
               | will inform what batteries and charging equipment (solar
               | panels etc) are required to run a WFH (WFB?) setup. I
               | bought a simple plug-in power meter and I was very
               | surprised by the power usage of some things in my life!
        
           | [deleted]
        
           | hinkley wrote:
           | One of the elephants in the climate crisis room is coming to
           | grips with how many watt-hours are appropriate to spend on a
           | task that could be completed with human power alone.
           | 
           | As Denis Leary used to joke, we have exercise machines that
           | mimic normal activities which we refuse to do, so we are all
           | turning into hamsters. Maybe instead of a leaf blower I need
           | a broom with a better design and just count the cardio I'm
           | going go get against my budget for the week.
           | 
           | Maybe, as some people argue, getting down and looking at my
           | plants closely avoids me having to spray fossil-derived
           | chemicals on them based on incomplete information. It's a
           | matter of perspective on whether that time is quality or just
           | a chore. Some cultures elevate certain chores to an art form.
           | Japanese gardening is but one example in one niche in one
           | cultural group, but there are many others.
        
           | throwaway2016a wrote:
           | That's a good point I didn't think of. And one that I think
           | also applies to a lesser extent to websites. It is certainly
           | possible to build a website that makes Chrome use a lot of
           | CPU and network data.
           | 
           | I still think it applies mostly to graphics apps and things
           | like blockchain though. As bad as electron is... would be
           | interesting to measure it with those tools the website lists,
           | though.
        
             | BoxOfRain wrote:
             | Yeah my gut feeling is that Bitcoin alone trounces any
             | waste caused by Electron and badly written webapps, but
             | it'd probably still be worth measuring I think. At the very
             | least it'd be another argument on the side of "let's not
             | use Moore's Law as an excuse for writing inefficient
             | software".
        
               | pjc50 wrote:
               | Ran across this earlier today:
               | 
               | https://twitter.com/alexhern/status/1440295741835014149
               | 
               | "Something that stood out: TSMC (with 55% of the global
               | market share, per https://theregister.com/2021/06/01/q1_2
               | 021_foundry_revenue_t...) uses 5% of all Taiwan's
               | electricity, which is approx 12TWh/yr. Bitcoin's
               | electricity footprint is... 13 times that, at 164TWh/yr
               | (https://digiconomist.net/bitcoin-energy-consumption)"
        
           | sk2020 wrote:
           | I think you could end up in a quagmire of trying to calculate
           | all the secondary effects of different production strategies.
           | Maybe another GUI framework uses less power, but maybe it
           | takes more developer hours. How much power do those
           | workstations consume? And their offices or home offices? Or
           | the power consumed by hosted services they use? What about
           | the power to heat their coffee? What country are the
           | developers in and how is their power sourced? Is a kWh of
           | Chinese coal comparable to a kWh of US natural gas?
           | 
           | I don't think a commissar can correctly compute costs of
           | design and implementation alternatives, and I think
           | permitting an open market and letting prices sort this out is
           | a more viable option.
        
           | goodpoint wrote:
           | Tons, unsurprisingly. There are website energy calculators
           | around.
        
             | throwaway2016a wrote:
             | I've always been skeptical of those. Especially the ones
             | that do things like measure the brightness of the pixels.
             | For the amount of time someone tends to spend on a single
             | page it seems like optimizing just one page is like a water
             | dropper in an ocean. Whereas, say, Visual Studio for
             | instance is on my screen 6+ hours a day.
             | 
             | But maybe my next web app I'll take that into
             | consideration.
        
               | goodpoint wrote:
               | > I've always been skeptical of those.
               | 
               | CPU usage is a very accurate proxy of energy usage.
               | Second to that, network traffic.
               | 
               | Simply ignore pages that use poor metrics.
               | 
               | > Whereas, say, Visual Studio for instance is on my
               | screen 6+ hours a day.
               | 
               | ...and some people have private jets, but this is
               | whataboutism.
        
               | throwaway2016a wrote:
               | That second part of that comment was very unnecessary.
               | Please don't do that on HN, I even threw you a bone at
               | the end and said:
               | 
               | > But maybe my next web app I'll take that into
               | consideration.
               | 
               | Your whataboutism comment is also off base since the
               | comment you were replying to was asking about bloated
               | non-browser desktop apps so my comment is very much
               | relevant. And the parent to that comment was about
               | software efficiency. If anything you're the one off
               | topic.
               | 
               | It's fair to say: well actually they are very accurate
               | because of CPU usage. You don't have to agree with me.
               | But to result to ad hominem is unnecessary. Let's keep it
               | civil.
        
           | horsawlarway wrote:
           | I think you're firmly into the realm of diminishing returns
           | by the time you're trying to optimize code that runs on a
           | laptop that has a total power draw of 60ish watts.
           | 
           | Frankly - Using my kettle to make coffee twice a day (~15
           | minutes of runtime) is the same as running my laptop at full
           | power draw for 5 hours.
           | 
           | Just switching a single lightbulb in your house from standard
           | (~100w) to LED (~20w) more than offsets your whole laptop's
           | power usage, assuming you have lights on while working.
        
             | pjc50 wrote:
             | The laptop power draw is dynamic depending on what you're
             | doing with it, including how heavy the webpages are. But I
             | agree that heating will generally dominate domestic use.
        
               | horsawlarway wrote:
               | Sure, but I'm being exceedingly generous with 60w,
               | assuming a modern device that's about the limit of power
               | consumption. To quote phoronix benchmarks on my machine:
               | 
               | Lastly, the battery power consumption varied from about 5
               | Watts during idling and when the screen was automatically
               | dimmed to as high as 40 Watts under the most grueling
               | benchmarks. On average through under load the power
               | consumption was around 18.1 Watts.
               | 
               | https://www.phoronix.com/scan.php?page=article&item=dell-
               | xps...
        
             | anonymoushn wrote:
             | How many laptops does it run on all day, and does anyone
             | run it on desktops instead?
        
               | horsawlarway wrote:
               | Even a desktop only runs about 100w unless you're doing
               | something like gaming. Admittedly, a desktop guarantees
               | you're using another screen, so tack on 60w for the
               | external monitor.
               | 
               | You'd still be better off turning off the lights in a
               | single room, in most cases, or simply toggling the AC up
               | literally 1 to 2 degrees.
        
               | jhgb wrote:
               | If I remember correctly, my desktop runs at ~20W idle
               | (went down to 15W before I added two extra memory
               | modules) and ~70W fully loaded. That's a 50W delta per
               | eight cores, so around 7W per fully loaded core.
        
           | sseagull wrote:
           | My guess is not much.
           | 
           | However, there is also the cost of consumers needing to
           | upgrade hardware when things start getting slow again because
           | of these developer choices.
           | 
           | There's a figure floating around that if consumers kept their
           | phone for 1 more year, that is the equivalent of taking
           | 100,000s of cars off the road. Not sure how reputable that
           | study was though.
        
             | whbrown wrote:
             | That simply reflects the fact that 5.5 billion is 55,000
             | times larger than 100,000.
             | 
             | Anything you do to have even the tiniest effect on the
             | consumption of nearly the entire world's population is
             | going to have a large impact.
        
         | anyonecancode wrote:
         | > So the incentives are generally aligned. When I deploy a
         | system I want it to run on 5 servers not 50 for cost reasons
         | not because I'm being green. If I'm being green by accident,
         | that's a bonus.
         | 
         | I think that's the whole game right there -- figure out how to
         | make sure negative externalities stop being external and become
         | part of the cost. Then incentives will naturally align, as
         | opposed to being at odds. In the case of your comment, you're
         | noting they're already aligned, but overall I think many times
         | they are not.
        
           | throwaway894345 wrote:
           | Honestly, the number one thing any of us can do for the
           | climate is to contact our representatives regularly about
           | climate pricing. Absent that, we'll never slow our pollution
           | enough to stop runaway warming. Everything else is a micro
           | optimization that may even distract us from the only thing
           | that will get us over the line.
        
             | marcosdumay wrote:
             | > the number one thing any of us can do for the climate is
             | to contact our representatives regularly about climate
             | pricing
             | 
             | That's probably correct.
             | 
             | > Absent that, we'll never slow our pollution enough to
             | stop runaway warming.
             | 
             | But that's probably wrong. People managed to make non-
             | polluting energy sources more compelling than the polluting
             | ones even when the pollution is fully externalized. We will
             | probably see a huge change on the next 20 years, and after
             | that it will probably be better to focus on carbon capture.
             | 
             | What may make the first part incorrect is that focusing on
             | intervention on the energy supply to speed-up the process
             | may be more effective than focusing on intervention on the
             | energy consumption. But if I had to design a policy today,
             | I'd go almost all for the government to focus on
             | consumption (AKA pollution taxing) and basic research.
        
               | throwaway894345 wrote:
               | > But that's probably wrong. People managed to make non-
               | polluting energy sources more compelling than the
               | polluting ones even when the pollution is fully
               | externalized.
               | 
               | I don't think this is true. In particular, while the
               | price is lower for "non-polluting", we still don't have
               | an answer for clean base load generation (well, we do--
               | nuclear--but that seems to be off the table). Even
               | ignoring the storage problem, I don't think we
               | (Americans) are on track to power our entire economy with
               | renewables by 2050. We'll probably be able to meet our
               | current _electricity demand_ with renewable energy by
               | 2050, but we also need to electrify almost every other
               | sector in our economy--most notably transportation--which
               | means we need to generate a whole lot more electricity
               | than we do today.
               | 
               | Also, if wealthy countries don't implement any kind of
               | border adjustment, we'll just keep outsourcing our
               | pollution to the likes of China who will happily keep
               | burning (ever cheaper) oil.
        
           | pjc50 wrote:
           | In particular, there are all sorts of incentives for adtech
           | to burn CPU on the _client_, which doesn't cost them
           | anything. It's entirely possible to burn 0.1cent of
           | electricity to earn 0.001cent of ad revenue.
        
             | londons_explore wrote:
             | Adtech as a whole totally earns far more revenue than the
             | electricity cost to run all that client side javascript.
             | 
             | Slow ad loading costs them more in lost revenue than the
             | electricity used, so the incentives are still aligned.
        
               | pjc50 wrote:
               | I don't think this is proven either way. The only
               | research I am aware of is
               | https://ris.utwente.nl/ws/files/5095958/Hidden-Energy-
               | Costs.... which puts ads at about 3.4% of PC web browsing
               | energy use, but that's not a financial number.
        
               | bcrosby95 wrote:
               | They put ads at requiring an extra 2.5w of energy. You
               | can use that to directly calculate the cost from your
               | local electricity rates.
               | 
               | For me, the calculation is: 2.5w / 1000 * 28 cents = 0.07
               | cents per hour.
        
         | jiehong wrote:
         | This only applies if you are the one running your own software.
         | 
         | Websites are often offending, because they are run by the
         | clients, so it matters less: they get bigger, with more
         | JavaScript, maybe hosted far away, etc.
         | 
         | I know of Website Carbon Calculator[0] that can put a number on
         | this for a given site.
         | 
         | [0]: https://www.websitecarbon.com
        
         | bluGill wrote:
         | You have options as a developer. Instead of
         | python/php/perl/ruby (and hundreds of others most of which I
         | don't know) you can write your server side code in
         | C/C++/rust/ada/ (again hundreds of others). You will spend a
         | lot more energy compiling and debugging your code up front, but
         | in the long run you will use less energy on all the server. But
         | will you - every time you roll out an update there are a lot
         | more compiler hours on the developer machines, and less on the
         | server time to amortize it over.
         | 
         | Note that I didn't list managed languages like Java or C#. It
         | isn't clear where they fall - they tend to defer a lot of the
         | CPU until after the user work is done (garbage collection for
         | example). I don't know if anyone has done any fair analysis on
         | this so I'm going to leave it as an exercise for the reader.
        
         | mfer wrote:
         | I think there's something missing here. In how we operate
         | applications.
         | 
         | It's not unusual to run an application on a server where that
         | server is using only 25% of its resources (e.g., ram and/or
         | cpu). Then, there are many different servers running many
         | applications all of which are under utilized.
         | 
         | There are more efficient ways to operate these applications
         | that drive up power efficiency. Google brags about the power
         | efficiency of their data centers[1]. They do a bunch of things
         | worth copying.
         | 
         | There are ways to operate software better... not just develop
         | the apps themselves.
         | 
         | [1] https://www.google.com/about/datacenters/efficiency/
         | 
         | edited to add missing link
        
           | hinkley wrote:
           | Pre-cloud it was always pulling teeth to get new hardware
           | provisioned. You had to get past the guy who has realized his
           | only power is saying no by refusing to write checks, and then
           | you have to get IT to provision the box, and there may be
           | physical layout issues that complicate doing that in the best
           | way possible.
           | 
           | It's very common for someone to take all of those servers
           | using 25% and do manual bin-packing with them. It's also
           | common for changing features and customers to alter the
           | resources needed after the manual process is completed,
           | leading to further rounds of bin packing.
           | 
           | And every time you relocate services or hardware, there's a
           | chance for an outage. That can become a wall you can't climb
           | or cost you social capital every time it happens.
           | 
           | My general impression of Kubernetes is it's trying to solve
           | that social problem with technology. We know how that usually
           | goes, but any port in a storm, right?
        
           | throwaway2016a wrote:
           | Most companies don't have control over their data centers
           | (except to maybe use energy efficiency as a selection
           | criteria). But you have a point about CPU.
           | 
           | But regarding incentive alignment, making those data centers
           | more efficient is not just more green but also saves the
           | companies a boatload of money.
           | 
           | Since cloud providers don't charge extra for your utilization
           | percentage I've always told my teams: if the CPU is running
           | cold either the software can use it more efficiently or we're
           | overpaying by renting more capacity than we need.
        
             | mfer wrote:
             | A lot of companies still have control their data centers or
             | some portion of them. At least to an extent to control how
             | things are scheduled on hardware.
             | 
             | Kubernetes is similar enough to Borg (the
             | datacenter/cluster OS that Google uses) to efficiently
             | schedule workloads over a cluster. There are ways to use it
             | anyplace one has a cluster for that purpose. This is just
             | to provide an example.
        
               | throwaway2016a wrote:
               | I agree, you can architect your system to make better use
               | of hardware for sure.
               | 
               | What I meant was: I can't tell AWS to make more efficient
               | power switching or design an ASIC that is lower power.
               | Best I can do is say that if they don't I'll move to
               | another provider.
               | 
               | It's been a long time since I've worked with a company
               | with any significant number of physical racks they
               | rent/own where they can put their own hardware on them.
               | Though, I admit, I may be suffering bias here and it
               | could be they are more common and I just happen to work
               | with companies that are cloud based.
               | 
               | Edit: I used to work for Lycos in the mid 2000s and we
               | were just starting to do that (run our workload on VMs
               | instead of metal so we could make all the servers multi-
               | tenant. That was the last time I've worked with a
               | physical server and the Lycos network (across all their
               | sites) was the equivalent of a top 50 website at the
               | time.
        
               | lupire wrote:
               | > What I meant was: I can't tell AWS to make more
               | efficient power switching or design an ASIC that is lower
               | power. Best I can do is say that if they don't I'll move
               | to another provider.
               | 
               | Sure, but Amazon is already doing that, because more
               | energy efficient hardware is more profitable for them,
               | since they'll save on electricity they aren't charging
               | you for. Even without a competitor, they'd be
               | incentivized.
        
       ___________________________________________________________________
       (page generated 2021-09-22 23:03 UTC)