how to calculate TPS
Suppose you want to run 50 TPS for 100 seconds. You can have 5 threads that would send 1 transaction every 100 ms for 100 seconds. You,however, want to randomize the process little bit to prevent threads sending transactions at the same time. So the process for each tread would be
- Send a transaction
- Wait random time between 1 and 199 ms inclusive (to average 100ms)
- Repeat as long as required
That will give you average 50 TPS reasonably distributed in time. You can play around with thread count and other numbers to achieve your specific goal.
Related videos on Youtube
Abhisek
Updated on June 28, 2022Comments
-
Abhisek almost 2 years
I have to built an application in java which will handle load testing on a particular application. Here we can give certain parameters like TPS (Transaction Per Second) Time (in secs) and Number of Request. I am giving you some scenario like TPS = 5 Time=100 No of Request=500. Or TPS=10 Time=100 No of request=1000
But this request I have sent using multiple Thread so the process can give the fill of concurrent transaction. My question is how to create the logic to create this. I am developing my program in java.
-
Abhisek almost 13 yearsthanks for your response. can you please show me one calculation of this so I can better understand this logic,...................
-
Patrick87 almost 13 yearsActually, the time spent waiting needs to be between 1 and 200 ms. Otherwise, the average time between sends will be 50, and the TPS will be 100, not 50.
-
user3287801 almost 13 years1ms to 200ms produces a mean wait of 100.5ms, not 100ms. I realize this is minor, but it's also minor to fix.
-
Alex Gitelman almost 13 yearsDevil is in details. I guess we will say 1 to 199 inclusive.
-
Patrick87 almost 13 yearsHah, I was thinking the same thing, but forgot to come back to this again.