solorez~Z Space

关注数据库,关注MS SQL Server

导航

统计

公告

[翻译]安装Windows Server 2003 SP2可能会影响SQL Server 性能

Scalable Networking Pack (常见问题 详细描述)在Server 2003安装SP2后会默认被打开,打开此功能可以把对网络数据包的处理从CPU分担一部分到网卡上,但这可能会引起SQL Server性能问题,详情可以看下面的KB:

http://support.microsoft.com/kb/942861

http://support.microsoft.com/kb/918483

另外发现SNP会使SQL Server对事务的吞吐量变小以及使不同查询语句之间的执行间隔变长,比如,有一个事务包含多个查询语句,并且每个语句的执行时间很短,那么他们执行的时间总和应该也会比较短,比如下面的Profiler追踪(注意语句的执行间隔):

image

当SNP开启后,你可以看到下面的Profiler数据,注意其中不同语句的执行间隔,基本都在500ms左右:

image

这种执行间隔明显会影响到并发性,下表显示了SNP启用和禁用后相同工作负荷的执行时间:

Implicit Transaction Summary SNP Enabled

spid TransactionID TranStart TranEnd TranDuration sum_batch_duration batch_count delta
------- -------------- ------------- ------------ ------------- -------------------- -------------- --------
57 916972 09:40:24.450 09:41:17.623 53173 601 516 52572
57 896243 09:39:31.620 09:40:01.840 30220 322 301 29898
57 877227 09:39:12.120 09:39:15.293 3173 306 161 2867
57 876313 09:38:58.590 09:38:58.603 13 0 1 13
57 895388 09:39:18.510 09:39:18.527 16 16 4 0
57 915675 09:40:02.653 09:40:02.670 16 16 4 0

Implicit Transaction Summary SNP Disabled

spid TransactionID TranStart TranEnd TranDuration sum_batch_duration batch_count delta
------- -------------- ------------ ------------ ------------- -------------------- -------------- --------
54 127910 11:13:47.287 11:13:52.490 5203 4060 516 1143
54 107344 11:13:23.380 11:13:24.427 1046 382 301 664
51 87187 11:12:50.067 11:12:50.550 483 0 1 483
54 88182 11:13:03.987 11:13:07.237 3250 2878 161 372
51 106432 11:13:10.487 11:13:10.487 0 0 1 0
54 126550 11:13:25.490 11:13:26.007 516 516 4 0

Server 2008 的SNP默认是关闭的,已经装上SP2的Server 2003用户可以通过下面的补丁关闭SNP:http://support.microsoft.com/default.aspx?scid=kb;EN-US;948496 或者使用下面的方法手工关闭:

1. Locate the following registry subkey:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

2. Double-click the EnableTCPChimney registry entry.

3. In the Edit DWORD Value dialog box, type 0 in the Value data box, and then click OK.

4. Double-click the EnableRSS registry entry.

5. In the Edit DWORD Value dialog box, type 0 in the Value data box, and then click OK.

6. Double-click the EnableTCPA registry entry.

7. In the Edit DWORD Value dialog box, type 0 in the Value data box, and then click OK.

8. Restart the server.

原文地址:http://blogs.msdn.com/psssql/archive/2008/10/01/windows-scalable-networking-pack-possible-performance-and-concurrency-impacts-to-sql-server-workloads.aspx

posted on 2008-10-05 17:02 付博 阅读(...) 评论(...) 编辑 收藏