I am using JMeter(in distributed mode) for load testing. Its a React web application and mongo db database. Application server and database server are two different images.
If i put 1 user's load, application server reaches 100%. If i put 100 user's load, server reaches 100%. However, sometimes, if rerun the same test, CPU usage comes less and it fluctuates often
Irrespective of number of user, CPU sometimes reaches 100% and sometimes it gives different values for the same tests. Please do let me know what can be the reason behind it.
I tried running it for different users.
If you're telling us that if you open your application in browser with 1 user the CPU load on the application server machine is 100% then you need to use a profiler tool on the backend side to see what causes that high CPU usage.
If you cannot reproduce the issue using real browser and can reproduce it with 1 user using JMeter it means that JMeter is not configured to behave like a real browser therefore your test doesn't make sense.
Instead of comparing CPU usage with 1 and 100 users I would recommend starting with 1 user and gradually increasing the load keeping an eye on other metrics (response time, number of requests per second, number of errors, etc.) When you reach the saturation point and identify the first bottleneck you should identify the reason for this