SlideShare a Scribd company logo
1 of 18
Running Production Apps on HerokuRunning Production Apps on Heroku
Jason Lee, Customer AdvocateJason Lee, Customer Advocate
@jglee081@jglee081
Greg Nokes, Technical Account ManagerGreg Nokes, Technical Account Manager
@tsykoduk@tsykoduk
Purpose, Expectations and AssumptionsPurpose, Expectations and Assumptions
This is the first of a two part series on running production applications. We
want you to be armed with the tools and knowledge to get the most out of
Heroku.
-Today we will be covering more basic concepts and making sure the
foundation of your critical app is set.
-Our next webinar will take a deeper dive.
-We assume that you have cursory Heroku knowledge and are familiar with
our terminology and command line.
IntroductionsIntroductions
Jason Lee
Customer Advocate
@jglee081
Greg Nokes
Technical Account Manager
@tsykoduk
AgendaAgenda
 Production App Necessities – 30 min
 Log-runtime-metrics Demo – 10 min
 Q&A – 10 min
What is a Production App?What is a Production App?
 Out of Development
 Emphasizes uptime
 Response time is important
Production App NecessitiesProduction App Necessities
• Concurrency at the dyno level
• Monitoring
• Security
• Concurrency within a dyno
• Appropriate dyno size
• Database Size and Failover
Concurrency at the Dyno levelConcurrency at the Dyno level
 With 1 dyno your application will idle, at 2+ we remove idling.
 With two or more dynos we can handle server health issues by
restarting dynos and re-deploying your code. Traffic will be load
balanced and sent to healthy dynos.
 Heroku will re-deploy your application, this happens invisibly to
you
MonitoringMonitoring
 Very important for trouble shooting, scaling, and maximizing
uptime
 Three recommended types of monitoring
 Performance
 Logging
 Exception Tracking
SecuritySecurity
 SSL(Secure Socket Layer)
 https://devcenter.heroku.com/articles/ssl-endpoint
Concurrency within a dynoConcurrency within a dyno
 Why is this important?
 Web dynos have a built in 30 second timeout, which generates an
H12 error.
 It’s important to keep queuing to a minimum. A single threaded dyno
can become blocked up with long running requests.
 We recommend requests that average ½ second or more be moved
to a worker dyno.
 Solution is a concurrent Webserver. Unicorn for Ruby, gunicorn
for Python
Tuning UnicornTuning Unicorn
 Trade off of Unicorn is in the memory consumption
 By default we recommend 3 workers. For best results you’ll
want to tune your app for the maximum number of unicorn
workers while still staying safely below the 512mb cap
 Configuring Timeouts
 Unicorn Timeout, this will kill your process.
 Rack Timeout gem will kill off long running requests in
your dyno
Visibility ToolsVisibility Tools
 Two Great resources.
 Log2viz –
 Log-runtime-metrics -
Appropriate Dyno SizeAppropriate Dyno Size
 You’ll want at least 3 unicorn workers per dyno.
 At a certain size you may want more RAM and CPU shares. At
that point upgrading to 2x dynos becomes an option.
 At scale it’s better to have 2x dynos and reduce the overall
dyno count
Database Size and FailoverDatabase Size and Failover
 You must be on a Production DB plan(Crane or higher)
 More Robust, better supported, provides uptimes tools, allocated cache
memory, ability to create followers
 Determine the size of your DB by doing cache hit checks.
 You’ll want that ratio to be 99% or better.
 Use pg_extras to find those numbers
 Follower Databases
 We back everything up with postgres writeaheadlogs
 This provides instant failover
 Provides performance boost by splitting reads
ResourcesResources
 Log2viz: https://blog.heroku.com/archives/2013/3/19/log2viz
 Log-runtime-metrics: https://devcenter.heroku.com/articles/log-runtime-metrics
 Getting started with unicorn: https://devcenter.heroku.com/articles/rails-unicorn
 Follower database: https://devcenter.heroku.com/articles/heroku-postgres-follower-
databases
 Which postgres plan is right for you? https://devcenter.heroku.com/articles/heroku-
postgres-plans
 Production Check: https://devcenter.heroku.com/articles/production-check
 Building apps efficiently blog post:
https://blog.heroku.com/archives/2013/6/12/building_apps_efficiently_on_heroku
 Bloat Script used in demo: https://github.com/tsykoduk/hello_world
Q&AQ&A
Jason Lee
Customer Advocate
Greg Nokes
Technical Account Manager

More Related Content

Recently uploaded

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
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
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
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.pdfsudhanshuwaghmare1
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
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
 
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...DianaGray10
 
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 challengesrafiqahmad00786416
 
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 WorkerThousandEyes
 
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 businesspanagenda
 
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
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
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
 

Recently uploaded (20)

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
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
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
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
 
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...
 
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
 
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
 
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...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
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
 

Featured

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
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellSaba Software
 

Featured (20)

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
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 

Running Production Apps on Heroku 6.27.13

  • 1. Running Production Apps on HerokuRunning Production Apps on Heroku Jason Lee, Customer AdvocateJason Lee, Customer Advocate @jglee081@jglee081 Greg Nokes, Technical Account ManagerGreg Nokes, Technical Account Manager @tsykoduk@tsykoduk
  • 2. Purpose, Expectations and AssumptionsPurpose, Expectations and Assumptions This is the first of a two part series on running production applications. We want you to be armed with the tools and knowledge to get the most out of Heroku. -Today we will be covering more basic concepts and making sure the foundation of your critical app is set. -Our next webinar will take a deeper dive. -We assume that you have cursory Heroku knowledge and are familiar with our terminology and command line.
  • 4. AgendaAgenda  Production App Necessities – 30 min  Log-runtime-metrics Demo – 10 min  Q&A – 10 min
  • 5. What is a Production App?What is a Production App?  Out of Development  Emphasizes uptime  Response time is important
  • 6. Production App NecessitiesProduction App Necessities • Concurrency at the dyno level • Monitoring • Security • Concurrency within a dyno • Appropriate dyno size • Database Size and Failover
  • 7. Concurrency at the Dyno levelConcurrency at the Dyno level  With 1 dyno your application will idle, at 2+ we remove idling.  With two or more dynos we can handle server health issues by restarting dynos and re-deploying your code. Traffic will be load balanced and sent to healthy dynos.  Heroku will re-deploy your application, this happens invisibly to you
  • 8. MonitoringMonitoring  Very important for trouble shooting, scaling, and maximizing uptime  Three recommended types of monitoring  Performance  Logging  Exception Tracking
  • 9. SecuritySecurity  SSL(Secure Socket Layer)  https://devcenter.heroku.com/articles/ssl-endpoint
  • 10. Concurrency within a dynoConcurrency within a dyno  Why is this important?  Web dynos have a built in 30 second timeout, which generates an H12 error.  It’s important to keep queuing to a minimum. A single threaded dyno can become blocked up with long running requests.  We recommend requests that average ½ second or more be moved to a worker dyno.  Solution is a concurrent Webserver. Unicorn for Ruby, gunicorn for Python
  • 11. Tuning UnicornTuning Unicorn  Trade off of Unicorn is in the memory consumption  By default we recommend 3 workers. For best results you’ll want to tune your app for the maximum number of unicorn workers while still staying safely below the 512mb cap  Configuring Timeouts  Unicorn Timeout, this will kill your process.  Rack Timeout gem will kill off long running requests in your dyno
  • 12. Visibility ToolsVisibility Tools  Two Great resources.  Log2viz –  Log-runtime-metrics -
  • 13.
  • 14. Appropriate Dyno SizeAppropriate Dyno Size  You’ll want at least 3 unicorn workers per dyno.  At a certain size you may want more RAM and CPU shares. At that point upgrading to 2x dynos becomes an option.  At scale it’s better to have 2x dynos and reduce the overall dyno count
  • 15. Database Size and FailoverDatabase Size and Failover  You must be on a Production DB plan(Crane or higher)  More Robust, better supported, provides uptimes tools, allocated cache memory, ability to create followers  Determine the size of your DB by doing cache hit checks.  You’ll want that ratio to be 99% or better.  Use pg_extras to find those numbers  Follower Databases  We back everything up with postgres writeaheadlogs  This provides instant failover  Provides performance boost by splitting reads
  • 16.
  • 17. ResourcesResources  Log2viz: https://blog.heroku.com/archives/2013/3/19/log2viz  Log-runtime-metrics: https://devcenter.heroku.com/articles/log-runtime-metrics  Getting started with unicorn: https://devcenter.heroku.com/articles/rails-unicorn  Follower database: https://devcenter.heroku.com/articles/heroku-postgres-follower- databases  Which postgres plan is right for you? https://devcenter.heroku.com/articles/heroku- postgres-plans  Production Check: https://devcenter.heroku.com/articles/production-check  Building apps efficiently blog post: https://blog.heroku.com/archives/2013/6/12/building_apps_efficiently_on_heroku  Bloat Script used in demo: https://github.com/tsykoduk/hello_world
  • 18. Q&AQ&A Jason Lee Customer Advocate Greg Nokes Technical Account Manager

Editor's Notes

  1. We would also love to hear back from you as far as what other topics you’d like to hear about.
  2. What do you see your customers use for monitoring
  3. -You absolutely need the ability to handle requests concurrently. The reason why is slow running requests will block up your dynos and almost certainly lead to over provisioning and unnecessary queuing. -If using a single threaded language like ruby or python, a concurrent webserver is recommended. Specifically Unicorn or gUnicorn. -This will add a layer of intelligent routing into the dynos - The tradeoff here is that you’ll be increasing the memory footprint inside each application exponentially and you’ll need to do some tuning to make sure you don’t exceed the 512 default and get the most bang for your buck. - You can tune using a number of resources - log2viz and log-runtime-metrics. Find the footprint of one app and multiply while still staying under the cap
  4.