In the field of technology, 2021 is a special year. This year is the 15th anniversary of the establishment of Amazon Cloud Technology. It all started with Amazon S3, the object storage solution of Amazon Cloud Technology. In the past 15 years, we can see that cloud computing has changed the world. And more and more customers are migrating their business to the public cloud, starting the digital journey of the enterprise.

In the next ten years, the development of cloud computing will be a process of continuous expansion and continuous iteration. At the same time, "sustainable development" has become one of the themes that must be considered by global, national and various companies. As the world's leading technology company, Amazon Cloud Technology is also constantly exploring the sustainability of technology. From infrastructure to software design, there is a set of bottom-up forward-looking solutions to achieve it.

As the vice president of sustainable development architecture of Amazon Cloud Technology, Adrian Cockcroft delivered a keynote speech at the Dev Day of the Amazon Cloud Technology China Summit on September 11, explaining the sustainable development strategy of Amazon Cloud Technology. More importantly, he learned from The developer’s perspective explains how Amazon Cloud Technology conducts sustainable software engineering practices, and we can get a lot of inspiration from it.

Why should we pay attention to "sustainable development"

Sustainable Network Declaration: If the Internet is a country, then the carbon dioxide emissions it produces will rank seventh in the world.

The United Nations formulated a global framework "Paris Agreement" in 2015, and then each of the contracting parties has formulated a "carbon neutral" path and goals, making commitments to the healthy development of the earth's environment. During the two sessions this year, China also included "carbon neutrality" and "carbon peak" in the government work report, with the goal of achieving "carbon peak" by 2030 and "carbon neutral" by 2060. There is no doubt that sustainable development has become a self-evident social consensus. However, under the social consensus, the participation of various social subjects such as individuals, enterprises, and governments is also needed-among which large-scale technology companies are the most important participants.

There are currently more than 4.6 billion Internet users worldwide. With the increase in Internet penetration, the Internet will soon generate nearly 1 billion tons of carbon dioxide, which is equivalent to 10% of the world's electricity consumption. The amount of energy required to power data centers doubles approximately every four years. In terms of carbon emissions, the ICT industry has contributed 2-6% since 2007, almost the same as the aviation industry.

The good news is that although ICT and cloud adoption have grown exponentially, energy use and carbon emissions have remained relatively unchanged, as the hyperscale data centers of mainstream cloud providers are significantly improving efficiency. Accenture's analysis shows that if green methods are adopted to migrate to the public cloud, global carbon dioxide emissions can be reduced by 59 million tons per year, which is equivalent to reducing the carbon emissions of 22 million cars with your fingers!

In China, Internet technology companies are also increasing their efforts to invest in carbon neutral transformation. In August this year, the international environmental protection organization Greenpeace (Greenpeace) released the Chinese technology giant's "Green Cloud 2021" rankings, which combed the climate actions of Chinese Internet technology companies in terms of energy information disclosure, energy conservation and carbon reduction performance, and renewable energy. Compared with last year, the overall average score of Chinese Internet technology companies rose by 11%. At the Amazon Cloud Technology China Summit Dev Day on September 11, Adrian Cockcroft said that Amazon Cloud Technology has achieved remarkable results: Amazon Cloud Technology’s infrastructure energy efficiency is 3.6 times higher than that of ordinary US corporate data centers. At the same time, Amazon Cloud Technology can reduce its carbon footprint by 88% when performing the same tasks.

This is the result of a variety of factors. Adrian Cockcroft described several effective paths that Amazon Cloud Technology has explored to build green cloud services.

  • The first is the protection of water resources. Amazon Cloud Technology uses evaporative cooling, recycles water, and treats water on-site as much as possible.
  • The second is to purchase renewable energy. Amazon Cloud Technology is now the largest buyer of renewable energy in the United States and Europe.
  • The third is to remove the traditional uninterruptible power supply (UPS), and instead use a small battery combination custom power supply integrated in each rack. In the past, there was some power loss in the voltage and DC/AC conversion every time. By removing the traditional UPS, optimizing the rack power supply, reducing the final conversion and other measures, the energy loss was reduced by about 35%.
  • The fourth is to explore innovative server design. The central processing unit is the most power-consuming part of modern computers. Amazon's own-developed Amazon Graviton 2 processor based on the ARM architecture has a performance per watt that is 2 to 3.5 times higher than other industry standard processes.
  • The fifth is to increase the use of low-carbon concrete in the construction of new data centers, which can reduce the carbon emissions of new buildings by 25%.

Sustainable Software Engineering Practice

Many people may think that migrating to the cloud is enough and neglect to optimize internal efficiency. In fact, every workload that is migrated to the cloud consumes energy, and some tasks are particularly power-intensive, such as computing-intensive AI or ML services. A study of natural language processing models illustrates the severity of the problem. The study shows that training an NLP model generates carbon emissions equivalent to 125 round-trip flights from New York to Beijing.

Another study quantified the carbon footprint of watching YouTube videos, which is equivalent to the carbon dioxide emissions of a small city. The study also pointed out that if 25% of music videos are modified to play in the background, then 323,000 tons of carbon dioxide equivalent can be saved a year, which is equivalent to the annual emissions of 50,000 cars. Professor Chris Preist, one of the members of the research team, emphasized: "A person has a small impact on the environment, but when you add up global services, they may have a significant impact."

It is the same for us technical people. When the "green" code is deployed on thousands or even hundreds of millions of devices, the energy-saving effect will be huge, so everyone is responsible for ensuring our Technology can be more "sustainable."

So what can we do as developers?

Sustainable software engineering is an emerging field, but the exploration of Amazon Cloud Technology can give us some inspiration. In his speech, Adrian Cockcroft described how to implement sustainable engineering from the aspects of code efficiency, platform deployment, and software application design. InfoQ Some of the developer-related parts have been extracted for readers.

Play the role of open source

If we consider optimization on the cloud, open source is a good way. Many of the algorithms we are using are not very efficient, but fortunately, there are more efficient open source alternatives that every developer can use.

JSON documents are ubiquitous on the Internet, and servers spend a lot of time parsing these documents. Developers hope to use common SIMD commands as much as possible to speed up the parsing of JSON while performing full verification (including character encoding).

There is an open source JSON parser simdjson on GitHub. Through comparison experiments with other commonly used parsers, the results show that the parsing speed of simdjson reaches 2.2 GB/s. Compared with other parsers, simdjson only uses a quarter or less instructions, and can be used on many different platforms and languages.

This parser is open source in 2019, but Amazon Cloud Technology has used simdjson to process a large amount of JSON. Adrian Cockcroft concluded that the effect is amazing.

Another example is about compression. Many times, we need to compress log files to store gigabytes or tens of gigabytes of data in a compressed format. Gzip and similar algorithms have been popular as widely used formats for a long time, but now there is a new algorithm called Z-Standard developed by Facebook. This algorithm can not only use less CPU for compression, but also achieve a higher compression rate. The compressed file is only 60% of the gzip file size. For a single small file, compression to this level may be dispensable, but when you have to deal with thousands or ten gigabytes of data, this makes a big difference. You can traverse and recompress it. Free up a lot of data space.

This is some simple things developers can do: find other more effective algorithms to replace the inefficient algorithms in the program.

between peak and carbon footprint

There is usually a spike when the workload is running, so we need to provide a capacity higher than the expected peak. However, the carbon footprint does not depend on the average usage of the system, or even the peak usage of the system. The carbon footprint depends on the system reserved. capacity. And we often need to prepare a lot of resources for such "peak" moments.

Therefore, one of the ways to reduce the carbon footprint is to ensure that the load peaks are dispersed and avoid such spikes. Even if the average utilization rate is the same, the amount of work completed is the same, but by reducing the peak value, the reserved capacity can be reduced.

The other is to configure the running of timed tasks. For example, the Crontab task that runs at midnight every day, many people use it to set up batch jobs or perform daily summaries of data warehouses. When each customer runs synchronous workloads at the same time, these synchronous jobs increase the peak workload. This actually increases the demand for Amazon cloud technology, because we must provide greater capacity to handle the peaks caused by these concurrent tasks.

However, if the whole point can be avoided and the offset or jitter can be properly arranged, the peak of concurrency can be avoided. And there is no need to pay extra, because your workload has not changed. Because the available resources at peak times are more tight, if you can avoid the peak, when resources are not so tight, your tasks may run faster as a result.

In general, one of the ways to reduce the carbon footprint is to balance service level agreements and sustainability commitments, for example, to slightly lower expectations. We know the twenty-eight law, if you need to improve performance by 20%, then the effort involved in the 20% performance improvement usually accounts for 80% of the overall workload. There are quite a lot of algorithms or businesses that have such trade-off comparisons. For example, when the service level agreement stipulates that the response time is 500 milliseconds, as long as it still meets the requirements of the service level agreement, there is no need to use the 100 millisecond response time to over-complete the work.

There is also a high-availability configuration. If you have a hot standby system waiting for failover, you can use a cold standby or warm standby system for failover within the service level agreement. The time required to start from the cold standby may actually be different. It will take much longer than warm or hot standby. High availability always has to pay additional costs and additional carbon costs, so we can use these trade-offs to reduce our carbon footprint.

Use

Serverless is another excellent way to reduce your carbon footprint.

Serverless computing refers to applications running on demand in a remotely hosted execution environment. In the past few years, building resilient serverless systems has been the main focus of system administrators and SaaS companies. The key advantage provided by this architecture is that the serverless model does not require the user to maintain the operating system. It only needs to generate common code, upload it to the serverless framework, and watch it run.

Therefore, users can choose hosting services, use Amazon Lambda to perform all management tasks of computing resources, and can associate platform configuration scaling tasks. For example, programs such as instant scheduling can shut down all test environments when the computer is not in use, and wake up only when needed. This is an extremely powerful way to reduce energy consumption and the cost of operating the system. One of the things that can be achieved is to release idle hardware so that others can use it at the same time, which can reduce the overall capacity required for the operation of Amazon Cloud Technology. Will not affect the user's actual work.

Therefore, a powerful way to build a more sustainable architecture is to switch to serverless, shift workloads to cloud services, and then choose services and instance types that minimize energy usage.

finally

To implement sustainable software engineering, we can proceed from top to bottom. First, measure the carbon footprint of the entire enterprise from a management perspective, transfer workloads from data centers to cloud areas, change usage patterns to avoid dirty energy development, and then choose Types of services and instances that minimize energy usage. Going deeper into more details and optimizing workloads to increase utilization, we can distribute timing tasks, reduce load peaks, and achieve the purpose of adjusting CPU usage efficiency.

What’s important is that optimization is not just about considering a certain place. We need to think about it at the architecture and system level. Adrian Cockcroft also said that Amazon Cloud Technology is training sustainable development solution architects to help everyone carry out sustainability. Evaluation of sexual architecture. Work on the basis of the shared responsibility model of sustainable development, minimize energy consumption, maximize the workload of each resource consumption, shift to more power-efficient shared services, and continue to improve by sharing knowledge.

At the end of the speech, Adrian Cockcroft issued a "call to action": every developer can understand the terms and principles related to "sustainability" from now on, look for opportunities to optimize the load at work, and open source their own Experience and plan, through "sharing", promote everyone to achieve the goal of "sustainable development" together.

activity recommendation:

At the Shanghai station of the QCon Global Software Development Conference held on October 22 this year, we set up a special Amazon cloud technology session, with sustainable development technology as the core. The four top experts will start from Four aspects of "serverless architecture", "playing the role of open source", and "cloud machine learning boost" will be shared to take everyone to explore the next journey of software development.


Come and scan the code to participate 👆


亚马逊云开发者
2.9k 声望9.6k 粉丝

亚马逊云开发者社区是面向开发者交流与互动的平台。在这里,你可以分享和获取有关云计算、人工智能、IoT、区块链等相关技术和前沿知识,也可以与同行或爱好者们交流探讨,共同成长。