I would appreciate any advice regarding tools and practices I could use to confirm my recently completed website is performing correctly.
对于我可以用来确认我最近完成的网站正常运行的工具和实践,我将不胜感激。
Although I am confident the code is not producing errors and is functionally operating as it should, I have little understanding of how to identify IIS, SQL Server and Windows performance/concurrency issues. For example if the website was briefly hit by a huge deluge of traffic, how would I be aware that event had ever happened and how would I know whether the website coped with it.
虽然我确信代码不会产生错误并且功能正常运行,但我对如何识别IIS,SQL Server和Windows性能/并发问题几乎一无所知。例如,如果网站被大量的流量短暂打击,我怎么会意识到事件曾经发生过,我怎么知道网站是否应对它。
The website was written using ASP.NET 2.0 and C# running on Windows 2003 R2 Standard Edition, SQL Server 2005 Workgroup Edition and IIS 6.
该网站使用在Windows 2003 R2标准版,SQL Server 2005 Workgroup Edition和IIS 6上运行的ASP.NET 2.0和C#编写。
4 个解决方案
#1
Consider using a logging mechanism that also raises alerts, so when a database call takes too long, indicating a high server load, the logger raises a warning. Check out log4net.
考虑使用也会引发警报的日志记录机制,因此当数据库调用时间过长(表示服务器负载较高)时,记录器会发出警告。查看log4net。
Regarding tools and practises, I recommend badboy and jmeter as tools for load testing your site. Badboy is simple and can generate urls that may also be used in jmeter. The latter does a very good job load testing your site. Do tests that run over a long period and use different hardware setups to see how adding more web/app servers affect performance.
关于工具和实践,我建议使用badboy和jmeter作为负载测试站点的工具。 Badboy很简单,可以生成也可以在jmeter中使用的URL。后者在测试您的网站方面做得非常好。进行长时间运行的测试并使用不同的硬件设置来查看添加更多Web / app服务器如何影响性能。
Also, check out PerfMon, a tool that lets you monitor a local or remote Windows server regarding contention rate, cpu load and so on.
另外,请查看PerfMon,这是一个可以监视本地或远程Windows服务器的工具,包括争用率,CPU负载等。
#2
You can use a load generating tool like WebLoad to capture and then replay (with possible variations through scripting) user interactions with your application's UI with lots of threads and connections.
您可以使用WebLoad等负载生成工具捕获并重放(通过脚本编写可能的变体)用户与应用程序UI的交互,以及大量的线程和连接。
#3
As mentioned, load generation tools are quite helpful. One thing you can add for the database side is to use SQL Tracing. Setup a test plan with very specific steps, and as you step through your plan, trace the SQL that is running on the server.
如前所述,负载生成工具非常有用。您可以为数据库端添加的一件事是使用SQL跟踪。使用非常具体的步骤设置测试计划,并在逐步执行计划时跟踪服务器上运行的SQL。
This way, you can identify if certain actions are causing unnecessary/duplicate database calls. Also, you may discover very large and non-performant queries being run for very simple actions.
这样,您可以识别某些操作是否导致不必要/重复的数据库调用。此外,您可能会发现为非常简单的操作运行非常大且不具有性能的查询。
#4
For SQL Server use the sys.dm_exec_requests DMV and check for CPU usage, reads, writes, blocking etc etc
对于SQL Server,请使用sys.dm_exec_requests DMV并检查CPU使用情况,读取,写入,阻止等
select blocking_session_id,wait_type,*
from sys.dm_exec_requests
#1
Consider using a logging mechanism that also raises alerts, so when a database call takes too long, indicating a high server load, the logger raises a warning. Check out log4net.
考虑使用也会引发警报的日志记录机制,因此当数据库调用时间过长(表示服务器负载较高)时,记录器会发出警告。查看log4net。
Regarding tools and practises, I recommend badboy and jmeter as tools for load testing your site. Badboy is simple and can generate urls that may also be used in jmeter. The latter does a very good job load testing your site. Do tests that run over a long period and use different hardware setups to see how adding more web/app servers affect performance.
关于工具和实践,我建议使用badboy和jmeter作为负载测试站点的工具。 Badboy很简单,可以生成也可以在jmeter中使用的URL。后者在测试您的网站方面做得非常好。进行长时间运行的测试并使用不同的硬件设置来查看添加更多Web / app服务器如何影响性能。
Also, check out PerfMon, a tool that lets you monitor a local or remote Windows server regarding contention rate, cpu load and so on.
另外,请查看PerfMon,这是一个可以监视本地或远程Windows服务器的工具,包括争用率,CPU负载等。
#2
You can use a load generating tool like WebLoad to capture and then replay (with possible variations through scripting) user interactions with your application's UI with lots of threads and connections.
您可以使用WebLoad等负载生成工具捕获并重放(通过脚本编写可能的变体)用户与应用程序UI的交互,以及大量的线程和连接。
#3
As mentioned, load generation tools are quite helpful. One thing you can add for the database side is to use SQL Tracing. Setup a test plan with very specific steps, and as you step through your plan, trace the SQL that is running on the server.
如前所述,负载生成工具非常有用。您可以为数据库端添加的一件事是使用SQL跟踪。使用非常具体的步骤设置测试计划,并在逐步执行计划时跟踪服务器上运行的SQL。
This way, you can identify if certain actions are causing unnecessary/duplicate database calls. Also, you may discover very large and non-performant queries being run for very simple actions.
这样,您可以识别某些操作是否导致不必要/重复的数据库调用。此外,您可能会发现为非常简单的操作运行非常大且不具有性能的查询。
#4
For SQL Server use the sys.dm_exec_requests DMV and check for CPU usage, reads, writes, blocking etc etc
对于SQL Server,请使用sys.dm_exec_requests DMV并检查CPU使用情况,读取,写入,阻止等
select blocking_session_id,wait_type,*
from sys.dm_exec_requests