Reputation: 689
I am using YCSB for benchmarking MongoDB and I want to check its performance with multiple users. How do I simulate concurrent users? Are number of threads in the config file of YCSB denoting the concurrent users? Please help
Upvotes: 0
Views: 449
Reputation: 9517
Yes, and no. Increasing the number of threads will generally increase the throughput of your application but throughput and user concurrency are two very different things. This is because of "think time". When a user visits a web application he will need a certain amount of time to read the content of the page and respond to it (filling out a form, clicking a link, etc.).
Determining the amount of think time in order to approximate the number of concurrent users is probably going to be a wild guess at best, unless you have existing metrics that can be used to determine the average think time. This is also further complicated by the fact that your back-end servicing time for different page requests will also likely vary widely.
You also cannot reasonably increase the number of threads to be excessively high. You will need to take into consideration the number of cores available on the machine. At a certain point increasing the number of threads will have diminishing returns because of the cost of context switching.
Your best bet (IMO) is to start by performing throughput tests with varying numbers of threads to gather throughput metrics and identify any performance bottlenecks in your system. If all you need is a rough calculation of concurrent users, you can probably just extrapolate those numbers to approximate the number of concurrent users.
If you want to perform concurrency tests a tool such as Apache JMeter may be a better fit as it will allow you to construct more sophisticated, multi-step scripts which can include think time. That will more accurately simulate real user activity. YCSB is a very narrow focused benchmark and will not come close to simulating real world queries and user behavior.
So just as an example, you might configure a test with 64 threads and determine that the average throughput is 25,000 transactions per second. If we assume that our user think time is 15 seconds, that would equate to approximately 375,000 "concurrent" users (25000 * 15).
Upvotes: 1