Throughput is the amount of productive work done by your application in a given time period. This brings the question what is productive work? What is non-productive work?
Productive Work: This is basically the amount of time your application spends in processing your customer’s transactions.
Non-Productive Work: This is basically the amount of time your application spend in house-keeping work, primarily Garbage collection.
Let’s say your application runs for 60 minutes. In these 60 minutes, let’s say 2 minutes is spent on GC activities.
It means application has spent 3.33% on GC activities (i.e. 2 / 60 * 100), it means application throughput will become 96.67% (i.e. 100 – 3.33).
What causes poor throughput?
When application suffers from one of the following problems, its throughput will degrade:
- Long GC pauses
- Memory Leak
- Consecutive Full GC
- Application waiting for CPU & I/O resources
1. Long GC Pauses
When application experiences long GC pauses, then throughput will degrade. To understand what causes long GC pauses and how to reduce them, please refer to this article.
2. Memory Leak
When application experiences a memory leak, JVM will start to invoke Full GCs repeatedly. When Full GCs are invoked repeatedly, then the application will be spending more time on the Garbage collection than in processing the customer transactions. Here is an article which talks about how to diagnose memory leak?.
3. Consecutive Full GC
Sometimes, Full GCs might run consecutively in your application. When they run consecutively, throughput of the application degrades as Full GC takes time to run. Here is an article which talks about consecutive Full GCs & how to eliminate it?
4. Application waiting for CPU & I/O resources
If multiple processes are running on the server where your application is running then, there is possibility that your application might be crunched for CPU & I/O cycles. Under such circumstances also application’s throughput will degrade. To learn more about this problem, see this article.
May 19, 2021 at 10:05 am
Please tell the formula you use for calculating throughput and how I can create a cisualisation in kibana for same using timelion
May 29, 2021 at 11:39 pm
Hello Amber!
I am going to break your question in two parts.
Part 1: How to calculate throughput?
Let’s say an application is running for 100 minutes and in that 100 minutes, if it spends 2 minute cumulatively in gargbage collection *pauses*, then this application’s GC throughput is 98%. Formula is:
GC Throughput % = 100 – Percentage of time spent in Garbage collection
Part 2: Can I report this data in Kibana?
Yes, sure you can do it. You can use our REST API: https://blog.gceasy.io/2016/06/18/garbage-collection-log-analysis-api/ – in this REST API, GC Throughput % and other KPIs of GC are reported.
April 29, 2017 at 1:18 am
Nice article!