How can I find the average number of concurrent users for IIS to simulate during a load/performance test?

一世执手 提交于 2019-11-30 20:54:24

I can see a couple options here.

  1. Use Performance Monitor to get the current numbers or have it log all day and get an average. ASP.NET has a Requests Current counter. According to this page Classic ASP also has a Requests current, but I've never used it myself.

  2. Run the IIS logs through Log Parser to get the total number of requests and how long each took. I'm thinking that if you know how many requests come in each hour and how long each took, you can get an average of how many were running concurrently.

Also, keep in mind that concurrent users isn't quite the same as concurrent threads on the server. For one, multiple threads will be active per user while content like images is being downloaded. And after that the user will be on the page for a few minutes while the server is idle.

You might use logparser with the QUANTIZE function to determine the peak number of requests over a suitable interval.

For a 10 second window, it would be something like:

logparser "select quantize(to_localtime(to_timestamp(date,time)), 10) as Qnt,
    count(*) as Hits from yourLogFile.log group by Qnt order by Hits desc"

The reported counts won't be exactly the same as threads or users, but they should help get you pointed in the right direction.

The best way to do exact counts is probably with performance counters, but I'm not sure any of the standard ones works like you would want -- you'd probably need to create a custom counter.

My suggestion is that you define the stop conditions first, such as

  • Maximum CPU utilization
  • Maximum memory usage
  • Maximum response time for requests
  • Other key parameters you like

It is really subjective to choose the parameters and I personally cannot provide much experience on that.

Secondly you can see whether performance counters or IIS logs can map to the parameters. Then you set up proper mappings.

Thirdly you can start testing by simulating N users (threads) and see whether the stop conditions hit. If not hit, you can go to a higher number. If hit, you can use a smaller number. Recursively you will find a rough number.

However, that never means your web site in real world can take so many users. No simulation so far can cover all the edge cases.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!