- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我们的应用程序服务器架构经过设置,以便每个服务调用都经过自定义构建的 WCF 服务路由器 - 这是一个使用请求消息 header 中嵌入的信息将传入请求分发到适当服务的服务。
我们在使用此 WCF 服务路由器时遇到性能问题(对并发用户进行负载测试时超时)。我们想知道这是否是由于路由器中的错误、我们错误地配置了服务/IIS,或者是否是预期的情况 - 每个通过单个服务的调用听起来都像是一个潜在的瓶颈。
如果没有路由,我们可以在出现超时错误之前处理大约 120 个并发用户,尽管出现超时,但 IIS 仍会继续处理请求。使用路由器,IIS 将停止处理大约 20 个并发用户的请求,并且在负载测试的其余部分中永远不会恢复处理任何请求。
我们的主要问题是,在使用服务路由器时是否会出现这种情况,或者 IIS 是否能够按照我们设置的方式处理此负载?
<小时/>路由服务如下所示:
/// <summary>
/// Generic service contract which can accept any WCF message.
/// </summary>
[ServiceContract]
public interface IServiceRouter
{
[OperationContract(Action = "*", ReplyAction = "*", AsyncPattern=false)]
Message ProcessMessage(Message requestMessage);
}
实现:
[ServiceBehavior(
InstanceContextMode = InstanceContextMode.PerCall,
ConcurrencyMode = ConcurrencyMode.Multiple,
AddressFilterMode = AddressFilterMode.Any,
ValidateMustUnderstand = false)]
public sealed class ServiceRouter : IServiceRouter
ProcessMessage 操作:
public Message ProcessMessage(Message requestMessage)
{
//Figure out the url of the downstream service
string serviceName = requestMessage.Headers.GetHeader<String>(ServiceNameMessageHeader, String.Empty);
string url = String.Format(_destinationUrlFormat, _destinationAppName, _destinationAppVersion, serviceName);
EndpointAddress endpointAddress = new EndpointAddress(url);
using (ChannelFactory<IServiceRouter> factory = new ChannelFactory<IServiceRouter>(_binding, endpointAddress))
{
factory.Endpoint.Behaviors.Add(new MustUnderstandBehavior(false));
IServiceRouter proxy = factory.CreateChannel();
using (proxy as IDisposable)
{
try
{
IClientChannel clientChannel = proxy as IClientChannel;
// invoke service
Message responseMessage = proxy.ProcessMessage(requestMessage);
return responseMessage;
}
catch (Exception ex)
{
// ...
}
}
}
}
最佳答案
不,不应期望 WCF 服务会给您带来如此大的瓶颈,但是当我们不确切知道您的 WCF 服务的作用或配置方式时,很难给出准确的答案,但作为你说:
Without routing we can handle about 120 concurrent users before getting timeout errors and although we get timeouts the IIS keeps handling requests. With the router the IIS stops handling requests with about 20 concurrent users and never resumes handling any requests throughout the rest of the load-testing.
我认为您已经回答了有关 WCF 服务导致问题的问题。显然,您需要检查它的配置、运行方式以及它对“路由”的作用。
编辑
看看here一些可能影响 WCF 性能的问题。
关于.net - WCF服务路由,瓶颈?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8725247/
我有一个具有以下结构的表: ID, SourceID, EventId, Starttime, Stoptime 所有 ID 列都是 char(36),时间是日期。 问题是查询表真的很慢。我有 7 百
我们的应用程序服务器架构经过设置,以便每个服务调用都经过自定义构建的 WCF 服务路由器 - 这是一个使用请求消息 header 中嵌入的信息将传入请求分发到适当服务的服务。 我们在使用此 WCF 服
在分析一个计算数千个元素的层次聚类的 Java 应用程序时,我意识到 ArrayList.get占用执行集群化部分所需 CPU 的一半左右。 该算法搜索两个更相似的元素(因此它是 O(n*(n+1)/
我正在处理大数组(~6x40 百万),我的代码显示出很大的瓶颈。我在 MatLab 编程经验丰富,但对内部过程(如内存等......)知之甚少。 我的代码如下(只是要点,当然所有变量都初始化了,特别是
我正在尝试创建一个独立的类来维护与服务器的 Tcp 连接。 我正在使用以下类变量: TcpClient tcpClient; NetworkStream networkStream; BinaryRe
快速多线程问题... 我在内存中有一个包含大约 20,000 个项目的字典对象。如果我有多个线程尝试读取此对象,您会认为这会造成瓶颈吗? 净 3.5 。字典对象将是只读的 字典是只读的,所以我不关心读
我们有 2 台服务器: 文件 API 核心 API 不同服务器上的文件 API 和不同的核心 API。我们希望通过相同的域和端口进行访问,我们使用 nodeJS 作为后端平台。 所以我们想出了一个代理
我想并行下载/上传文件到 Azure。默认情况下,由于日志文件上的锁定,AzCopy 不允许在同一副本上多次运行。我通过将每个实例指向不同的日志文件(使用/Z )在同一台计算机上运行多个 Azcopy
因此,我将获取 10000 个 2 页 pdf 文件,并使用 iTextSharp 将它们合并为一个。 这是我正在做的一些松散代码: Document document = new Document(
我目前有一个多线程程序,可以抓取网站并将其文本写入文件。 CPU 方面,我可以同时运行大量线程,但 I/O 很快就会成为瓶颈。我想我可以让每个线程写入数组阻塞队列,但我知道我将生成超过可用 32GB
我在使用 PLINQ 时遇到了一些我似乎无法解释的奇怪结果。我一直在尝试并行化 Alpha Beta 树搜索以加快搜索过程,但它实际上减慢了搜索速度。我希望当我提高并行度时,我会每秒线性增加节点...
在对给定数组中的前 n = 1000 个元素进行排序时,为什么 bottleneck.argpartsort 具有最佳性能是否有原因(考虑到我没有搞砸某些事情)? 我创建了以下脚本: d = nump
我有一个已由 OpenMP 并行化的循环,但由于任务的性质,有 4 个 critical 子句。 分析加速并找出哪些关键子句(或可能非关键(!))在循环内占用最多时间的最佳方法是什么? 我使用 Ubu
我有一个使用 UIImage 对象的应用程序。到目前为止,我一直在使用像这样初始化的图像对象: UIImage *image = [UIImage imageNamed:imageName]; 在我的
对于以下问题场景,我们应该查看哪些 mySQL 服务器变量以及哪些阈值很重要: CPU 限制 磁盘读取限制 磁盘写入绑定(bind) 对于每种情况,除了获得更好的硬件或将数据库扩展到多台服务器之外,建
在我的工作表中,我有四个不同的类别。对于每个类别,有 3~5种不同的价格。还有其他属性。结果,每个类别都重复了很多次,总共有 30,000 行。工作表的第一行包含所有列名。每个类别跨越连续的行。因此,
我是 Spark、SparkR 以及所有 HDFS 相关技术的新手。我最近安装了 Spark 1.5.0 并使用 SparkR 运行一些简单的代码: Sys.setenv(SPARK_HOME="/p
Win 7/SolrNet 0.4.0/C# winforms .net 4.0 客户端。 我正在使用 Solrnet 和一个 winforms 线程应用程序将多个位图和一些数学描述符写入 Solr
我有一个 Android 后台服务,它会不时报告位置。当我通过 wifi 在本地测试时它工作得很好,但是当在 3G 连接中测试时(有时在 Edge 上)我发现应用程序显然进入了瓶颈并且不执行 onLo
我正在使用实时数据在网页上使用 SVG 绘制一些线条。为了管理数据,我使用 Angular.js 并管理可视化,我使用 D3.js。 我设置了一个 Angular Controller 来保存数据(行
我是一名优秀的程序员,十分优秀!