sql2012 ssrs_SQL Server Reporting Services(SSRS)的负载测试

sql2012 ssrs

Performance monitoring is a very significant and essential topic for database or system administrators. This is no different with SSRS load testing. In some cases, performance problems can lead to significant system downtime. Most of the time in the background of the problem is having insufficient resources or improper settings. Therefore, before experiencing performance issues, we have to take some time to review preventive measures related to current system configurations or new installations. The load test (or stress test) is the most commonly used approach to tune systems before real-life staging conditions. Now we will discuss the details of load test, and in particular SSRS load testing.

对于数据库或系统管理员而言,性能监视是非常重要且必不可少的主题。 这与SSRS负载测试没有什么不同。 在某些情况下,性能问题可能导致大量的系统停机。 在问题的背景下,大多数时候资源不足或设置不正确。 因此,在遇到性能问题之前,我们必须花一些时间来审查与当前系统配置或新安装有关的预防措施。 负载测试(或压力测试)是在实际过渡条件之前调整系统的最常用方法。 现在,我们将讨论负载测试的详细信息,尤其是SSRS负载测试。

负载测试 (Load Testing)

The intent of the load test is to determine and analyze the system performance metrics with some simulations closest to real-time usage scenarios. Stress tests can measure the system performance capacity and give more details about the performance metrics under the pressure. With load tests, we can detect performance problems earlier and can take precautions about it. Especially in peak periods, the system must preserve its own stability and in order to ensure we can achieve this, we to need test for maximum stress. At this point, we have to clarify one thing about load testing. The aim of this type of testing is not to test the system for “bugs”. The main idea of load test is to analyze system performance behavior under maximum simulated workloads. The thinking being is that if the system can manage very high, simulated workloads, then it should be able to handle production workloads that are as high or lower. If the system has failure points, then they will become readily apparent in high/higher than normal workloads, so they can be caught early before they are experienced in production.

负载测试的目的是通过最接近实时使用场景的一些模拟来确定和分析系统性能指标。 压力测试可以测量系统性能,并在压力下提供有关性能指标的更多详细信息。 通过负载测试,我们可以更早地发现性能问题,并可以采取预防措施。 特别是在高峰期,系统必须保持其自身的稳定性,并且为了确保我们能够实现这一目标,我们需要测试最大压力。 在这一点上,我们必须澄清有关负载测试的一件事。 这种测试的目的不是为了测试系统的“错误”。 负载测试的主要思想是分析最大模拟工作负载下的系统性能行为。 当时的想法是,如果系统可以管理非常高的模拟工作负载,那么它应该能够处理或高或低的生产工作负载。 如果系统具有故障点,那么它们将在比正常工作负载高/高的情况下变得很明显,因此可以在生产之前就及早发现它们。

SSRS中的负载测试 (Load testing in SSRS)

Apart from SQL Server, SSRS test and performance monitoring tools are very limited. In this article, we will use an open source project for load test which is Reporting-Services-LoadTest. With this project, we can generate a synthetic workload in SQL Server Reporting Service and can run maximum workload scenarios. The advantage of this project is; its publication as an open source and also you can add additional features or can customize to project for your reporting service environment. In addition, it is documented well. Before starting the demonstration I want to add some notes, you must have some knowledge and experience about SSRS and C# development because we will skip some steps about report development in SSRS but this articles ( Reporting Services (SSRS) ) will help details about reporting service and report development. Another requirement is that you need to look at the SSRS Load Testing documents and How to onboard a new Paginated Reports Scenario tutorial. We will proceed to the next section of the article based on this tutorial.

除了SQL Server,SSRS测试和性能监视工具非常有限。 在本文中,我们将使用一个开源项目进行负载测试,即Reporting-Services-LoadTest 。 通过此项目,我们可以在SQL Server Reporting Service中生成综合工作负载,并可以运行最大的工作负载方案。 这个项目的优点是; 它作为开放源代码发布,您还可以添加其他功能或可以针对您的报告服务环境进行自定义项目。 另外,它被很好地记录在案。 在开始演示之前,我想添加一些说明,您必须具有关于SSRS和C#开发的知识和经验,因为我们将跳过关于SSRS中的报告开发的一些步骤,但是本文( Reporting Services(SSRS) )将有助于有关报告服务的详细信息并报告开发情况。 另一个要求是,您需要查看SSRS负载测试文档和如何使用新的分页报告方案教程。 我们将根据本教程继续进行本文的下一部分。

演示版 (Demo)

In the first step for creating our SSRS testing system, we have to download Reporting-Services-LoadTest-master project. To open the project, we can use Visual Studio 2015 or above version but you have to ensure Web performance and testing tools installed to your Visual Studio IDE (Integrated development environment). We will use a Product Catalog report which is placed in the “Reporting-Services-LoadTest-master\src\RSLoad\ContentManager\RuntimeResources\Paginated\General” project folder.

在创建SSRS测试系统的第一步中,我们必须下载Reporting-Services-LoadTest-master项目。 要打开项目,我们可以使用Visual Studio 2015或更高版本,但是您必须确保Web性能和测试工具已安装到Visual Studio IDE(集成开发环境)中。 我们将使用放置在“ Reporting-Services-LoadTest-master \ src \ RSLoad \ ContentManager \ RuntimeResources \ Paginated \ General”项目文件夹中的产品目录报告。

sql2012 ssrs_SQL Server Reporting Services(SSRS)的负载测试

We will create a folder in the project and copy Product Catalog report to this folder.

我们将在项目中创建一个文件夹,并将“产品目录”报告复制到该文件夹​​中。

sql2012 ssrs_SQL Server Reporting Services(SSRS)的负载测试

We will comment out all unnecessary data sources in the datasource.xml file. The Product Catalog report only requires the AdventureWorks data source and other data sources are needless.

我们将在datasource.xml文件中注释掉所有不必要的数据源。 产品目录报告仅需要AdventureWorks数据源,而其他数据源则是不必要的。

sql2012 ssrs_SQL Server Reporting Services(SSRS)的负载测试

Set the proper configuration for reporting service and dataset connections in the RSTest.Common.ReportServer.dll.Config file. Because when we run the test these credentials will be used by AdventureWorks data source.

在RSTest.Common.ReportServer.dll.Config文件中设置报告服务和数据集连接的正确配置。 因为当我们运行测试时,AdventureWorks数据源将使用这些凭据。

sql2012 ssrs_SQL Server Reporting Services(SSRS)的负载测试

We will edit the code and run the test. You have to ensure that your test method has passed.

我们将编辑代码并运行测试。 您必须确保您的测试方法已通过。

sql2012 ssrs_SQL Server Reporting Services(SSRS)的负载测试

After the execution of test method, it will publish the Product Catalog report and AdventureWorks data source to report server. We can see these files in the Reporting Service web portal.

执行测试方法后,它将把产品目录报告和AdventureWorks数据源发布到报告服务器。 我们可以在Reporting Service网站门户中看到这些文件。

sql2012 ssrs_SQL Server Reporting Services(SSRS)的负载测试

We need to ensure Product Catalog report works successfully because all virtual users execute this report in the test scenario.

我们需要确保“产品目录”报告能够成功工作,因为所有虚拟用户都在测试方案中执行此报告。

sql2012 ssrs_SQL Server Reporting Services(SSRS)的负载测试

We will add a new test to RSLoad project. With this test, we will create our workload scenario and then test it.

我们将为RSLoad项目添加一个新测试。 通过此测试,我们将创建工作负载场景,然后对其进行测试。

sql2012 ssrs_SQL Server Reporting Services(SSRS)的负载测试

We will select the On-Premise Load Test option and click next.

我们将选择“内部负载测试”选项,然后单击“下一步”。

sql2012 ssrs_SQL Server Reporting Services(SSRS)的负载测试

We will set duration of test.

我们将设置测试持续时间。

sql2012 ssrs_SQL Server Reporting Services(SSRS)的负载测试

We will give a name to load test scenario. The test scenario name has to be same as report folder which we created and copied to the Product Catalog report.

我们将命名以加载测试方案。 测试方案名称必须与我们创建并复制到“产品目录”报告中的报告文件夹相同。

sql2012 ssrs_SQL Server Reporting Services(SSRS)的负载测试

In this screen, we can type two types of load patterns. These are constant user or step load. In the constant load option, user count does not change during the load test. In the step load option, we can increase the user count step by step and we can limit the maximum number of user values.

在此屏幕中,我们可以键入两种类型的加载模式。 这些是恒定的用户步进负载 。 在恒定负载选项中,负载测试期间用户数不会更改。 在逐步加载选项中,我们可以逐步增加用户计数,并且可以限制最大用户值数量。

sql2012 ssrs_SQL Server Reporting Services(SSRS)的负载测试

We will add this test to load scenario. For this test, we will select only FullReportRenderHTML5 and click OK. If you want, you can add another test to load test scenario but you need to determine distribution ratio of tests.

我们将添加此测试以加载场景。 对于此测试,我们将仅选择FullReportRenderHTML5,然后单击“确定”。 如果需要,可以将另一个测试添加到负载测试方案中,但是需要确定测试的分配比率。

sql2012 ssrs_SQL Server Reporting Services(SSRS)的负载测试

We will skip previous screens with Next button and click Finish.

我们将使用“ 下一步”按钮跳过先前的屏幕, 然后单击“ 完成”

sql2012 ssrs_SQL Server Reporting Services(SSRS)的负载测试

We will run the test.

我们将运行测试。

sql2012 ssrs_SQL Server Reporting Services(SSRS)的负载测试

During test you can monitor the system performance in the analysis screen and also you can find out which resources are insufficient or can be a cause to bottlenecks.

在测试过程中,您可以在分析屏幕中监视系统性能,还可以找出哪些资源不足或可能导致瓶颈。

sql2012 ssrs_SQL Server Reporting Services(SSRS)的负载测试

看更多 (See more)

Check out ApexSQL Plan to view and analyze SQL Server query execution plans, for free, including comparing plans, stored procedure performance profiling, missing index details, lazy profiling, wait times, plan execution history

免费签出ApexSQL计划以查看和分析SQL Server查询执行计划 ,包括比较计划,存储过程性能分析,缺少索引详细信息,延迟分析,等待时间,计划执行历史记录

sql2012 ssrs_SQL Server Reporting Services(SSRS)的负载测试

 

翻译自: https://www.sqlshack.com/load-testing-for-sql-server-reporting-services-ssrs/

sql2012 ssrs