Ask Sawal

Discussion Forum
Notification Icon1
Write Answer Icon
Add Question Icon

How to convert tph to tps?

1 Answer(s) Available
Answer # 1 #

If your average transaction time for 7 transactions is 16 seconds it means you can do 7/16 transactions per second, using a single virtual user.

To get 10,000 transactions in an hour you would have to use multiple concurrent virtual users.

In this case we know total_transactions but not VU, so we rewrite it to:

Using the numbers we have, we get:

I.e. you need more than 6 VUs to get 10k transactions in one hour. Maybe go for 10 VUs and insert some sleep time as necessary to hit the exact 10,000 transactions.

How much sleep time and how many iterations would you get then?

10 users executing at 7 transactions per 16 seconds for one hour would execute a total of 10 * 7/16 * 3600 = 15,750 transactions. We need to slow the users down a bit. We need to make sure they don't do the full 7/16 transactions per second. We can use the formula again:

We need to make sure the VUs only do 0.28 TPS, rather than 7/16 (0.44) TPS.

Your script does 7 transactions in 16 seconds, to get 7/16 (0.44) TPS.

To find out how much time the script needs to take, we then change it to:

Currently, your script takes 16 seconds, but we need it to take 25 seconds, so you need to add 9 seconds of sleep time.


10 VUs, executing 7 transactions in 25 seconds, over the course of an hour, would produce 10,000 transactions:

The number of script iterations each VU would perform would be:

Phil mfau