SlideShare une entreprise Scribd logo
1  sur  20
Autosleep service
Inactive apps get automatically put to sleep
and restarted on incoming traffic
Introduction
• About orange
• Autosleep team
@gberche
gberche-orange
guillaume.berche (*)
Guillaume Berche Benjamin Einaudi
antechrestos
benjamin.einaudi (*)
Arnaud Ruffin
arnaudruffin
arnaud.ruffin (*)
(*) @orange.com
Why
Why ?
Image credit: https://www.flickr.com/photos/amagill/3366720659 CC 2.0
Why ?
• For app teams: save cash on public /
onprem CF instances
• For platform providers
– save RAM and increase app density
– enables free/cheap/trial tiers
What suiteable workload ?
• non-production
– Hello world / tutorials / demos
– hackathons/ spikes
– API stubs/fakes
– serving docs, dev tools
– qa, preprod, staging app
instances used in ci.
• production?
– Service brokers
44% non production CF app nstances at Rakuten in
2015
https://speakerdeck.com/tcnksm/how-to-dev-and-ops-
internal-paas
How
Autosleep features
• exposed as a service broker
• enrolled apps get automatically stopped
on inactivity
• auto-wake-up sleeping apps on incoming
traffic (work in progress)
Autosleep features
• exposed as a service broker
– enrolled app == app bound to an autosleep service instance
– 3 modes:
• 1- opt-in: user binds app to service instance
• 2- standard auto-enrollment: a service instance automatically enrolls apps in
associated space. opt-out by unbinding service instance, or exclusion regexp.
• 3- forced auto-enrollment: forced enrollment rejects opt-outs (auto-rebinds)
– dashboard to check enrollment status and current idle duration
• enrolled app automatically stopped on inactivity:
– activity measured by cf events + cf logs
– configureable idle duration
• auto-wake-up sleeping apps on incoming traffic
– buffers traffic while app is unavailable
Demo
• installation
• standard enrollment
• autosleep
• autowakeup
• forced enrollment
Recorded demo at
https://drive.google.com/open?id=0B_RQz82R
zSUndnd4TFJOODFkTU0
What
Autosleep architecture
Autosleep-core
Autowakeup-proxy
Mysql DB
Servicebroker
DashboardUI
Space Enroller
Application Stopper
CloudFoundry
CCAPI
Controller
Scan apps,
[un]Bind apps
fetch logs,
fetch events,
stop apps
Sends orphan
traffic on mapped
wildcard domains
Starts apps
app team:
create service
unbind-service
delete-service
app user:
query
sleeping app
Gorouter
Forwards app
traffic
Alternative autowakeup designs
Design Pros Cons
Route services • autosleep mutualisation
between CF instances
• enables optimizations (pass
appguid in route service url)
• Not yet feasible: (no traffic sent to
route service unless bound to an
active app). Cf-routing priorization
in progress.
Wildcard route • feasible
• automatic « unregistration »
when app is started
• Single autosleep instance per
domain (Single wildcard route by
domain.)
• Does not coexist well with other
wildcard routes
• Only works for wildcard domains
• autowake up receives unrelated
orphan traffic, requiring more
capacity to not be vulnerable to DoS
Potential future improvements
• Harden auto-wake-up & queue traffic during restart
• HA and load balancing
• Dashboard authentication + check permissions
• Bosh release / PCF tile packaging
• space/org auto-enrollment
• Fine grain autosleep tuning (business hours vs off-
business hours)
• User notification when applications are put to sleep.
Learnings &
PF suggestions
Learnings and PF suggestions
Learnings:
• service broker CRUD: powerful but restrictive UX
• cf-java-client reimplementation: solid but distracting
• route services routing traffic to routes with no avail app
instances (details)
Suggestions:
• service broker API enhancements to
– propagate requester identity
– requester delegate permissions to broker to act on this behalf
• Custom CLI UI for service brokers
– Service broker actions
• cf perform-service-action set-mode –i myautosleep standard –s « mysecret »
– Custom plugin auto-installation:
• cf autosleep set-mode –i myautosleep standard –s « mysecret »
Wrap up
Thanks
• This is work in progress available at:
https://github.com/Orange-OpenSource/autosleep/
• Test it and tell us what you think
• Report bugs
• Suggest new ideas
• Contribute enhancements
Questions / comments / inspirations ?
Backup slides
Std vs forced auto-enrollment

Contenu connexe

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 

Dernier (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 

En vedette

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

En vedette (20)

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 

Autosleep: Inactive apps get automatically put to sleep and restarted on incoming traffic

  • 1. Autosleep service Inactive apps get automatically put to sleep and restarted on incoming traffic
  • 2. Introduction • About orange • Autosleep team @gberche gberche-orange guillaume.berche (*) Guillaume Berche Benjamin Einaudi antechrestos benjamin.einaudi (*) Arnaud Ruffin arnaudruffin arnaud.ruffin (*) (*) @orange.com
  • 3. Why
  • 4. Why ? Image credit: https://www.flickr.com/photos/amagill/3366720659 CC 2.0
  • 5. Why ? • For app teams: save cash on public / onprem CF instances • For platform providers – save RAM and increase app density – enables free/cheap/trial tiers
  • 6. What suiteable workload ? • non-production – Hello world / tutorials / demos – hackathons/ spikes – API stubs/fakes – serving docs, dev tools – qa, preprod, staging app instances used in ci. • production? – Service brokers 44% non production CF app nstances at Rakuten in 2015 https://speakerdeck.com/tcnksm/how-to-dev-and-ops- internal-paas
  • 7. How
  • 8. Autosleep features • exposed as a service broker • enrolled apps get automatically stopped on inactivity • auto-wake-up sleeping apps on incoming traffic (work in progress)
  • 9. Autosleep features • exposed as a service broker – enrolled app == app bound to an autosleep service instance – 3 modes: • 1- opt-in: user binds app to service instance • 2- standard auto-enrollment: a service instance automatically enrolls apps in associated space. opt-out by unbinding service instance, or exclusion regexp. • 3- forced auto-enrollment: forced enrollment rejects opt-outs (auto-rebinds) – dashboard to check enrollment status and current idle duration • enrolled app automatically stopped on inactivity: – activity measured by cf events + cf logs – configureable idle duration • auto-wake-up sleeping apps on incoming traffic – buffers traffic while app is unavailable
  • 10. Demo • installation • standard enrollment • autosleep • autowakeup • forced enrollment Recorded demo at https://drive.google.com/open?id=0B_RQz82R zSUndnd4TFJOODFkTU0
  • 11. What
  • 12. Autosleep architecture Autosleep-core Autowakeup-proxy Mysql DB Servicebroker DashboardUI Space Enroller Application Stopper CloudFoundry CCAPI Controller Scan apps, [un]Bind apps fetch logs, fetch events, stop apps Sends orphan traffic on mapped wildcard domains Starts apps app team: create service unbind-service delete-service app user: query sleeping app Gorouter Forwards app traffic
  • 13. Alternative autowakeup designs Design Pros Cons Route services • autosleep mutualisation between CF instances • enables optimizations (pass appguid in route service url) • Not yet feasible: (no traffic sent to route service unless bound to an active app). Cf-routing priorization in progress. Wildcard route • feasible • automatic « unregistration » when app is started • Single autosleep instance per domain (Single wildcard route by domain.) • Does not coexist well with other wildcard routes • Only works for wildcard domains • autowake up receives unrelated orphan traffic, requiring more capacity to not be vulnerable to DoS
  • 14. Potential future improvements • Harden auto-wake-up & queue traffic during restart • HA and load balancing • Dashboard authentication + check permissions • Bosh release / PCF tile packaging • space/org auto-enrollment • Fine grain autosleep tuning (business hours vs off- business hours) • User notification when applications are put to sleep.
  • 16. Learnings and PF suggestions Learnings: • service broker CRUD: powerful but restrictive UX • cf-java-client reimplementation: solid but distracting • route services routing traffic to routes with no avail app instances (details) Suggestions: • service broker API enhancements to – propagate requester identity – requester delegate permissions to broker to act on this behalf • Custom CLI UI for service brokers – Service broker actions • cf perform-service-action set-mode –i myautosleep standard –s « mysecret » – Custom plugin auto-installation: • cf autosleep set-mode –i myautosleep standard –s « mysecret »
  • 18. Thanks • This is work in progress available at: https://github.com/Orange-OpenSource/autosleep/ • Test it and tell us what you think • Report bugs • Suggest new ideas • Contribute enhancements Questions / comments / inspirations ?
  • 20. Std vs forced auto-enrollment

Notes de l'éditeur

  1. I’m working at Orange, one of the leading telco operator in Europe and Africa: 29 markets, 240M subscribers, This talk is about autosleep, a new service broker that automatically stops inactive apps and wake them up on incoming traffic This is a work in progress, as part of an Orange applied research projet, with developments from Benjamin and Arnaud. I’ve been doing product management on this project. Orange started on this project both to get autosleep feature for our CF deployments, as well as better understand/control CF extensions points such as CC API, service broker and route services. It’s also educational for us.
  2. Why would autosleep be of interest ? Why should you care ?
  3. Save money and power, do good for the planet.
  4. autosleep can be deployed within the CF instance, or externally on prem or on my local computer. autosleep will turn off all of my inactive apps on public CF instances. for platform providers, on prem providers will have less dormant apps, and thus be able to turn off some diego cells, lowering infrastructure costs and power consumption. public cloud providers could potentially offer free/cheap/trial tiers by systematically configuring autosleep to only start apps on demand.
  5. Use-cases for an autosleep service Rakuten in 2015: https://speakerdeck.com/tcnksm/how-to-dev-and-ops-internal-paas 2500 instances: 1400 prod (56%), 700 staging (28%), 400 dev (16%) => non-prod sums up to 44% There might be use cases for production workloads which are rarely used and can cope with a slow start up (up to 60 s) depending on buildpacks used.
  6. How do you use autosleep to save money or do good for the planet ?
  7. Why a broker ? Ease discovery, and leverage standard service life cycle, avoids installation prereqs, enables automation (manifest, Cf CLI scripting…) Why not built-in 1st class feature: harder for us, plus we’re keen on learning about SB and route services
  8. PS1="[\t \W ] $ " autosleep deployment, and wildcard route mapping standard enrollment $ HISTFILE=~/.history-1 $ for a in active-app hello-world production-no-sleep; do cf start $a ;done $ cf cs autosleep default autosleep -c '{"idle-duration": "PT20S", "exclude-from-auto-enrollment": "production.*"}' $ history –a $ watch -c "cf s; echo""; cf a; echo $ cf service-open autosleep $ watch -c -n1 'curl -s -S -k http://active-app.cfapps.elpaaso.net?`date +%s`‘ $ watch -c cf set-env active-app date `date +%s` autowake up forced enrollment $ cf cs autosleep default autosleep -c '{"idle-duration": "PT20S", "exclude-from-auto-enrollment": "production.*", "auto-enrollment": "forced", "secret": "Th1s1zg00dP@$$w0rd"}‘ $ cf unbind-service hello-world autosleep $ cf update-service autosleep -c '{"auto-enrollment": "standard“, "secret": "Th1s1zg00dP@$$w0rd"}' $ for a in active-app hello-world production-no-sleep; do cf unbind-service $a autosleep ; done; cf ds -f autosleep
  9. What is delivered exactly
  10. Reactive cf java-client I learned the hard way that …
  11. We hope this work could inspire service providers into automating some tasks using CC API while providing visibility to app teams, and leaving them some control.