You are previewing Docker High Performance.
O'Reilly logo
Docker High Performance

Book Description

Master performance enhancement practices for Docker, and unlock faster and more efficient container deployment that will improve your development workflow

About This Book

  • Implement a scalable Docker infrastructure that has been optimized for greater efficiency

  • Tackle the challenges of large-scale container deployment with this fast-paced guide

  • Extend your capabilities as a developer to take full advantage of Docker and containerization

  • Who This Book Is For

    If you are a software developer with a good understanding of managing Docker services and the Linux file system and are looking for ways to optimize working with Docker containers, then this is the book for you.

    What You Will Learn

  • Tune your Dockerfiles and optimize the performance and size of your Docker containers

  • Configure and tune your Docker hosts at scale with Chef

  • Deploy containers without downtime using load balancers

  • Listen to your Docker container and host logs with an ELK stack

  • Monitor the performance of your Docker containers with collectd

  • Benchmark the performance of your web application containers with Apache JMeter

  • Troubleshoot and diagnose containers using standard Linux diagnostic tools

  • Prepare for production with the most effective DevOps practices

  • In Detail

    Docker is a portable container format that allows you to run code anywhere from your desktop to the cloud. The workflow around Docker makes development, testing, and deployment much easier and much faster. However, it’s essential that you know the best practices most techniques for optimization so Docker can help you deploy your application most effectively.

    This comprehensive guide will improve your Docker workflows and will ensure your application’s production environment runs smoothly. It starts with a short refresher on working with Docker, then you will learn how to take this basic knowledge to the next level by optimizing your Docker infrastructure and applications at scale. At the end of the book, we will put the concepts and everything you have learned about Docker’s features into practice by rolling out supplementary monitoring and troubleshooting instrumentation to your infrastructure. All of these things will ensure your application succeeds using Docker.

    Style and approach

    This is a comprehensive guide on real-world Docker workflows, and each topic is explained in an easy step-by-step format, accompanied by screenshots where required.

    Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.

    Table of Contents

    1. Docker High Performance
      1. Table of Contents
      2. Docker High Performance
      3. Credits
      4. About the Author
      5. About the Reviewer
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers, and more
          1. Why subscribe?
          2. Free access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      8. 1. Preparing Docker Hosts
        1. Preparing a Docker host
        2. Working with Docker images
          1. Building Docker images
          2. Pushing Docker images to a repository
          3. Pulling Docker images from a repository
        3. Running Docker containers
          1. Exposing container ports
          2. Publishing container ports
            1. --publish-all
            2. --publish
          3. Linking containers
          4. Interactive containers
        4. Summary
      9. 2. Optimizing Docker Images
        1. Reducing deployment time
        2. Improving image build time
          1. Using registry mirrors
          2. Reusing image layers
          3. Reducing the build context size
          4. Using caching proxies
        3. Reducing Docker image size
          1. Chaining commands
          2. Separating build and deployment images
        4. Summary
      10. 3. Automating Docker Deployments with Chef
        1. An introduction to configuration management
        2. Using Chef
          1. Signing up for a Chef server
          2. Setting up our workstation
          3. Bootstrap nodes
        3. Configuring the Docker host
        4. Deploying Docker containers
        5. Alternative methods
        6. Summary
      11. 4. Monitoring Docker Hosts and Containers
        1. The importance of monitoring
        2. Collecting metrics to Graphite
          1. Graphite in production
        3. Monitoring with collectd
          1. Collecting Docker-related data
            1. Running collectd inside Docker
        4. Consolidating logs in an ELK stack
        5. Forwarding Docker container logs
        6. Other monitoring and logging solutions
        7. Summary
      12. 5. Benchmarking
        1. Setting up Apache JMeter
          1. Deploying a sample application
          2. Installing JMeter
        2. Building a benchmark workload
          1. Creating a test plan in JMeter
        3. Analyzing benchmark results
          1. Viewing the results of JMeter runs
            1. Calculating throughput
            2. Plotting response time
          2. Observing performance in Graphite and Kibana
        4. Tuning the benchmark
          1. Increasing concurrency
          2. Running distributed tests
        5. Other benchmarking tools
        6. Summary
      13. 6. Load Balancing
        1. Preparing a Docker host farm
        2. Balancing load with Nginx
        3. Scaling out our Docker applications
          1. Deploying with zero downtime
        4. Other load balancers
        5. Summary
      14. 7. Troubleshooting Containers
        1. Inspecting containers
        2. Debugging from the outside
          1. Tracing system calls
          2. Analyzing network packets
          3. Observing block devices
        3. A stack of troubleshooting tools
        4. Summary
      15. 8. Onto Production
        1. Performing web operations
        2. Supporting web applications with Docker
        3. Deploying applications
        4. Scaling applications
        5. Further reading
        6. Summary
      16. Index