Book Details

ISBN 139781782177944

Paperback232 pages

Book Description

Heroku is a Platform as a Service that enables developers to rapidly deploy and scale their web applications. Heroku is designed for developer happiness, freeing developers from doing system administrative tasks such as configuring servers and setting up load balancers. Developers are able to focus on what they do best, building web applications, while leaving the details of deployment and scaling to the experts at Heroku.

This practical guide is packed with step-by-step solutions to problems faced by every production-level web application hosted on Heroku. You'll quickly get comfortable with managing your Heroku applications from the command line and then learn everything you need to know to deploy and administer production-level web applications.

Table of Contents

Chapter 1: Getting Started with Heroku

Introduction

Installing the Heroku Toolbelt

Introducing version control with Git

Deploying a Rails application to Heroku

Deploying a Node.js application to Heroku

Introducing dynos, workers, and scaling

Chapter 2: Managing Heroku from the Command Line

Introduction

Viewing application logs

Searching logs

Installing add-ons

Managing environment variables

Enabling the maintenance page

Managing releases and rolling back

Running one-off tasks and dynos

Managing SSH keys

Sharing and collaboration

Monitoring load average and memory usage

Chapter 3: Setting Up a Staging Environment

Introduction

Duplicating an existing application

Managing git remotes

Password protection for a Rails app

Deploying with Heroku labs – Pipeline

Deploying from tags

Continuous integration and deployment with Travis CI

Chapter 4: Production-ready with Heroku

Introduction

Managing domains from the command line

Configuring DNS with CloudFlare

Setting up SSL with CloudFlare

Enabling preboot for seamless deploys

Enabling custom maintenance and error pages

Setting up a status page

Setting up log draining with LogEntries

Chapter 5: Error Monitoring and Logging Tools

Introduction

Checking Heroku's status

Adjusting Rails's logging level

Storing historical logs with PaperTrail

Monitoring for 404 and 500 errors with PaperTrail

Logging slow queries with PaperTrail

Monitoring uptime with Pingdom

Logging errors with Rollbar

Chapter 6: Load Testing a Heroku Application

Introduction

Monitoring dyno performance with Librato

Monitoring application performance with New Relic

Learning to load test with Siege

Configuring complex load tests with Siege

Load testing from the cloud with Blitz.io

Testing real-user scenarios with Load Impact

Chapter 7: Optimizing Ruby Server Performance on Heroku

Introduction

Setting up and running Unicorn on Heroku

Monitoring and tuning Unicorn's memory usage

Tuning Unicorn's backlog for Heroku

Timing out long requests with Unicorn

Setting up and running Puma on Heroku

Running Puma with Rubinius for parallelism

Chapter 8: Optimizing a Rails Application on Heroku

Introduction

Setting up a sample blogging app

Using Heroku Deflater to gzip assets

Serving assets from Amazon Web Services (AWS) Cloudfront

Adding memcached to a Rails application

Adding Redis to a Rails application

Implementing low-level caching in Rails

Caching rendered views

Aborting long requests with Rack::Timeout

Using a follower for read-only DB queries

Chapter 9: Using and Administrating Heroku Postgres

Introduction

Creating and sizing a new database

Promoting a Heroku database

Connecting to Heroku Postgres from Navicat

Connecting to Heroku Postgres from psql

Creating a database backup

Restoring from a backup

Creating a read-only follower

Viewing and stopping database processes

Analyzing Heroku Postgres's performance

Chapter 10: The Heroku Platform API

Introduction

Making our first API request with HTTPie

Getting started with the Platform API gem

Scaling dynos and workers

Managing configuration variables

Adding and removing collaborators

Creating new Heroku applications

What You Will Learn

Administer and debug any Heroku application

Comfortably deploy any type of web application

Master the Heroku command-line interface (CLI)

Identify and eliminate bottlenecks from your apps' performance

Load test and monitor application performance

Take full advantage of the Heroku add-on marketplace

Set up a deployment pipeline to get applications from development to production quickly

Authors

Mike Coutermarsh

Mike Coutermarsh has been building and deploying web applications for over 10 years. Originally from New Hampshire, he now works and lives in Boston, MA. As an early adopter of Heroku, he's been working with and writing about the technology for over 5 years. He works as a software engineer for Product Hunt (http://www.producthunt.com). Previously, he's built and scaled web applications at Gazelle (https://www.gazelle.com/) and was a cofounder of Taskk. When Mike isn't coding or writing, you will usually find him making the perfect cup of coffee, watching hockey, or at the gym.

Alerts & Offers

Series & Level

We understand your time is important. Uniquely amongst the major publishers, we seek to develop and publish the broadest range of learning and information products on each technology. Every Packt product delivers a specific learning pathway, broadly defined by the Series type. This structured approach enables you to select the pathway which best suits your knowledge level, learning style and task objectives.

Learning

As a new user, these step-by-step tutorial guides will give you all the practical skills necessary to become competent and efficient.

Beginner's Guide

Friendly, informal tutorials that provide a practical introduction using examples, activities, and challenges.

Essentials

Fast paced, concentrated introductions showing the quickest way to put the tool to work in the real world.

Cookbook

A collection of practical self-contained recipes that all users of the technology will find useful for building more powerful and reliable systems.

Blueprints

Guides you through the most common types of project you'll encounter, giving you end-to-end guidance on how to build your specific solution quickly and reliably.

Mastering

Take your skills to the next level with advanced tutorials that will give you confidence to master the tool's most powerful features.

Starting

Accessible to readers adopting the topic, these titles get you into the tool or technology so that you can become an effective user.

Progressing

Building on core skills you already have, these titles share solutions and expertise so you become a highly productive power user.