the war on latency
play

The War on Latency Reducing Dead Time Kirk Pepperdine Principle - PowerPoint PPT Presentation

Kodewerk tm Java Performance Services The War on Latency Reducing Dead Time Kirk Pepperdine Principle Kodewerk Ltd. Me Work as a performance tuning freelancer Nominated Sun Java Champion www.kodewerk.com kirk.blog-city.com


  1. Kodewerk tm Java Performance Services The War on Latency Reducing Dead Time Kirk Pepperdine Principle Kodewerk Ltd.

  2. Me Work as a performance tuning freelancer Nominated Sun Java Champion www.kodewerk.com kirk.blog-city.com www.javaperformancetuning.com Other stuff (google if you care to)

  3. Java Performance Tuning Chania Crete Kodewerk May 18-21 tm Java Performance Services

  4. Public Service Announcement The resemblance of any opinion, recommendation or comment made during this presentation to performance tuning advice is merely coincidental

  5. Latency Affects Abandonment Shopzilla, 5 second improvement resulted in 25% increase in page view 10% increase in revenue 50% reduction in hardware Amazon reports every 100ms costs 1% in sales

  6. Defining Latency Time that elapses between a stimulus and the response to it data latency (end user response time) i/o latency (disk and network) cache latency synchronization Goal: find and minimize latency goal is to find and eliminate dead time or time spent waiting for something to happen

  7. The Box Actors Conceptional model of a Usage patterns system Application Visualize components of Locks, external systems the system JVM/OS Visualize interactions Memory, Hardware between components management Hardware Understand how each CPU, Memory, Disk IO, layer contributes latency Network when components are good citizens, we’ll experience good performance when component are not good citizens, we’ll experience poor performance Look at monitoring data and ask, what does it mean in the box use that information to help guide our search for latency

  8. Latency and The Box Actors Defined by Usage Patterns Usage patterns drives load on the Application system Locks, external systems Data latency shows up here JVM/OS response time Memory, Hardware management Hardware Key measure of system performance CPU, Memory, Disk IO, Network All performance decisions are guided by the user experience starting trigger and ending condition

  9. Latency and The Box Actors Bundle of non-sharable Usage patterns resources Application Defines finite capacity of the Locks, external systems system JVM/OS compute speeds Memory, Hardware management data capacities Hardware data transfer speeds CPU, Memory, Disk IO, Network We can’t go faster than our hardware nonsharable = Queuing Everything else will prevent us from going fas

  10. Latency and The Box Actors OS Usage patterns hardware management Application and provisioning Locks, external systems JVM JVM/OS transform instructions Memory, Hardware management into machine code Hardware memory management CPU, Memory, Disk IO, Network memory management is the important item thread scheduling, interrupt handling, interacting with devices

  11. Latency and The Box Actors Translates user intent into a Usage patterns sequence of instructions Application Protects non-sharable soft Locks, external systems resources JVM/OS lock induced latency Memory, Hardware management Interactions with external Hardware systems CPU, Memory, Disk IO, Network All performance decisions are guided by the user experience External systems may show up as a kernel problem or as parked threads thread pools as this level

  12. Finding Latency Actors Trigger Usage patterns actors experience poor Application response time Locks, external systems Action JVM/OS find the dominating Memory, Hardware management consumer of the CPU Hardware CPU, Memory, Disk IO, Network All performance decisions are guided by the user experience

  13. Dominating Consumer Actors Application Usage patterns JVM Application OS Locks, external systems JVM/OS No dominating consumer Memory, Hardware Monitor cpu (both user and management Hardware system) and GC activity CPU, Memory, Disk IO, Network All performance decisions are guided by the user experience

  14. Applicaton as Dominator Actors CPU user time is high Usage patterns Efficient Java memory Application management Locks, external systems Object creation rates are JVM/OS reasonable Memory, Hardware management Hardware CPU, Memory, Disk IO, Network 1.2G/sec on this machine

  15. Localizing Latency Actors JVM dominates when Usage patterns GC throughput is low Application less than 90% Locks, external systems JVM/OS high full to partial GC ratio Memory, Hardware management Hardware object creation rates are high CPU, Memory, Disk IO, Network 1.2 gigs is about all this machine will tolerate

  16. Localizing Latency Actors OS dominates when system Usage patterns cpu Application exceeds 10% Locks, external systems is 50% or greater than JVM/OS that of user cpu time Memory, Hardware management Hardware CPU, Memory, Disk IO, Network 1.2 gigs is about all this machine will tolerate

  17. Localizing Latency Actors No dominating consumer Usage patterns means threads are parked waiting for something Application Locks, external systems calls to external systems JVM/OS locks Memory, Hardware management thread pool starvation Hardware CPU, Memory, Disk IO, Network 1.2 gigs is about all this machine will tolerate

  18. Diagnosing Latency Actors Application - execution Usage patterns profile Application JVM Locks, external systems gc tuning JVM/OS memory profiling Memory, Hardware management Hardware OS - thread dumps and/or execution profiling CPU, Memory, Disk IO, Network 1.2 gigs is about all this machine will tolerate

  19. Diagnosing Latency Actors No dominating consumer Usage patterns what is keeping threads Application out of the CPU? Locks, external systems JVM/OS Memory, Hardware management Hardware CPU, Memory, Disk IO, Network debuggable question

  20. Big Gains First How can we remove 100ms from 500ms time budget 100ms servlet 150ms business logic 250ms EJB 500ms DB focus on layer with largest contribution

  21. Time Budgets Build a layer by layer, Client component by component 1 8 time budget 5-4 DB response time 2 7 Application Server 6-3 Apps view of DB 3 6 response time 4 5 etc..... DataBase dominating consumer tells us the nature of the problem time budgets tell us where the problem is

  22. Common Sources of Latency Java Memory Management Network I/O (JDBC) Disk I/O (Logging) Shared data structures

  23. Java Memory Management Java heap allocated out of C heap one large contiguous piece of RAM Objects are allocated out of Java heap Java heap fills up triggering a garbage collection cycle mark and sweep

  24. Mark & Sweep GC Traverse OOP table GC GC clear mark bit in each Root Root object OOP Table compaction?

  25. Mark & Sweep GC From GC root mark GC all reachable objects Root OOP Table compaction?

  26. Mark & Sweep GC Traverse OOP table GC releasing all unmarked Root objects. OOP Table compaction?

  27. GC Optimizations Parallel GC (throughput) Concurrent GC (pause time) Incremental Weak generational hypothesis generational GC G1GC

  28. Generation Spaces Eden S1 S2 Tenured Perm dominating consumer tells us the nature of the problem time budgets tell us where the problem is

  29. Generational Spaces Eden S1 S2 Tenured Perm dominating consumer tells us the nature of the problem time budgets tell us where the problem is

  30. Generational Spaces Eden S1 S2 Tenured Perm dominating consumer tells us the nature of the problem time budgets tell us where the problem is

  31. Generational Spaces Eden S1 S2 Tenured Perm dominating consumer tells us the nature of the problem time budgets tell us where the problem is

  32. Generational Spaces Eden S1 S2 Tenured Perm dominating consumer tells us the nature of the problem time budgets tell us where the problem is

  33. Generation Spaces Eden S1 S2 Tenured Perm dominating consumer tells us the nature of the problem time budgets tell us where the problem is

  34. G1GC dominating consumer tells us the nature of the problem time budgets tell us where the problem is

  35. G1GC dominating consumer tells us the nature of the problem time budgets tell us where the problem is

  36. Talking Points Young generational guarantee Fragmentation compaction phase Sizing to avoid disruptive pauses pause time goals throughput goals

  37. Talking Points Space efficiency zombies Completeness floating garbage Object nepotism tenured garbage

  38. Bad Stuff Unintentional object retention Object with no semantic meaning to the application is never released Loitering objects objects that will go away long after you want them to Local caches

  39. Things That Help Narrow scope of all variables fits to weak generational hypothesis Don’t swap during GC lock VM into memory Improve object locality use large pages

  40. Benchmarking GC Mix Parallel Parallel G1 Pressure Parallel CMS old 7775 11138 32800 young 1406 1302 3400 object 7275 7195 20835 creation

  41. I/O Interactions with devices that are 1000s of orders of magnitudes slower than local interactions Threads suspended waiting for I/O no dominating consumer Thrash on I/O OS becomes the dominating consumer

  42. Disk I/O Mechanical device optimized for chunky sized sequential reads Use buffered input/output Reduce load Compress data (trade CPU for disk) Stripe to increase throughput

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend