how to calculate TPS

19,292

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.

Share:
19,292

Related videos on Youtube

Abhisek
Author by

Abhisek

Updated on June 28, 2022

Comments

  • Abhisek
    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
    Abhisek almost 13 years
    thanks for your response. can you please show me one calculation of this so I can better understand this logic,...................
  • Patrick87
    Patrick87 almost 13 years
    Actually, 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
    user3287801 almost 13 years
    1ms 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
    Alex Gitelman almost 13 years
    Devil is in details. I guess we will say 1 to 199 inclusive.
  • Patrick87
    Patrick87 almost 13 years
    Hah, I was thinking the same thing, but forgot to come back to this again.