SlideShare una empresa de Scribd logo
1 de 11
Shunji Konishi
FLECT Co., LTD
 We run a production service on Heroku
◦ Playframework 1.2.5
◦ Multiple dynos
 Sometimes following error is logged, when dyno is
cycling.
◦ This error happens when play receives a request after
shutdown.
◦ But frequency is very rare.
I've discussed about this problem with Heroku
support team.
This document explains its detail.
play.exceptions.UnexpectedException: Application is not started
 At the shutdown time, Play does nothing to Netty.
 After app shutdowned, Netty still alive and can accept
new request.(But always returns 503)
 When shutdown process takes a few seconds, there is
a possibility to accept new request and return 503.
Normally this duration is
nearly zero sec.
But rarely takes a few seconds.
 https://devcenter.heroku.com/articles/dynos
 Heroku router may send a request after SIGTERM.
◦ When it failed to connect, the request send to other
dynos.
◦ When it received 503, it is accepted.
 Playframework
◦ Play should stop Netty before app shutdown.
◦ There is no way to stop Netty by application developer.
 Heroku
◦ Heroku shouldn’t send request after SIGTERM.
◦ It is out of control for application developer.
Though it may be possible to fix playframework,
it is better to handle this problem by Heroku side.
(Because other framework may have same problem.)
 This is a great feature of Heroku labs.
◦ https://devcenter.heroku.com/articles/labs-preboot
 Preboot changes Heroku restarting behavior
◦ Before: Kill old dynos, then boot new dynos.
◦ After: Boot new dynos first.
 Target
◦ Web dynos only
◦ At least two web dynos are required.
 When
◦ git push
◦ heroku config:set
◦ heroku restart
It doesn’t apply at cycling…
 Currently there is no way to avoid this
problem radically…
 Our service features.
◦ Mostly used in Japan.
◦ So at the midnight(JST), its traffic is not so high.
 If I can control the time of cycling to
midnight(JST), it may reduce error possibility.
◦ Though original frequency is not so high, I want to
reduce error possibility as much as possible.
 https://github.com/gregburek/heroku-
buildpack-toolbelt
 It installs Heroku Toolbelt to dyno.
 So it allows one to run heroku command by
Heroku scheduler.
 Daily at 18:30 (3:30 JST)
◦ vendor/heroku-toolbelt/bin/heroku restart web.1 -a xxx
 Daily at 19:00 (4:00 JST)
◦ vendor/heroku-toolbelt/bin/heroku restart web.2 -a xxx
Delay the timing of restarting multiple dynos.
This settings can reduce daytime cycling.
But it doesn't mean the daytime cycling will never
occur.
e.g. if Heroku detects a fault in underlying
hardware, it will be cycling.
 To solve this problem radically, I hope Heroku
to either of following.
◦ Don’t send request to dyno after SIGTERM.
◦ Apply preboot at cycling.

Más contenido relacionado

La actualidad más candente

Site Testing with CasperJS
Site Testing with CasperJSSite Testing with CasperJS
Site Testing with CasperJS
Joseph Scott
 
Nodejs - Building a RESTful API
Nodejs - Building a RESTful APINodejs - Building a RESTful API
Nodejs - Building a RESTful API
Sang Cù
 
Phantom js quick start
Phantom js quick startPhantom js quick start
Phantom js quick start
ji guang
 

La actualidad más candente (19)

Node.js Cloud deployment
Node.js Cloud deploymentNode.js Cloud deployment
Node.js Cloud deployment
 
Vagrant 의 활용
Vagrant 의 활용Vagrant 의 활용
Vagrant 의 활용
 
Nodejs Intro - Part2 Introduction to Web Applications
Nodejs Intro - Part2 Introduction to Web ApplicationsNodejs Intro - Part2 Introduction to Web Applications
Nodejs Intro - Part2 Introduction to Web Applications
 
Site Testing with CasperJS
Site Testing with CasperJSSite Testing with CasperJS
Site Testing with CasperJS
 
[Js hcm] Deploying node.js with Forever.js and nginx
[Js hcm] Deploying node.js with Forever.js and nginx[Js hcm] Deploying node.js with Forever.js and nginx
[Js hcm] Deploying node.js with Forever.js and nginx
 
Capistrano && SystemD
Capistrano && SystemDCapistrano && SystemD
Capistrano && SystemD
 
Continuous delivery of Windows micro services in the cloud
Continuous delivery of Windows micro services in the cloud Continuous delivery of Windows micro services in the cloud
Continuous delivery of Windows micro services in the cloud
 
MVC way to introduce Sails.js - node.js framework
MVC way to introduce Sails.js - node.js frameworkMVC way to introduce Sails.js - node.js framework
MVC way to introduce Sails.js - node.js framework
 
Node.js x Azure, cli usage, website deployment
Node.js x Azure, cli usage, website deploymentNode.js x Azure, cli usage, website deployment
Node.js x Azure, cli usage, website deployment
 
Nodejs - Building a RESTful API
Nodejs - Building a RESTful APINodejs - Building a RESTful API
Nodejs - Building a RESTful API
 
Phantom js quick start
Phantom js quick startPhantom js quick start
Phantom js quick start
 
Testando JavaScript com Spock
Testando JavaScript com SpockTestando JavaScript com Spock
Testando JavaScript com Spock
 
ServiceWorker: New game changer is coming!
ServiceWorker: New game changer is coming!ServiceWorker: New game changer is coming!
ServiceWorker: New game changer is coming!
 
Aws
AwsAws
Aws
 
A Whirlwind Tour of Etsy's Monitoring Stack
A Whirlwind Tour of Etsy's Monitoring StackA Whirlwind Tour of Etsy's Monitoring Stack
A Whirlwind Tour of Etsy's Monitoring Stack
 
Mobile CI at Etsy
Mobile CI at EtsyMobile CI at Etsy
Mobile CI at Etsy
 
Rails after 5 years
Rails after 5 yearsRails after 5 years
Rails after 5 years
 
Data Driven Monitoring
Data Driven MonitoringData Driven Monitoring
Data Driven Monitoring
 
Yeoman Workflow
Yeoman WorkflowYeoman Workflow
Yeoman Workflow
 

Destacado

ベトナムオフショア開発を開始するマイクロステップ
ベトナムオフショア開発を開始するマイクロステップベトナムオフショア開発を開始するマイクロステップ
ベトナムオフショア開発を開始するマイクロステップ
Samurai Incubate Inc.
 

Destacado (14)

Path: Why you need another social media app
Path: Why you need another social media appPath: Why you need another social media app
Path: Why you need another social media app
 
Survey on the Behavior of Path Users in Indonesia
Survey on the Behavior of Path Users in IndonesiaSurvey on the Behavior of Path Users in Indonesia
Survey on the Behavior of Path Users in Indonesia
 
Cav presentation about_indonesia
Cav presentation about_indonesiaCav presentation about_indonesia
Cav presentation about_indonesia
 
ベトナムの人気モバイルアプリランキング
ベトナムの人気モバイルアプリランキングベトナムの人気モバイルアプリランキング
ベトナムの人気モバイルアプリランキング
 
NE7012- SOCIAL NETWORK ANALYSIS
NE7012- SOCIAL NETWORK ANALYSISNE7012- SOCIAL NETWORK ANALYSIS
NE7012- SOCIAL NETWORK ANALYSIS
 
ベトナムオフショア開発を開始するマイクロステップ
ベトナムオフショア開発を開始するマイクロステップベトナムオフショア開発を開始するマイクロステップ
ベトナムオフショア開発を開始するマイクロステップ
 
2015 indonesia digital landscape
2015 indonesia digital landscape 2015 indonesia digital landscape
2015 indonesia digital landscape
 
Top 20 Twitter Influencers In Singapore
Top 20 Twitter Influencers In SingaporeTop 20 Twitter Influencers In Singapore
Top 20 Twitter Influencers In Singapore
 
Indonesia social media trend 2016 jakpat
Indonesia social media trend 2016 jakpatIndonesia social media trend 2016 jakpat
Indonesia social media trend 2016 jakpat
 
Digital in numbers indonesia (compilation)
Digital in numbers indonesia (compilation)Digital in numbers indonesia (compilation)
Digital in numbers indonesia (compilation)
 
7 insights of Indonesia
7 insights of Indonesia7 insights of Indonesia
7 insights of Indonesia
 
Indonesia Digital Landscape 2016
Indonesia Digital Landscape 2016Indonesia Digital Landscape 2016
Indonesia Digital Landscape 2016
 
Digital numbers and landscape in indonesia 2016 updated
Digital numbers and landscape in indonesia 2016   updatedDigital numbers and landscape in indonesia 2016   updated
Digital numbers and landscape in indonesia 2016 updated
 
How to Submit Your Content to Reddit
How to Submit Your Content to RedditHow to Submit Your Content to Reddit
How to Submit Your Content to Reddit
 

Similar a Dyno cycling behavior of Heroku

2013-05-15 threads. why and how
2013-05-15 threads. why and how2013-05-15 threads. why and how
2013-05-15 threads. why and how
CocoaHeads Tricity
 

Similar a Dyno cycling behavior of Heroku (20)

Analysing in depth work manager
Analysing in depth work managerAnalysing in depth work manager
Analysing in depth work manager
 
2013-05-15 threads. why and how
2013-05-15 threads. why and how2013-05-15 threads. why and how
2013-05-15 threads. why and how
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Improving MeeGo boot-up time
Improving MeeGo boot-up timeImproving MeeGo boot-up time
Improving MeeGo boot-up time
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Not Quite As Painful Threading
Not Quite As Painful ThreadingNot Quite As Painful Threading
Not Quite As Painful Threading
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
PyGrunn2013 High Performance Web Applications with TurboGears
PyGrunn2013  High Performance Web Applications with TurboGearsPyGrunn2013  High Performance Web Applications with TurboGears
PyGrunn2013 High Performance Web Applications with TurboGears
 
First Real Pull Request Ever
First Real Pull Request EverFirst Real Pull Request Ever
First Real Pull Request Ever
 
Html5 Game Development with Canvas
Html5 Game Development with CanvasHtml5 Game Development with Canvas
Html5 Game Development with Canvas
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
S4 sig-check-lpc-20130918
S4 sig-check-lpc-20130918S4 sig-check-lpc-20130918
S4 sig-check-lpc-20130918
 
Flowframes
FlowframesFlowframes
Flowframes
 
Git sourcecontrolpreso
Git sourcecontrolpresoGit sourcecontrolpreso
Git sourcecontrolpreso
 
Great Tools Heavily Used In Japan, You Don't Know.
Great Tools Heavily Used In Japan, You Don't Know.Great Tools Heavily Used In Japan, You Don't Know.
Great Tools Heavily Used In Japan, You Don't Know.
 
jQuery Conference Austin Sept 2013
jQuery Conference Austin Sept 2013jQuery Conference Austin Sept 2013
jQuery Conference Austin Sept 2013
 

Más de Shunji Konishi

Javascriptのあれやこれやをまとめて説明してみる
Javascriptのあれやこれやをまとめて説明してみるJavascriptのあれやこれやをまとめて説明してみる
Javascriptのあれやこれやをまとめて説明してみる
Shunji Konishi
 
WebSocketでリアルタイムクイズアプリを作ってみた
WebSocketでリアルタイムクイズアプリを作ってみたWebSocketでリアルタイムクイズアプリを作ってみた
WebSocketでリアルタイムクイズアプリを作ってみた
Shunji Konishi
 
Herokuで使えるRDBMS管理者ツール
Herokuで使えるRDBMS管理者ツールHerokuで使えるRDBMS管理者ツール
Herokuで使えるRDBMS管理者ツール
Shunji Konishi
 

Más de Shunji Konishi (20)

Salesforceのハッカソンに参加した話
Salesforceのハッカソンに参加した話Salesforceのハッカソンに参加した話
Salesforceのハッカソンに参加した話
 
Salesforce連携のためのOData入門
Salesforce連携のためのOData入門Salesforce連携のためのOData入門
Salesforce連携のためのOData入門
 
プロキシーを使ってテストを楽にする
プロキシーを使ってテストを楽にするプロキシーを使ってテストを楽にする
プロキシーを使ってテストを楽にする
 
Javascriptのあれやこれやをまとめて説明してみる
Javascriptのあれやこれやをまとめて説明してみるJavascriptのあれやこれやをまとめて説明してみる
Javascriptのあれやこれやをまとめて説明してみる
 
MochaとChaiでやるJavaScriptテスト
MochaとChaiでやるJavaScriptテストMochaとChaiでやるJavaScriptテスト
MochaとChaiでやるJavaScriptテスト
 
SendGridサンプルの紹介
SendGridサンプルの紹介SendGridサンプルの紹介
SendGridサンプルの紹介
 
セキュリティの考え方
セキュリティの考え方セキュリティの考え方
セキュリティの考え方
 
一番簡単なWebSocketの試し方
一番簡単なWebSocketの試し方一番簡単なWebSocketの試し方
一番簡単なWebSocketの試し方
 
WebSocketでリアルタイムクイズアプリを作ってみた
WebSocketでリアルタイムクイズアプリを作ってみたWebSocketでリアルタイムクイズアプリを作ってみた
WebSocketでリアルタイムクイズアプリを作ってみた
 
良質なコードを高速に書くコツ
良質なコードを高速に書くコツ良質なコードを高速に書くコツ
良質なコードを高速に書くコツ
 
Heroku tips1
Heroku tips1Heroku tips1
Heroku tips1
 
Playframework1でSeleniumテスト
Playframework1でSeleniumテストPlayframework1でSeleniumテスト
Playframework1でSeleniumテスト
 
Heroku Dyno再起動時の振る舞い
Heroku Dyno再起動時の振る舞いHeroku Dyno再起動時の振る舞い
Heroku Dyno再起動時の振る舞い
 
Herokuで使えるRDBMS管理者ツール
Herokuで使えるRDBMS管理者ツールHerokuで使えるRDBMS管理者ツール
Herokuで使えるRDBMS管理者ツール
 
Play1 to Play2
Play1 to Play2Play1 to Play2
Play1 to Play2
 
お手軽Ajaxアプリケーションの作り方
お手軽Ajaxアプリケーションの作り方お手軽Ajaxアプリケーションの作り方
お手軽Ajaxアプリケーションの作り方
 
Herokuのログ解析ツール
Herokuのログ解析ツールHerokuのログ解析ツール
Herokuのログ解析ツール
 
Excel2 canvas
Excel2 canvasExcel2 canvas
Excel2 canvas
 
特盛!Heroku
特盛!Heroku特盛!Heroku
特盛!Heroku
 
文字コードのお話
文字コードのお話文字コードのお話
文字コードのお話
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
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...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
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
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

Dyno cycling behavior of Heroku

  • 2.  We run a production service on Heroku ◦ Playframework 1.2.5 ◦ Multiple dynos  Sometimes following error is logged, when dyno is cycling. ◦ This error happens when play receives a request after shutdown. ◦ But frequency is very rare. I've discussed about this problem with Heroku support team. This document explains its detail. play.exceptions.UnexpectedException: Application is not started
  • 3.  At the shutdown time, Play does nothing to Netty.  After app shutdowned, Netty still alive and can accept new request.(But always returns 503)  When shutdown process takes a few seconds, there is a possibility to accept new request and return 503. Normally this duration is nearly zero sec. But rarely takes a few seconds.
  • 4.  https://devcenter.heroku.com/articles/dynos  Heroku router may send a request after SIGTERM. ◦ When it failed to connect, the request send to other dynos. ◦ When it received 503, it is accepted.
  • 5.  Playframework ◦ Play should stop Netty before app shutdown. ◦ There is no way to stop Netty by application developer.  Heroku ◦ Heroku shouldn’t send request after SIGTERM. ◦ It is out of control for application developer. Though it may be possible to fix playframework, it is better to handle this problem by Heroku side. (Because other framework may have same problem.)
  • 6.  This is a great feature of Heroku labs. ◦ https://devcenter.heroku.com/articles/labs-preboot  Preboot changes Heroku restarting behavior ◦ Before: Kill old dynos, then boot new dynos. ◦ After: Boot new dynos first.
  • 7.  Target ◦ Web dynos only ◦ At least two web dynos are required.  When ◦ git push ◦ heroku config:set ◦ heroku restart It doesn’t apply at cycling…
  • 8.  Currently there is no way to avoid this problem radically…  Our service features. ◦ Mostly used in Japan. ◦ So at the midnight(JST), its traffic is not so high.  If I can control the time of cycling to midnight(JST), it may reduce error possibility. ◦ Though original frequency is not so high, I want to reduce error possibility as much as possible.
  • 9.  https://github.com/gregburek/heroku- buildpack-toolbelt  It installs Heroku Toolbelt to dyno.  So it allows one to run heroku command by Heroku scheduler.
  • 10.  Daily at 18:30 (3:30 JST) ◦ vendor/heroku-toolbelt/bin/heroku restart web.1 -a xxx  Daily at 19:00 (4:00 JST) ◦ vendor/heroku-toolbelt/bin/heroku restart web.2 -a xxx Delay the timing of restarting multiple dynos. This settings can reduce daytime cycling. But it doesn't mean the daytime cycling will never occur. e.g. if Heroku detects a fault in underlying hardware, it will be cycling.
  • 11.  To solve this problem radically, I hope Heroku to either of following. ◦ Don’t send request to dyno after SIGTERM. ◦ Apply preboot at cycling.