# TPS

## What is TPS?

Usually **T**ransaction **P**er **S**econd (TPS), which plays an important role in load testing, shows the number of processes completed in one second. In other words, it can be calculated based on how many transactions are executed over a certain duration of the test and then calculate it for a second.

TPS (Transaction per Second) and response times are related. The following relationship is between TPS, concurrent virtual users and response time:

&#x20;$$TPS = Virtual User / (response time + think time )$$

![Jmeter - Transaction Per Second](https://33973752-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MUOy4kHWrKkuqX5mhH7%2F-Ma7hJXwfE3DaYJ4jU4W%2F-Ma7i_Glq2m69r0PWSjc%2Fimage.png?alt=media\&token=0a3d2198-1d01-4598-8c46-25c1fce32963)

The graph below shows the average response time as 800ms.

If we calculate TPS, 5 / 0.8sec = 6.25 TPS (VirtualUser / Response Time = TPS)

![Jmeter Aggregate Report](https://33973752-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MUOy4kHWrKkuqX5mhH7%2F-Ma7hJXwfE3DaYJ4jU4W%2F-Ma7j5GVyg7757rzGaHE%2Fimage.png?alt=media\&token=c72092a4-3786-4c73-a901-fd3b8c7ecb5c)

## **How to Use TPS**

In this example we will use jmeter

Create -> JMeter Test -> Limit TPS

<figure><img src="https://33973752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUOy4kHWrKkuqX5mhH7%2Fuploads%2FjKl3SHyBlrVFnMW58sXB%2Fimage.png?alt=media&#x26;token=2d30394c-b7ef-42f6-960e-24149e1a0f4b" alt=""><figcaption></figcaption></figure>

We enter that value as much as we want to limit TPS.

<figure><img src="https://33973752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUOy4kHWrKkuqX5mhH7%2Fuploads%2FRa31wL3gq7bnOhRfVuGF%2Fimage.png?alt=media&#x26;token=365188dd-9f1e-4d0a-9bc9-17148defbd2b" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
The value entered as the limit is multiplied by the number of engines used in the test. For example, since this test runs with 2 engines, a limit value of 2 will be reflected in the report as 2 × 2 = 4.

<p align="center"><img src="https://33973752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUOy4kHWrKkuqX5mhH7%2Fuploads%2F9ON6meVdIxq4kn5FazZL%2Fimage.png?alt=media&#x26;token=330ff028-1b90-4c76-bb5b-36bcda5dc4d0" alt=""></p>
{% endhint %}

We run the test.

You can see the hit values in the "Hits & Errors" graph in the Overview in the test report.

<figure><img src="https://33973752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUOy4kHWrKkuqX5mhH7%2Fuploads%2FViKMTqMCBnY2x7mjeCxj%2Fimage.png?alt=media&#x26;token=63502574-0375-4122-9972-045c37ed5717" alt=""><figcaption></figcaption></figure>

At the same time, we can see that the "Avg. Throughput" value in the "Overview" tab is limited to 3.39.

<figure><img src="https://33973752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUOy4kHWrKkuqX5mhH7%2Fuploads%2F1TaNIA3H66AAEftB2QwL%2Fimage.png?alt=media&#x26;token=e423f5d4-8fba-4dda-8bc1-499aa0bd2126" alt=""><figcaption></figcaption></figure>

If we run the same test without TPS limit, we can see that the "Avg. Throughput" value is quite high, as seen below.

<figure><img src="https://33973752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MUOy4kHWrKkuqX5mhH7%2Fuploads%2FbKnYHfVCBcWnkqxh53hR%2Fimage.png?alt=media&#x26;token=68041085-831a-4e15-86ca-b8181f98132f" alt=""><figcaption></figcaption></figure>

In summary, TPS in the performance test cannot be used as a performance metric alone. Transaction on execution time can be analyzed by comparing TPS with average transaction response time.

If you don't see the answer to your question here, please [reach out to us](https://loadium.com/contact-us/) to let us know! We're always improving our documentation.
