SlideShare a Scribd company logo
1 of 44
qaware.de
The Path to
Green Enterprise Applications
Sascha Böhme
sascha.boehme@qaware.de
Once upon a time, there was a service …
QAware | 2
Our challenge
QAware | 3
Digital transformation produces further
services that are constantly running
IT provides value to
business and customers
IT enables new,
previously unthinkable
business models
How to limit the
increase in energy
consumption?
How to limit the
rebounce effect?
This bad-case prediction lacks changes that are
currently unknown, yet is a good warning sign
QAware | 4
QAware | 5
A personal perspective
Advantages in using Payara
● in use since many years
● well understood
● proven
● stable
● standardized
● full of functionality
● few surprises
QAware | 6
Drawbacks in using Payara
QAware | 7
● long start times
● long turnaround times
● moderate performance
● high memory consumption
● large container images
● little documentation besides
standards
QAware | 8
Should we continue that way?
Or should we rather
try new paths?
QAware | 9
“If your service is too slow, re-implement it in Go”
QAware | 10
Go:
● fast
● small
● easy to learn
● widely applied in the cloud-native
world
“Use Quarkus to build fast and lightweight applications”
QAware | 11
Quarkus:
● close to JakartaEE
● regular innovations
● rich documentation
● native executables
“You’d be stupid not to switch over to AWS Graviton2”
QAware | 12
ARM Graviton2 vs. comparable x86:
● similar in single-thread benchmarks
● superior in multi-thread benchmarks
● considerably fewer costs
● half of the energy consumption
QAware | 13
What is the right time for change?
QAware | 14
QAware | 15
Enterprise Software
Today
1
Measures for
Green Software
2
Greener
Enterprise Software
3
Enterprise Software Today
QAware | 17
Microservice
Database
Backend
Service
Mesh
Gateway
Load
Balancer
Kubernetes
Enterprise application infrastructure – a simplified view
Microservice
QAware | 18
Characteristics of enterprise microservices
Configuration Security
Documentation
Interfaces Data storage Resilience
Logging Tracing Metrics
Version control Continuous integration
Elasticity
The DevOps model applies to enterprise microservices
QAware | 19
Measures for Green Software
What is green software?
QAware | 21
#include <stdio.h>
#include <go-green.h>
int main() {
printf(“Hello, green world!n”);
return 0;
}
Benefit
Energy
high
energy
efficiency
low
energy
efficiency
Green = energy-efficient
QAware | 22
reduce the energy
required to provide
services or products
maximize the
benefit for the
consumed energy
Every DevOps phase requires energy
QAware | 23
Measures in operating microservices
QAware | 24
Power consumption in computer hardware:
● CPU
● memory
● I/O (network, disk)
● cooling
● everything else
Power consumption with virtualization:
● decoupled from real hardware
● measure usage of CPU, memory,
network
● consider capacity and load for CPU
and memory
Measurable benefits of microservices:
● availability: percentage of errors
on total requests
● latency: response time
● throughput: number of processed
requests per time unit
Making microservices green is an optimization problem
QAware | 25
Goals:
● minimize CPU usage
● minimize memory usage
● minimize I/O usage
● minimize latency
● maximize throughput
Simple strategies:
● be faster
● do less
● something else
Which goal can be sacrificed?
Greener Enterprise Software
A promising approach?
QAware | 27
A promising approach: a hello-world service
QAware | 28
Payara @Path("/hello")
@ApplicationScoped
public class HelloResource {
@GET
@Produces (MediaType.APPLICATION_JSON)
public Response sayHelloWorld () {
return Response.ok(new HelloResponse( "Hello, world!" )).build();
}
}
func main() {
http.HandleFunc( "/api/hello" , func(w http.ResponseWriter, r *http.Request) {
helloResponse := helloResponse{Text: "Hello, world!" }
js, _ := json.Marshal(helloResponse)
w.Header().Set( "Content-Type" , "application/json" )
_, _ = w.Write(js)
})
log.Fatal(http.ListenAndServe( ":9090", nil))
}
Go
A promising approach: artifacts und runtime behavior
QAware | 29
Start time
Container image size
Throughput
Maximum memory usage
Payara
Go
15 s
< 1 s
Payara
Go
10.000 req/s
25.000 req/s
Payara
Go
560 MB
15 MB
Payara
Go
350 MB
7 MB
Why aren’t we using
Go everywhere?
QAware | 30
QAware | 31
Let’s run a competition
Inspired by:
● Computer Language Benchmarks Game
● Energy Efficiency across Programming Languages
QAware | 32
Measure and compare
Scenario:
● microservice
● HTTP, JSON, SQL
● containerized
Competitors:
● Payara
● Quarkus
● Go
Benchmarks:
● idle vs. load
● limits on CPU and memory
A sample microservice
QAware | 33
1. HTTP API using JSON representation
2. HTTP client using JSON representation
3. Relational database
4. Logic (mapping, merging)
HTTP API
HTTP client
SQL DB
Logic
1
2
3
4
QAware | 34
Ready, steady, go!
Measurements – build
QAware | 35
JVM native
container image 363 MB 384 MB 81 MB 12 MB
build time 10 s 10 s 320 s 30 s
Measurements – start
QAware | 36
JVM native
start time 45 s 5 s 1 s 1 s
start CPU 110 % 110 % 1 % 1 %
start memory 477 MB 80 MB 10 MB 5 MB
idle CPU 1 % 1 % 0 % 0 %
idle memory 470 MB 80 MB 9 MB 5 MB
JVM native
10 rps
1 CPU – 1024 MB
20 ms
18% — 435 MB
20 ms
15% — 120 MB
11 ms
4% — 80 MB
8 ms
2% — 10 MB
50 rps
1 CPU – 1024 MB
18 ms
50% — 464 MB
16 ms
40% — 145 MB
9 ms
18% — 90 MB
6 ms
6% — 10 MB
100 rps
1 CPU – 1024 MB
214 ms
95% — 515 MB
47 ms
65% — 189 MB
8 ms
27% — 94 MB
8 ms
35% — 11 MB
200 rps
1 CPU – 1024 MB
n/a
888 ms
85% — 250 MB
15 ms
50% — 98 MB
16 ms
50% — 110 MB
Measurements – load
QAware | 37
Measurements – load and limits
QAware | 38
JVM native
10 rps
0.25 CPU – 256 MB
OOM at start 21 ms
13% — 124 MB
11 ms
5% — 28 MB
11 ms
4% — 10 MB
50 rps
0.25 CPU – 256 MB
n/a
6850 ms
29% — 240 MB
10 ms
21% — 30 MB
9 ms
18% — 10 MB
100 rps
0.25 CPU – 256 MB n/a n/a
48 ms
27% — 35 MB
4850 ms
27% — 45 MB
[0.75%]
Measurements – results
QAware | 39
Payara
● fast build
Quarkus (JVM)
● fast build
● fast start
● low runtime footprint
Go
● fast build
● tiny container image
● fast start
● very low runtime footprint
Quarkus (native)
● small container image
● fast start
● very low runtime footprint
QAware | 40
Is Go ready for enterprise microservices?
Configuration Security
Documentation
Interfaces Data storage Resilience
Logging Tracing Metrics
Version control Continuous integration
Elasticity
✓ ✓ ✓
✓
✓
✓
✓ ✓
✓
✓ ✓
✓
Where to go from here?
QAware | 41
QAware | 42
Future directions
Optimize further BizDevOps phases:
● re-consider design decisions
● choose other technologies (e.g., gRPC for less network usage)
● optimize code if appropriate measurement setup is in place
● optimize CI/CD
● use ARM infrastructure
Consider further frameworks and languages:
● Spring, Rust, C++, …
● respect enterprise criteria: maturity, IDE support, tooling, libraries, documentation
Let’s make
software green!
qaware.de
QAware GmbH
Aschauer Straße 32
81549 München
Tel. +49 89 232315-0
info@qaware.de
twitter.com/qaware
linkedin.com/company/qaware-gmbh
xing.com/companies/qawaregmbh
slideshare.net/qaware
github.com/qaware

More Related Content

Similar to The Path to Green Enterprise Applications

TechTalk_Cloud Performance Testing_0.6
TechTalk_Cloud Performance Testing_0.6TechTalk_Cloud Performance Testing_0.6
TechTalk_Cloud Performance Testing_0.6
Sravanthi N
 
Dutch Oracle Architects Platform - Reviewing Oracle OpenWorld 2017 and New Tr...
Dutch Oracle Architects Platform - Reviewing Oracle OpenWorld 2017 and New Tr...Dutch Oracle Architects Platform - Reviewing Oracle OpenWorld 2017 and New Tr...
Dutch Oracle Architects Platform - Reviewing Oracle OpenWorld 2017 and New Tr...
Lucas Jellema
 
JITServerTalk-OSS-2023.pdf
JITServerTalk-OSS-2023.pdfJITServerTalk-OSS-2023.pdf
JITServerTalk-OSS-2023.pdf
RichHagarty
 

Similar to The Path to Green Enterprise Applications (20)

JITServerTalk JCON World 2023.pdf
JITServerTalk JCON World 2023.pdfJITServerTalk JCON World 2023.pdf
JITServerTalk JCON World 2023.pdf
 
Microservices at Mercari
Microservices at MercariMicroservices at Mercari
Microservices at Mercari
 
Adding Value in the Cloud with Performance Test
Adding Value in the Cloud with Performance TestAdding Value in the Cloud with Performance Test
Adding Value in the Cloud with Performance Test
 
Francisco Javier Ramirez Urea - Hopla - OSL19
Francisco Javier Ramirez Urea - Hopla - OSL19Francisco Javier Ramirez Urea - Hopla - OSL19
Francisco Javier Ramirez Urea - Hopla - OSL19
 
TechTalk_Cloud Performance Testing_0.6
TechTalk_Cloud Performance Testing_0.6TechTalk_Cloud Performance Testing_0.6
TechTalk_Cloud Performance Testing_0.6
 
Dutch Oracle Architects Platform - Reviewing Oracle OpenWorld 2017 and New Tr...
Dutch Oracle Architects Platform - Reviewing Oracle OpenWorld 2017 and New Tr...Dutch Oracle Architects Platform - Reviewing Oracle OpenWorld 2017 and New Tr...
Dutch Oracle Architects Platform - Reviewing Oracle OpenWorld 2017 and New Tr...
 
High Performance Object Pascal Code on Servers (at EKON 22)
High Performance Object Pascal Code on Servers (at EKON 22)High Performance Object Pascal Code on Servers (at EKON 22)
High Performance Object Pascal Code on Servers (at EKON 22)
 
AWS for HPC in Drug Discovery
AWS for HPC in Drug DiscoveryAWS for HPC in Drug Discovery
AWS for HPC in Drug Discovery
 
A Framework to Measure and Maximize Cloud ROI
A Framework to Measure and Maximize Cloud ROIA Framework to Measure and Maximize Cloud ROI
A Framework to Measure and Maximize Cloud ROI
 
From monolith to microservices
From monolith to microservicesFrom monolith to microservices
From monolith to microservices
 
Monitorama - Please, no more Minutes, Milliseconds, Monoliths or Monitoring T...
Monitorama - Please, no more Minutes, Milliseconds, Monoliths or Monitoring T...Monitorama - Please, no more Minutes, Milliseconds, Monoliths or Monitoring T...
Monitorama - Please, no more Minutes, Milliseconds, Monoliths or Monitoring T...
 
High Performance Computing Pitch Deck
High Performance Computing Pitch DeckHigh Performance Computing Pitch Deck
High Performance Computing Pitch Deck
 
Evaluating Cloud Native Storage Vendors - DoK Talks #147
Evaluating Cloud Native Storage Vendors - DoK Talks #147Evaluating Cloud Native Storage Vendors - DoK Talks #147
Evaluating Cloud Native Storage Vendors - DoK Talks #147
 
Improving Your Company’s Health with Middleware Takeout
Improving Your Company’s Health with Middleware TakeoutImproving Your Company’s Health with Middleware Takeout
Improving Your Company’s Health with Middleware Takeout
 
Kubecon seattle 2018 workshop slides
Kubecon seattle 2018 workshop slidesKubecon seattle 2018 workshop slides
Kubecon seattle 2018 workshop slides
 
Quality in a Square. K8s-native Quality Assurance of Microservices with Testkube
Quality in a Square. K8s-native Quality Assurance of Microservices with TestkubeQuality in a Square. K8s-native Quality Assurance of Microservices with Testkube
Quality in a Square. K8s-native Quality Assurance of Microservices with Testkube
 
JITServerTalk-OSS-2023.pdf
JITServerTalk-OSS-2023.pdfJITServerTalk-OSS-2023.pdf
JITServerTalk-OSS-2023.pdf
 
Geode Performance Architecture for the Agile Enterprise Using Cloud Native API's
Geode Performance Architecture for the Agile Enterprise Using Cloud Native API'sGeode Performance Architecture for the Agile Enterprise Using Cloud Native API's
Geode Performance Architecture for the Agile Enterprise Using Cloud Native API's
 
AWS re:Invent 2016: Getting Started with Serverless Architectures (CMP211)
AWS re:Invent 2016: Getting Started with Serverless Architectures (CMP211)AWS re:Invent 2016: Getting Started with Serverless Architectures (CMP211)
AWS re:Invent 2016: Getting Started with Serverless Architectures (CMP211)
 
The architecture of SkySQL
The architecture of SkySQLThe architecture of SkySQL
The architecture of SkySQL
 

More from Green Software Development

More from Green Software Development (7)

Sustainable Web Design - Claire Thornewill
Sustainable Web Design - Claire ThornewillSustainable Web Design - Claire Thornewill
Sustainable Web Design - Claire Thornewill
 
Blue turns green! Approaches and technologies for sustainable K8s clusters #C...
Blue turns green! Approaches and technologies for sustainable K8s clusters #C...Blue turns green! Approaches and technologies for sustainable K8s clusters #C...
Blue turns green! Approaches and technologies for sustainable K8s clusters #C...
 
Green Cloud - Measure cloud emissions
Green Cloud - Measure cloud emissionsGreen Cloud - Measure cloud emissions
Green Cloud - Measure cloud emissions
 
CO2 Footprint of ChatGPT
CO2 Footprint of ChatGPTCO2 Footprint of ChatGPT
CO2 Footprint of ChatGPT
 
Tools and best practices for sustainable software
Tools and best practices for sustainable softwareTools and best practices for sustainable software
Tools and best practices for sustainable software
 
The challenge of putting software sustainability research into practice
The challenge of putting software sustainability research into practiceThe challenge of putting software sustainability research into practice
The challenge of putting software sustainability research into practice
 
Carbon Hack 2022
Carbon Hack 2022Carbon Hack 2022
Carbon Hack 2022
 

Recently uploaded

%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 

Recently uploaded (20)

%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 

The Path to Green Enterprise Applications

  • 1. qaware.de The Path to Green Enterprise Applications Sascha Böhme sascha.boehme@qaware.de
  • 2. Once upon a time, there was a service … QAware | 2
  • 3. Our challenge QAware | 3 Digital transformation produces further services that are constantly running IT provides value to business and customers IT enables new, previously unthinkable business models How to limit the increase in energy consumption? How to limit the rebounce effect? This bad-case prediction lacks changes that are currently unknown, yet is a good warning sign
  • 5. QAware | 5 A personal perspective
  • 6. Advantages in using Payara ● in use since many years ● well understood ● proven ● stable ● standardized ● full of functionality ● few surprises QAware | 6
  • 7. Drawbacks in using Payara QAware | 7 ● long start times ● long turnaround times ● moderate performance ● high memory consumption ● large container images ● little documentation besides standards
  • 8. QAware | 8 Should we continue that way?
  • 9. Or should we rather try new paths? QAware | 9
  • 10. “If your service is too slow, re-implement it in Go” QAware | 10 Go: ● fast ● small ● easy to learn ● widely applied in the cloud-native world
  • 11. “Use Quarkus to build fast and lightweight applications” QAware | 11 Quarkus: ● close to JakartaEE ● regular innovations ● rich documentation ● native executables
  • 12. “You’d be stupid not to switch over to AWS Graviton2” QAware | 12 ARM Graviton2 vs. comparable x86: ● similar in single-thread benchmarks ● superior in multi-thread benchmarks ● considerably fewer costs ● half of the energy consumption
  • 13. QAware | 13 What is the right time for change?
  • 15. QAware | 15 Enterprise Software Today 1 Measures for Green Software 2 Greener Enterprise Software 3
  • 17. QAware | 17 Microservice Database Backend Service Mesh Gateway Load Balancer Kubernetes Enterprise application infrastructure – a simplified view Microservice
  • 18. QAware | 18 Characteristics of enterprise microservices Configuration Security Documentation Interfaces Data storage Resilience Logging Tracing Metrics Version control Continuous integration Elasticity
  • 19. The DevOps model applies to enterprise microservices QAware | 19
  • 20. Measures for Green Software
  • 21. What is green software? QAware | 21 #include <stdio.h> #include <go-green.h> int main() { printf(“Hello, green world!n”); return 0; }
  • 22. Benefit Energy high energy efficiency low energy efficiency Green = energy-efficient QAware | 22 reduce the energy required to provide services or products maximize the benefit for the consumed energy
  • 23. Every DevOps phase requires energy QAware | 23
  • 24. Measures in operating microservices QAware | 24 Power consumption in computer hardware: ● CPU ● memory ● I/O (network, disk) ● cooling ● everything else Power consumption with virtualization: ● decoupled from real hardware ● measure usage of CPU, memory, network ● consider capacity and load for CPU and memory Measurable benefits of microservices: ● availability: percentage of errors on total requests ● latency: response time ● throughput: number of processed requests per time unit
  • 25. Making microservices green is an optimization problem QAware | 25 Goals: ● minimize CPU usage ● minimize memory usage ● minimize I/O usage ● minimize latency ● maximize throughput Simple strategies: ● be faster ● do less ● something else Which goal can be sacrificed?
  • 28. A promising approach: a hello-world service QAware | 28 Payara @Path("/hello") @ApplicationScoped public class HelloResource { @GET @Produces (MediaType.APPLICATION_JSON) public Response sayHelloWorld () { return Response.ok(new HelloResponse( "Hello, world!" )).build(); } } func main() { http.HandleFunc( "/api/hello" , func(w http.ResponseWriter, r *http.Request) { helloResponse := helloResponse{Text: "Hello, world!" } js, _ := json.Marshal(helloResponse) w.Header().Set( "Content-Type" , "application/json" ) _, _ = w.Write(js) }) log.Fatal(http.ListenAndServe( ":9090", nil)) } Go
  • 29. A promising approach: artifacts und runtime behavior QAware | 29 Start time Container image size Throughput Maximum memory usage Payara Go 15 s < 1 s Payara Go 10.000 req/s 25.000 req/s Payara Go 560 MB 15 MB Payara Go 350 MB 7 MB
  • 30. Why aren’t we using Go everywhere? QAware | 30
  • 31. QAware | 31 Let’s run a competition Inspired by: ● Computer Language Benchmarks Game ● Energy Efficiency across Programming Languages
  • 32. QAware | 32 Measure and compare Scenario: ● microservice ● HTTP, JSON, SQL ● containerized Competitors: ● Payara ● Quarkus ● Go Benchmarks: ● idle vs. load ● limits on CPU and memory
  • 33. A sample microservice QAware | 33 1. HTTP API using JSON representation 2. HTTP client using JSON representation 3. Relational database 4. Logic (mapping, merging) HTTP API HTTP client SQL DB Logic 1 2 3 4
  • 34. QAware | 34 Ready, steady, go!
  • 35. Measurements – build QAware | 35 JVM native container image 363 MB 384 MB 81 MB 12 MB build time 10 s 10 s 320 s 30 s
  • 36. Measurements – start QAware | 36 JVM native start time 45 s 5 s 1 s 1 s start CPU 110 % 110 % 1 % 1 % start memory 477 MB 80 MB 10 MB 5 MB idle CPU 1 % 1 % 0 % 0 % idle memory 470 MB 80 MB 9 MB 5 MB
  • 37. JVM native 10 rps 1 CPU – 1024 MB 20 ms 18% — 435 MB 20 ms 15% — 120 MB 11 ms 4% — 80 MB 8 ms 2% — 10 MB 50 rps 1 CPU – 1024 MB 18 ms 50% — 464 MB 16 ms 40% — 145 MB 9 ms 18% — 90 MB 6 ms 6% — 10 MB 100 rps 1 CPU – 1024 MB 214 ms 95% — 515 MB 47 ms 65% — 189 MB 8 ms 27% — 94 MB 8 ms 35% — 11 MB 200 rps 1 CPU – 1024 MB n/a 888 ms 85% — 250 MB 15 ms 50% — 98 MB 16 ms 50% — 110 MB Measurements – load QAware | 37
  • 38. Measurements – load and limits QAware | 38 JVM native 10 rps 0.25 CPU – 256 MB OOM at start 21 ms 13% — 124 MB 11 ms 5% — 28 MB 11 ms 4% — 10 MB 50 rps 0.25 CPU – 256 MB n/a 6850 ms 29% — 240 MB 10 ms 21% — 30 MB 9 ms 18% — 10 MB 100 rps 0.25 CPU – 256 MB n/a n/a 48 ms 27% — 35 MB 4850 ms 27% — 45 MB [0.75%]
  • 39. Measurements – results QAware | 39 Payara ● fast build Quarkus (JVM) ● fast build ● fast start ● low runtime footprint Go ● fast build ● tiny container image ● fast start ● very low runtime footprint Quarkus (native) ● small container image ● fast start ● very low runtime footprint
  • 40. QAware | 40 Is Go ready for enterprise microservices? Configuration Security Documentation Interfaces Data storage Resilience Logging Tracing Metrics Version control Continuous integration Elasticity ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
  • 41. Where to go from here? QAware | 41
  • 42. QAware | 42 Future directions Optimize further BizDevOps phases: ● re-consider design decisions ● choose other technologies (e.g., gRPC for less network usage) ● optimize code if appropriate measurement setup is in place ● optimize CI/CD ● use ARM infrastructure Consider further frameworks and languages: ● Spring, Rust, C++, … ● respect enterprise criteria: maturity, IDE support, tooling, libraries, documentation
  • 44. qaware.de QAware GmbH Aschauer Straße 32 81549 München Tel. +49 89 232315-0 info@qaware.de twitter.com/qaware linkedin.com/company/qaware-gmbh xing.com/companies/qawaregmbh slideshare.net/qaware github.com/qaware