ebook img

Docker High Performance PDF

157 Pages·2016·3.226 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Docker High Performance

Docker High Performance Master performance enhancement practices for Docker, and unlock faster and more efficient container deployment that will improve your development workflow Allan Espinosa BIRMINGHAM - MUMBAI Docker High Performance Copyright © 2016 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: January 2016 Production reference: 1220116 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78588-680-5 www.packtpub.com [ FM-2 ] Credits Author Project Coordinator Allan Espinosa Milton Dsouza Reviewer Proofreader Shashikant Bangera Safis Editing Acquisition Editor Indexer Aaron Lazar Monica Ajmera Mehta Content Development Editor Graphics Rashmi Suvarna Jason Monteiro Technical Editors Production Coordinator Vijin Boricha Nilesh Mohite Humera Shaikh Cover Work Nilesh Mohite Copy Editor Shruti Iyer [ FM-3 ] About the Author Allan Espinosa is a DevOps practitioner living in Tokyo. He is an active open source contributor to various distributed systems tools, such as Docker and Chef. Allan maintains several Docker images for popular open source software that were popular even before their official release from the upstream open source groups. In his career, Allan has worked on large distributed systems containing hundreds to thousands of servers in production. He has built scalable applications on various platforms ranging from large supercomputing centers in the U.S. to production enterprise systems in Japan. Allan can be contacted through his Twitter handle @AllanEspinosa. His personal website at http://aespinosa.github.io contains several blog posts on Docker and distributed systems in general. I would like to thank my wife, Kana, for the continuous support that allowed me to spend significant time writing this book. [ FM-4 ] About the Reviewer Shashikant Bangera is a DevOps architect with 16 years of experience in the IT sector. He has had a vast exposure to DevOps tools with core expertise in open source DevOps tools. Shashikant has worked on a large number of multimillion-pound projects. He helped in making the transition from employing traditional development practices to adopting agile tooling and processes that increase the release frequency and quality of software. Moreover, Shashikant has designed an automated on-demand environment with open source tools. He has hands-on experience with a variety of DevOps tools across the domain. Shashikant has also reviewed the book Learning Docker by Packt Publishing. [ FM-5 ] www.PacktPub.com Support files, eBooks, discount offers, and more For support files and downloads related to your book, please visit www.PacktPub.com. Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub. com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details. At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks. TM https://www2.packtpub.com/books/subscription/packtlib Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books. Why subscribe? • Fully searchable across every book published by Packt • Copy and paste, print, and bookmark content • On demand and accessible via a web browser Free access for Packt account holders If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view 9 entirely free books. Simply use your login credentials for immediate access. [ FM-6 ] Table of Contents Preface v Chapter 1: Preparing Docker Hosts 1 Preparing a Docker host 1 Working with Docker images 2 Building Docker images 3 Pushing Docker images to a repository 4 Pulling Docker images from a repository 6 Running Docker containers 7 Exposing container ports 7 Publishing container ports 9 --publish-all 9 --publish 10 Linking containers 11 Interactive containers 12 Summary 14 Chapter 2: Optimizing Docker Images 15 Reducing deployment time 16 Improving image build time 19 Using registry mirrors 19 Reusing image layers 22 Reducing the build context size 28 Using caching proxies 30 Reducing Docker image size 33 Chaining commands 33 Separating build and deployment images 35 Summary 39 [ i ] Table of Contents Chapter 3: Automating Docker Deployments with Chef 41 An introduction to configuration management 41 Using Chef 43 Signing up for a Chef server 44 Setting up our workstation 46 Bootstrap nodes 48 Configuring the Docker host 50 Deploying Docker containers 54 Alternative methods 58 Summary 59 Chapter 4: Monitoring Docker Hosts and Containers 61 The importance of monitoring 62 Collecting metrics to Graphite 63 Graphite in production 67 Monitoring with collectd 68 Collecting Docker-related data 71 Running collectd inside Docker 74 Consolidating logs in an ELK stack 74 Forwarding Docker container logs 79 Other monitoring and logging solutions 81 Summary 82 Chapter 5: Benchmarking 83 Setting up Apache JMeter 84 Deploying a sample application 84 Installing JMeter 87 Building a benchmark workload 89 Creating a test plan in JMeter 89 Analyzing benchmark results 92 Viewing the results of JMeter runs 92 Calculating throughput 92 Plotting response time 94 Observing performance in Graphite and Kibana 95 Tuning the benchmark 99 Increasing concurrency 99 Running distributed tests 100 Other benchmarking tools 102 Summary 102 Chapter 6: Load Balancing 103 Preparing a Docker host farm 103 Balancing load with Nginx 105 [ ii ] Table of Contents Scaling out our Docker applications 108 Deploying with zero downtime 110 Other load balancers 114 Summary 114 Chapter 7: Troubleshooting Containers 115 Inspecting containers 115 Debugging from the outside 119 Tracing system calls 119 Analyzing network packets 122 Observing block devices 124 A stack of troubleshooting tools 127 Summary 128 Chapter 8: Onto Production 129 Performing web operations 129 Supporting web applications with Docker 131 Deploying applications 133 Scaling applications 134 Further reading 135 Summary 135 Index 137 [ iii ]

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.