Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Threads and Concurrency
Identifying Performance Deviations in
Thread Pools
PRESENTED BY
158217G - PUSHPALANKA JAYAWARDHANA...
Line Up
 Objective
 Thread pools
 Performance deviations in thread pools
 Methodology
 Related work, results& limitat...
Objective
Introduce a methodology to identify threads with
performance deviations in thread pools.
Significance
 ULS syst...
Thread Pools
 What is a thread pools?
 Benefits of thread pools
 Thread creation/destroying overhead reduced
 Improved...
Performance Deviations in Thread
Pools
 Why is it hard to identify deviations?
 No detailed log entries
 Require thorou...
Method to Identify
 Iterative, top down approach
 Apply statistical analysis on resource usage logs
 Measure dissimilar...
Method in Detail
► More resource usage metrics
► More accurate understanding on behavior
► Higher level abstractions
► Poo...
Method in Detail
Click to add text
►Why Co-variance matrix?
► Robust to noise in the performance data
► Factor out time
► ...
Co-variance measures
 A measure of how much two random variables change together
9
CPUMem
Co-variance Ctd.. 10
M C H
source: http://images.wisegeek.com/black-desktop-computer.jpg, http://stattrek.com/matrix-algeb...
Method in Detail
Click to add text
► Merge the least distant abstraction to cluster
► Ward's method - least distance betwe...
Method in Detail
Click to add text
12
Method in Detail
► Recursivelyimprove the dendrogram via an algorithm
► Stops when clusters are in good fit
► Isolate the ...
Ranking Algorithm 14
Case Study - Background
 Qualitatively evaluate the deviated threads
 Calculate the precision & recall value
 Load test...
Case Study
Resource Measured
CPU CPU time usage as %
Virtual Bytes Virtual address space usage
Private Bytes Private memor...
Case Study 17
 Thread pool contains 40 threads
 Each process one work item
 Each item completion time two hours
 Threa...
Results - Qualitative 18
Results of first wave Ranking of waves
Results - Qualitative 19
 T1W1 in solid line
 T1W8 in dotted line
 T1W5 in dashed line
Virtual memory allocation
Results - Qualitative 20
T1W1 in detail
Results – Quantitative 21
Results Summary & Limitations
 High precision
 Identify IO & memory leaks
 identify CPU spikes
This evaluated has been ...
Summary
 Threads vs thread pools
 Benefits & risks related to thread pools
 Light weight statistical approach to detect...
Thank You..!
24
Hiding Complexity
 Android handler
 AsyncTask
25
Optional
An Experience On Multithreading Using Android's Handler Class
26
Qualitative Evaluation
 Selecting the abstractions to visualize based on ranking
 Normalizing the time scale
 Under sam...
Results – Average of All Test 28
Upcoming SlideShare
Loading in …5
×

Threads and Concurrency Identifying Performance Deviations in Thread Pools

809 views

Published on

This presentation is done with one my colleges as the guidance for a discussion on the referenced research paper.

Published in: Software
  • Be the first to comment

  • Be the first to like this

Threads and Concurrency Identifying Performance Deviations in Thread Pools

  1. 1. Threads and Concurrency Identifying Performance Deviations in Thread Pools PRESENTED BY 158217G - PUSHPALANKA JAYAWARDHANA 158248C - SALIYA SAMARAWICKRAMA Mark D. Syer, Bram Adams and Ahmed E. Hassan Reference: M. D. Syer, B. Adams, and A. E. Hassan,"Identifying performance deviations in thread pools," in Proceedings of the International Conference on Software Maintenance, sep 2011, pp. 83-92
  2. 2. Line Up  Objective  Thread pools  Performance deviations in thread pools  Methodology  Related work, results& limitations  Hiding the thread complexity  Summary 2
  3. 3. Objective Introduce a methodology to identify threads with performance deviations in thread pools. Significance  ULS systems vastly use thread pool pattern in high concurrent implementations  Isolating the deviating threads need immense effort source: http://farm3.static.flickr.com/2275/2153328067_2aeda0e4d2_m.jpg 3
  4. 4. Thread Pools  What is a thread pools?  Benefits of thread pools  Thread creation/destroying overhead reduced  Improved responsiveness  Issues related to thread pools  Idle threads  Dead locks  Thread leakages  Get the suitable tuning  No control over the state and priority of the thread source: https://www10.informatik.uni-erlangen.de/~buildscript/pe/trunk/doc/html/threadpool.png 4
  5. 5. Performance Deviations in Thread Pools  Why is it hard to identify deviations?  No detailed log entries  Require thorough knowledge on system architecture  Hard to detect concurrency issues  Hard to track threads in the pool in isolation  Lacking tool support  Require heavy instrumentation  Hard to interpret hardware sensor gathered data source: http://connect.greenbeacon.com/wp-content/uploads/2014/12/tracker.jpg, http://blog.infostruction.com/wp-content/uploads/2010/11/networksecurity.jpg 5
  6. 6. Method to Identify  Iterative, top down approach  Apply statistical analysis on resource usage logs  Measure dissimilarity between resource usage  Isolate the most deviating abstractions source: http://static2.xlstat.com/images/content/home-slides-03.jpg.pagespeed.ce.vt3YFEFWQF.jpg 6
  7. 7. Method in Detail ► More resource usage metrics ► More accurate understanding on behavior ► Higher level abstractions ► Pooled threads in one machine ► Threads created in one hour slot 7
  8. 8. Method in Detail Click to add text ►Why Co-variance matrix? ► Robust to noise in the performance data ► Factor out time ► compare load tests of deviating lengths 8
  9. 9. Co-variance measures  A measure of how much two random variables change together 9 CPUMem
  10. 10. Co-variance Ctd.. 10 M C H source: http://images.wisegeek.com/black-desktop-computer.jpg, http://stattrek.com/matrix-algebra/covariance-matrix.aspx 2 Forstner and Moonen Distance Matrix
  11. 11. Method in Detail Click to add text ► Merge the least distant abstraction to cluster ► Ward's method - least distance between cluster centroids after merge ► Stop when all in one cluster made 11
  12. 12. Method in Detail Click to add text 12
  13. 13. Method in Detail ► Recursivelyimprove the dendrogram via an algorithm ► Stops when clusters are in good fit ► Isolate the deviations 13
  14. 14. Ranking Algorithm 14
  15. 15. Case Study - Background  Qualitatively evaluate the deviated threads  Calculate the precision & recall value  Load test using synthetically injected deviations  System  ULA system in e-commerce domain  Time duration 16 hours 15
  16. 16. Case Study Resource Measured CPU CPU time usage as % Virtual Bytes Virtual address space usage Private Bytes Private memory usage Handles # of open file handles MicroThread # allocated micro threads 16  Sampled every 7 seconds  Each has  Thread ID  Time  Value of each resource usage
  17. 17. Case Study 17  Thread pool contains 40 threads  Each process one work item  Each item completion time two hours  Threads with identical life time grouped  Group called a “Wave”  Wave length 2 hours and 5 minutes  Observe 8 Waves  Using pvclust , hierarchical clustering done  Ranking done as per slide
  18. 18. Results - Qualitative 18 Results of first wave Ranking of waves
  19. 19. Results - Qualitative 19  T1W1 in solid line  T1W8 in dotted line  T1W5 in dashed line Virtual memory allocation
  20. 20. Results - Qualitative 20 T1W1 in detail
  21. 21. Results – Quantitative 21
  22. 22. Results Summary & Limitations  High precision  Identify IO & memory leaks  identify CPU spikes This evaluated has been done using a single softwaresystem, so this results may differ for other systems… 22
  23. 23. Summary  Threads vs thread pools  Benefits & risks related to thread pools  Light weight statistical approach to detect risks 23
  24. 24. Thank You..! 24
  25. 25. Hiding Complexity  Android handler  AsyncTask 25
  26. 26. Optional An Experience On Multithreading Using Android's Handler Class 26
  27. 27. Qualitative Evaluation  Selecting the abstractions to visualize based on ranking  Normalizing the time scale  Under sampling the metrics by averaging every two minutes to remove single-point anomalies and noise.  Plotting the under sampled metrics.  Plotting additional details, such as the average and standard deviation, as needed. The 27
  28. 28. Results – Average of All Test 28

×