WCF禁用UseNagleAlgorithm同时连接到SQL Azure的 [英] WCF disabling UseNagleAlgorithm while connecting to SQL Azure

查看:305
本文介绍了WCF禁用UseNagleAlgorithm同时连接到SQL Azure的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一堆托管在Azure WCF REST服务访问SQL Azure数据库。我看到ServicePointManager.UseNagleAlgorithm设置为true。我明白这设置为false将加快电话(记录&LT插入; 1460字节),以表存储 - 以下<一个href=\"http://social.msdn.microsoft.com/Forums/en-US/windowsazuredata/thread/d84ba34b-b0e0-4961-a167-bbe7618beb83/\"相对=nofollow>链接谈论它。

Have a bunch of WCF REST services hosted on Azure that access a SQL Azure database. I see that ServicePointManager.UseNagleAlgorithm is set to true. I understand that setting this to false would speed up calls (inserts of records < 1460 bytes) to table storage - the following link talks about it.

我的问题 - 会禁用Nagle算法也加快了我对SQL Azure的通话

My Question - Would disabling the Nagle Algorithm also speed up my calls to SQL Azure?

推荐答案

Nagle算法是所有关于缓冲TCP级别的数据包成一个小#,并且是不依赖于记录大小。你可能会写行表的存储,比方说,1300字节的数据,但一旦你包括TCP报头信息,内容系列化等,传播可能比1460字节的阈值的数据。

Nagle's algorithm is all about buffering tcp-level data into a smaller # of packets, and is not tied to record size. You could be writing rows to Table Storage of, say, 1300 bytes of data, but once you include tcp header info, content serialization, etc., the data transmitted could be larger than the threshold of 1460 bytes.

在任何情况下:净结果是使该算法时可以看到的写入延迟到500毫秒,因为数据被缓冲,从而导致在导线较少的TCP包

In any case: the net result is that you could be seeing write delays up to 500ms when the algorithm is enabled, as data is buffered, resulting in less tcp packets over the wire.

这可能是禁用Nagle算法将与您访问SQL Azure的帮助,但你可能会需要做一些基准测试,看看你的吞吐量是基于对读取类型的影响/写你在干什么。这有可能是到SQL Azure中调用,以必要的SQL命令文本,造成足够大的数据包,禁用的Nagle不会有所作为。

It's possible that disabling Nagle's algorithm would help with your access to SQL Azure, but you'd probably need to do some benchmarking to see if your throughput is being affected based on the type of reads/writes you're doing. It's possible that the calls to SQL Azure, with the requisite SQL command text, result in large-enough packets that disabling nagle wouldn't make a difference.

这篇关于WCF禁用UseNagleAlgorithm同时连接到SQL Azure的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆