Book Image

Docker High Performance - Second Edition

By : Allan Espinosa, Russ McKendrick
Book Image

Docker High Performance - Second Edition

By: Allan Espinosa, Russ McKendrick

Overview of this book

Docker is an enterprise-grade container platform that allows you to build and deploy your apps. Its portable format lets you run your code right from your desktop workstations to popular cloud computing providers. This comprehensive guide will improve your Docker work?ows and ensure your application's production environment runs smoothly. This book starts with a refresher on setting up and running Docker and details the basic setup for creating a Docker Swarm cluster. You will then learn how to automate this cluster by using the Chef server and cookbooks. After that, you will run the Docker monitoring system with Prometheus and Grafana, and deploy the ELK stack. You will also learn best practices for optimizing Docker images. After deploying containers with the help of Jenkins, you will then move on to a tutorial on using Apache JMeter to analyze your application's performance. You will learn how to use Docker Swarm and NGINX to load-balance your application, and how common debugging tools in Linux can be used to troubleshoot Docker containers. By the end of this book, you will be able to integrate all the optimizations that you have learned and put everything into practice in your applications.
Table of Contents (16 chapters)
Title Page
Copyright and Credits
About Packt
Contributors
Preface
Index

Chapter 7. Load Balancing

No matter how we tune our Docker applications, we will reach our application's performance limits. Using the benchmarking techniques we discussed in the previous chapter, we should be able to identify the capacity of our application. In the near future, our Docker application's users will exceed this limit. We cannot turn these users away just because our Docker application cannot handle their requests anymore. We need to scale out our application so that it can serve our growing number of users.

In this chapter, we will talk about how to scale out our Docker applications to increase our capacity. We will use load balancers, which are a key component in the architecture of various web scale applications. Load balancers distribute our application's users to multiple Docker applications deployed in our farm of Docker hosts. The following steps covered in this chapter will help us to accomplish this:

  • Preparing application backends
  • Balancing load with NGINX
  • Scaling out...