If my total number of threads are 100 i.e 100 requests are being sent to application with say in 100 seconds. So requests are made to server but is there any formula which can give concurrent users simulated when 100 requests/threads are sent by jmeter? How many concurrent users are accessing the system?
I don't think you can calculate it. Instead try to monitor it. All web-servers should a way to monitor current number of active connections. Start monitoring, start JMeter tests, check results.
JMeter users do not compare to real users as load-tests do not simulate real users. Real users have random think times on each action, while most load tests fire requests as fast as they can.
Load-testing is more about finding bottlenecks in your infrastructure and which part scale badly. Therefor I would ramp-up virtual users until it breaks and find out why it breaks. Then think about if this would be a problem in the production environment.
If you have already have visit statistics like page requests per second on a comparable system then you perhaps can calculate how many virtual users are enough to represent an realistic test, but wonder if this is what you want to test.
This depends on the ramp up period as well. For example if the total number of threads are 100 and ramp up period is given as 5, then this equals to 20 threads getting executed per second.
So if you want all the 100 Users to act in a second, give the ramp up period as 1. Although even this doesn't ensure concurrency.
For closer results and simulation use the Synchronous Timer.
Let's split your question into 2 parts:
- Concurrent users
- Requests per second
Concurrency depends on your test plan and application response time. JMeter acts as follows:
- It starts all threads within specified ramp-up period
- Each thread starts executing samplers upside down (or according to Logic Controllers)
- When thread doesn't have any more samplers to execute or loops to iterate it is being shut down
So if you add 100 users make sure your test plan run long enough so all of them could have a chance to act simultaneously. You can use JMeter HTML Reporting Dashboard or Active Threads Over Time Listener in order to monitor actual concurrency. See JMeter Test Results: Why the Actual Users Number is Lower than Expected article for more detailed explanation.
Requests per second also depends on application response time. For example, if you have 100 virtual users and application response time is 1 second - you will able to send 100 requests per second as JMeter samplers are waiting for the server response. If response time will be 2 seconds - you will be able to send 50 requests per second, etc. Concurrency can be controlled via Constant Throughput Timer or Throughput Shaping Timer and monitored via Server Hits Per Second graph or aforementioned HTML Reporting Dashboard
In JMeter Thread Group you can use Ram Up Period (In Seconds) field to calculate how many request you want to send to server.
Please follow below calculation to understand the concept:
Number of threads(users) = 10 Ramp up period(in seconds) = 100 Loop Count = 1
(Ramp-up Period/Number of threads)*Loopcount
As per above formula
(100/10) = 10
So every 10 seconds one request will hit the server with one thread user, eventually threads are up and running ,each 10 seconds one request is hit by the thread users.
Total number of hits by users is :10 hits to server because 10 users will hit 1 request for every 10 seconds.
Please read here it has given details with examples to prepare your test plan very clearly: http://www.wikishown.com/ramp-period-in-jmeter/.