Ostermueller | Troubleshooting Java Performance | E-Book | www2.sack.de
E-Book

E-Book, Englisch, 204 Seiten

Ostermueller Troubleshooting Java Performance

Detecting Anti-Patterns with Open Source Tools
1. ed
ISBN: 978-1-4842-2979-8
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark

Detecting Anti-Patterns with Open Source Tools

E-Book, Englisch, 204 Seiten

ISBN: 978-1-4842-2979-8
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark



Troubleshoot the most widespread and pernicious Java performance problems using a set of open-source and freely-available tools that will make you dramatically more productive in finding the root causes of slow performance. This is a brief book that focuses on a small number of performance anti-patterns, and you'll find that most problems you encounter fit into one of these anti-patterns. The book provides a specific method in a series of steps referred to as the 'P.A.t.h. Checklist' that encompasses persistence, alien systems, threads, and heap management. These steps guide you through a troubleshooting process that is repeatable, that you can apply to any performance problem in a Java application. This technique is especially helpful in 'dark' environments with little monitoring.
Performance problems are not always localized to Java, but often fall into the realms of database access and server load. This book gives attention to both of these issues through examples showing how to identify repetitive SQL, and identify architecture-wide performance problems ahead of production rollout.  Learn how to apply load like an expert, and determine how much load to apply to determine whether your system scales. Included are walk-throughs of a dozen server-side performance puzzles that are ready to run on your own machine. Following these examples helps you learn to:Assess the performance health of four main problems areas in a Java system: The P.A.t.h. Checklist presents each area with its own set of plug-it-in-now tools
Pinpoint the code at fault for CPU and other bottlenecks without a Java profilerFind memory leaks in just minutes using heapSpank, the author's open-source leak detector utility that is freely available from heapSpank.orgThe repeatable method provided in this book is an antidote to lackluster average response times that are multi-second throughout the industry. This book provides a long absent, easy-to-follow, performance training regimen that will benefit anyone programming in Java. 
What You'll LearnAvoid the 6 most common ways to mess up a load test
Determine the exact number of threads to dial into the load generator to test your system's scalability
Detect the three most common SQL performance anti-patterns
Measure network response times of calls to back-end systems ('alien systems')
Identify whether garbage collection performance is healthy or unhealthy and whether delays are caused by problems in the old or new generation, so you know which generation needs to be adjusted
Who This Book Is For
Intermediate and expert Java developers and architects. Java experts will be able to update their skill set with the latest and most productive, open-source Java performance tools. Intermediate Java developers are exposed to the most common performance defects that repeatedly show up in Java applications, ones that account for the bulk of slow-performing systems.  Experts and intermediates alike will benefit from the chapters on load generation.

Erik Ostermueller is a Java architect who is passionate about performance engineering. He has spent the last 10 years leading international performance engineering teams, tuning high-throughput Java financial systems in North and South America, Europe and Asia. In 2011, he presented a paper entitled 'How to Help Developers (Finally) Find Their Own Performance Defects' at the Computer Measurement Group's annual conference, where he won 'Best Paper' and the 'Mullen Award' for best speaker. The proceeds of this award financed an eight-city speaking tour in the US, Canada, the UK, and Italy. Erik is the technical lead for the Performance Center of Excellence at FIS Global. He is the founder of heapSpank.org, wuqiSpank.org, and a contributor to JMeter-Plugins.org and other open source projects. He lives in Little Rock, Arkansas and plays soccer, tennis, and the piano.

Ostermueller Troubleshooting Java Performance jetzt bestellen!

Autoren/Hrsg.


Weitere Infos & Material


1;Contents at a Glance;5
2;Contents;7
3;About the Author;14
4;About the Technical Reviewer;15
5;Acknowledgments;16
6;Introduction;17
7;Part I: Getting Started with Performance Tuning;23
7.1;Chapter 1: Performance Anti-Patterns;24
7.1.1;Main Performance Anti-Patterns;24
7.1.2;Main Anti-Pattern #1: Unnecessary Initialization;25
7.1.3;Main Anti-Pattern #2: Strategy/Algorithm Inefficiency;26
7.1.4;Main Anti-Pattern #3: Overprocessing;27
7.1.5;Main Anti-Pattern #4: Large Processing Challenge;28
7.1.5.1;Assessing the Size of a Processing Challenge;28
7.1.6;Using the Main Performance Anti-Patterns;29
7.1.7;Don’t Forget;30
7.1.8;What’s Next;30
7.2;Chapter 2: A Modest-sized Tuning Environment;31
7.2.1;Rapid Tuning;31
7.2.2;Write-Once-Run-Anywhere Performance Defects;32
7.2.3;Tuning Environment for Developers;33
7.2.4;Network;35
7.2.5;Stubbing Out Back-end Systems;36
7.2.5.1;Stubbing Out HTTP Back-ends with Wiremock;37
7.2.6;Local Load Generation;39
7.2.6.1;Quick Overview of Load Generation;39
7.2.6.2;Load Generator Responsibilities;39
7.2.7;CPU Consumption by PID;40
7.2.8;Comparison Metrics;42
7.2.9;Don’t Forget;43
7.2.10;What’s Next;43
7.3;Chapter 3: Metrics: The Antidote to Guesswork;44
7.3.1;Which Metric?;44
7.3.2;Setting Direction for Tuning;45
7.3.3;The Backup Plan: Indirect Performance Assessment with Load Generator Metrics;46
7.3.3.1;Large Payloads are a Red Flag;46
7.3.3.2;Variability Is a Red Flag;47
7.3.4;Creatively Setting Direction for Tuning;48
7.3.4.1;Creative Test Plan 1;48
7.3.4.2;Creative Test Plan 2;49
7.3.5;Tracking Performance Progress;49
7.3.6;Don’t Forget;51
7.3.7;What’s Next;51
8;Part II: Creating Load Scripts and Load Testing;52
8.1;Chapter 4: Load Generation Overview;53
8.1.1;The Load Generator;54
8.1.1.1;Correlation Variables;54
8.1.1.2;Sequencing Steps in a Load Script;55
8.1.2;The First Priority Script;56
8.1.2.1;Load Scripts and SUT Logons;56
8.1.2.2;Using the Same SUT User in Multiple Threads;57
8.1.3;Second Priority;58
8.1.3.1;Load Script Stage 1;58
8.1.3.1.1;Details;58
8.1.3.1.2;Validating HTTP Responses;58
8.1.3.2;Load Script Stage 2;58
8.1.3.2.1;Details;59
8.1.3.3;Load Script Stage 3;59
8.1.3.3.1;Details;59
8.1.3.4;Load Script Stage 4;61
8.1.4;Invite Skepticism;61
8.1.5;Project Lifecycle Hints;62
8.1.6;Don’t Forget;62
8.1.7;What’s Next;63
8.2;Chapter 5: Invalid Load Tests;64
8.2.1;Network Issues;64
8.2.2;Container Issues;65
8.2.3;Insufficient Warmup;68
8.2.4;Maxed-Out Hardware Resources;68
8.2.5;Virtualization Issues;68
8.2.6;Wrong Workload Issues;70
8.2.7;Load Script Errors;71
8.2.8;Don’t Forget;72
8.2.9;What’s Next;73
8.3;Chapter 6: A Scalability Yardstick;74
8.3.1;Creating a Scalability Yardstick Load Plan;74
8.3.1.1;Interpreting Results;77
8.3.2;Imperfect and Essential;80
8.3.2.1;Reproducing Bad Performance;80
8.3.3;Good and Bad CPU Consumption;81
8.3.4;Don’t Forget;82
8.3.5;What’s Next;83
8.4;Chapter 7: JMeter Must-Know Features;84
8.4.1;Love Letter to JMeter;85
8.4.2;Using jmeter-plugins.org Is a Must;87
8.4.3;PerfMon;88
8.4.4;JMeter user.properties Is Your Friend;90
8.4.5;JMeter Introduction;91
8.4.6;UI Features for Working Quickly;93
8.4.7;Functional Validation During Load Test Using JMeter Assertions;94
8.4.8;Script Variables;97
8.4.9;Saving Performance Results to Disk;98
8.4.9.1;How to Avoid Redundant Copies of Huge Files;100
8.4.9.2;Right-Sizing Output Files for Heavy Debugging or High Throughput;101
8.4.10;Recording an HTTP Script;103
8.4.11;Debugging an HTTP Recording;106
8.4.12;Load Testing Java Directly and Debugging;107
8.4.13;JMeter Sandbox;108
8.4.14;JMeter Sandbox with One Graph;110
8.4.15;JMeter Sandbox / Multiple Metrics on Same Graph;110
8.4.16;JMeter Sandbox for Testing Correlation Variables;113
8.4.16.1;Fishing Expedition—Step One, Find the Data Item;114
8.4.16.2;Fishing Expedition—Step Two;116
8.4.17;Prerequisites;118
8.4.18;Don’t Forget;120
8.4.19;What’s Next;120
9;Part III: The P.A.t.h. Checklist and Performance Troubleshooting;121
9.1;Chapter 8: Introduction to the P.A.t.h. Checklist;122
9.1.1;Quick Review;122
9.1.2;Working the P.A.t.h. Checklist;124
9.1.3;Running the Examples;126
9.1.4;Java Performance Troubleshooting (jpt) Sample App;126
9.1.5;littleMock Sample Application;128
9.1.6;Don’t Forget;129
9.1.7;What’s Next;130
9.2;Chapter 9: Persistence, the “P” in P.A.t.h.;131
9.2.1;Test 05: Performance Issues with One SQL;131
9.2.2;Performance Issues with Multiple SQL Statements;133
9.2.2.1;The First Issue: SELECT N+1;134
9.2.2.1.1;Five Variations of SELECT N+1 Load Tests;135
9.2.2.1.2;Chunky Outperforms Chatty;138
9.2.2.1.3;Chunky Doesn’t Always Perform Well;138
9.2.2.1.4;Detecting SELECT N+1;139
9.2.2.2;The Second Issue: Uncached SELECTS to Static Data;140
9.2.3;JPA and Hibernate;142
9.2.4;Don’t Forget;143
9.2.5;What’s Next;143
9.3;Chapter 10: Alien Systems, the “A” in P.A.t.h.;144
9.3.1;Lowering Response Time over Long Distances;144
9.3.1.1;Compression Makes Things Go Faster;144
9.3.1.2;Security Warning for Compression with HTTPS;147
9.3.1.3;Message Size;147
9.3.2;Using Thread Dumps to Detect Network Requests;148
9.3.3;Quantifying Response Time;149
9.3.4;Identifying Clear Text Payloads That Could Benefit from Compression;150
9.3.5;Don’t Forget;151
9.3.6;What’s Next;152
9.4;Chapter 11: Threads, the “t” in P.A.t.h.;153
9.4.1;Current use of Thread Dumps;153
9.4.2;Threads and Thread Dumps;154
9.4.2.1;Navigating Thread Dumps;155
9.4.2.1.1;Key Landmarks in a Stack Trace;155
9.4.2.1.2;Thread Names are Helpful;157
9.4.2.1.3;Focus on the Threads under Load;157
9.4.3;Manual Thread Dump Profiling (MTDP);158
9.4.3.1;Example 1;159
9.4.3.2;Sample Size and Healthy Skepticism;161
9.4.4;MTDP Demonstration;162
9.4.5;Navigating Unfamiliar Code;164
9.4.5.1;Leveraging the Four Anti-Patterns;165
9.4.5.2;Interactive Thread Dump Reading Exercise;165
9.4.5.3;How to Make Code Faster;167
9.4.6;Limitations;168
9.4.6.1;How Much Load?;169
9.4.7;Distinguishing High Throughput and Slow Stack Traces;169
9.4.8;MTDP and Other Examples;169
9.4.9;Don’t Forget;171
9.4.10;What’s Next;171
9.5;Chapter 12: Heap, the “h” in P.A.t.h.;172
9.5.1;Quick GC Health Check;172
9.5.1.1;The Traditional Approach to GC Metrics;173
9.5.1.2;Garbage Collector Overview;174
9.5.1.3;Plug-It-in-Now GC Metrics with jstat;175
9.5.1.3.1;Configuring littleMock Performance with Test Keys;176
9.5.1.3.2;Optimizing Young Gen GC;176
9.5.1.3.3;Optimizing Old Gen GC;177
9.5.2;Heap Trending;180
9.5.3;Using JVM Parameters to Size the Heap;181
9.5.3.1;Caution Using NewRatio;183
9.5.3.2;Blindly Increasing -Xmx;184
9.5.4;Reclaiming Unused RAM;184
9.5.5;Memory Leaks;186
9.5.6;Troubleshooting Memory Leaks;186
9.5.7;Heap Dump Analysis;188
9.5.7.1;Capturing a Heap Dump;188
9.5.7.2;Using Eclipse MAT to Find Memory Leaks;189
9.5.7.3;Eclipse MAT Automatic Leak Detection;189
9.5.7.4;Exploring in Eclipse MAT;191
9.5.7.5;Kinds of Leaks;194
9.5.8;Heap Troubleshooting, Step-by-Step;195
9.5.9;Don’t Forget;196
9.6;Chapter 13: Conclusion;198
9.6.1;Steps for Getting Started;198
9.6.2;Using this Book with Large Monitoring Tools;199
9.6.3;3t0tt (3 Threads of Load, Zero Think Time);200
9.6.4;One Last Word;200
10;Index;201



Ihre Fragen, Wünsche oder Anmerkungen
Vorname*
Nachname*
Ihre E-Mail-Adresse*
Kundennr.
Ihre Nachricht*
Lediglich mit * gekennzeichnete Felder sind Pflichtfelder.
Wenn Sie die im Kontaktformular eingegebenen Daten durch Klick auf den nachfolgenden Button übersenden, erklären Sie sich damit einverstanden, dass wir Ihr Angaben für die Beantwortung Ihrer Anfrage verwenden. Selbstverständlich werden Ihre Daten vertraulich behandelt und nicht an Dritte weitergegeben. Sie können der Verwendung Ihrer Daten jederzeit widersprechen. Das Datenhandling bei Sack Fachmedien erklären wir Ihnen in unserer Datenschutzerklärung.