Continuous Integration/Continuous Deployment (CI/CD) has become central to software development. To ensure high-quality software releases smoke tests, regression tests, performance tests, static code analysis & security scans are run in CI/CD pipeline. Despite of all these quality measures, still applications are facing OutOfMemoryError, CPU spikes, unresponsiveness, degradation in response time in production environment.
These sort of performance problems surfaces in production because in CI/CD pipeline only macro level metrics such as: Static code quality metrics, test/code coverage, CPU Utilization, memory consumption, response time??? are studied. In this article let???s review the micrometrics that should be studied in CI/CD pipeline to delivery high quality releases in production. We will also learn how to source this micrometrics and integrate it in to CI/CD pipeline.
How Tsunamis are forecasted?
You might wonder why Tsunami forecasting is related to this article. There is a relationship :-). A normal sea wave travels at a speed of 5 ??? 60 miles/hr, whereas Tsunami waves travel at a speed of 500 ??? 600 miles/hr. Even though Tsunami wave travels at a speed of 10x ??? 100x speed of normal waves, it???s very hard to forecast Tsunami waves. Thus, modern day technologies use micrometrics to forecast to Tsunami waves. Multiple DART (Deep-ocean Assessment and Reporting of Tsunami) devices are installed all throughout the world.
DART contains two parts:
a. Surface Buoy: Device which floats at the top of ocean water
b. Seabed Monitor: Device which is stationed at the bottom of the ocean
Deep ocean water is about 6000 meters in depth. (20x of tallest San Francisco Sales Force tower). Whenever the sea level raises more than 1 mm then DART automatically detects it and transmits this information to satellite. This 1 mm raise in sea water is a lead indicator of Tsunami origination. I would like to request you to pause here for a second and visualize length of 1 mm in the scale of 6000 meters sea depth. It???s nothing, negligible. But this micrometric analysis is what used for forecasting Tsunamis.
How to forecast Performance Tsunamis through Micrometrics?
Similarly, there are few micrometrics that you can monitor in your CI/CD pipeline. This micrometrics are lead indicators of several performance problems that you will face in production. Raise or drop in values of these micrometrics are the great indicators for the origination of performance problems.
1. Garbage Collection Throughput
2. Average GC pause time
3. Maximum GC pause time
4. Object creation rate
5. Peak heap size
6. Thread Count
7. Thread States
8. Thread Groups
9. Wasted Memory
10. Object Count
11. Class Count
Let???s study each micrometrics in detail:
1. GARBAGE COLLECTION THROUGHPUT
Garbage Collection throughout is the amount of time your application spends in processing customer transactions vs amount of time your application spends in doing garbage collection.
Let???s say your application has been running for 60 minutes. In this 60 minutes, 2 minutes is spent on GC activities.
It means application has spent 3.33% on GC activities (i.e. 2 / 60 * 100)
It means Garbage Collection throughput is 96.67% (i.e. 100 ??? 3.33).
When there is a degradation in the GC throughput, it???s an indication of some sort of memory problem. Now the question is: What is the acceptable throughput %? It depends on the application and business demands. Typically, one should target for more than 95% throughput.
2. AVERAGE GARBAGE COLLECTION PAUSE TIME
When Garbage Collection event runs, entire application pauses. Because Garbage Collection has to mark every object in the application, see whether those objects are referenced, if no one is referencing then will be evicted from memory. Then fragmented memory is compacted. To do all these operations, application will be paused. Thus when Garbage collection runs, customer will experience pauses/delays. Thus one should always target to attain low average GC pause time.