1

We need to load test our servers and our goal is to simulate 100K concurrent users. I have created a junit script that receives a NUM_OF_USERS parameter and runs the script against our servers.

Problem is we need a large magnitude of users (100K) and a single pc that runs this test can probably do a 1000 users only.

How can we perfeorm this task? any tools for that?

P.S - It would be really good if we could run this junit test from multiple pcs and not using a tool that need to configured with the relevant parameters.. (we spent a lot of time creating this script and would like to avoid transitioning to a different tool)

Urbanleg
  • 6,252
  • 16
  • 76
  • 139

2 Answers2

0

As you can understand opening 100K threads is not possible. However you do not really need 100K threads. Human users act relatively slowly. The perform maximum action per 10 seconds or something like that.

So, you can create probably 100 threads but each of them should simulate 1000 users. How to simulate? You can hold 1000 objects that represent user's state, go on the list either sequentially or randomly, take the next user's action and perform it.

You can implement this yourself or use Actors model framework, e.g. Akka.

If you do not want to use Akka right now you can just improve the first solution using JMeter. You can implement plugin to JMeter where you can use the same logic that simulates several users in one thread, but the thread pool will be managed my JMeter. As a benefit you will get reports, time measurements and configurable load.

AlexR
  • 114,158
  • 16
  • 130
  • 208
  • Your methodology is problematic, since my test is creating a rest call that the user is executing, now the problem is that each call like this is blocking (using restTemplate), so not real concurrency here – Urbanleg Jun 25 '14 at 09:09
  • It is OK to use this methology with rest calls. How long does REST call take? 0.1 sec? 0.5 sec? How many clicks does one user do per minute? 5? 10? Let's take min-max case: user performs 10 clicks a minute, each click takes 0.5 seconds. So, you are blocked on IO 5 sec per minute, so 1 thread can simulate 12 users. But this is the worse case. If user performs 5 clicks and each click takes 0.1 sec each thread can simulate 120 users, so you need approximately 800 threads. BTW JMetter helps you to distribute the calls. My other suggestion - Akka uses NIO, so one thread can serve a lot of users. – AlexR Jun 25 '14 at 09:25
0

You do not need to simulate 100k users to have an approximate idea of what the performance would be for 100k users. As your simulation will not exactly mimic real users, you are already accepting some inaccuracy, so why not go further?

You could measure the performance with 100, 300 and 1000 simulated users (which you say your computer will manage), and see the trend. That is, you could create a performance model, and use that model to estimate the performance by extrapolation. The cost of a computation (in CPU time or memory, for example) can be approximated by a power law:

C = C0 N^p

where C is the cost, C0 is an unknown cost constant, N is the problem size (the number of users, for your case) and p is an unknown number (probably in the range 0 to 2).

Raedwald
  • 46,613
  • 43
  • 151
  • 237