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

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
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...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Featured

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
Kurio // The Social Media Age(ncy)
 
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
Saba 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.