[英]Poor performance of NServiceBus over MSMQ
We are trying to integrate NServiceBus/MSMQ in our current web application (REST). 我们正在尝试将NServiceBus / MSMQ集成到当前的Web应用程序(REST)中。
Running the profiler, it seems that a lot of time is spent sending the message to the queue (see the profiler screen shot 1 , were the highlighted 30 is 30% of the overall execution time). 运行探查器,似乎花费了很多时间将消息发送到队列(请参阅探查器屏幕快照1 ,突出显示的30占整个执行时间的30%)。 It takes about twice the time just to send the message to MSMQ than saving an entire new set of documents in Mongo (running on a remote server).
仅将消息发送到MSMQ所需的时间比在Mongo中保存整个新文档集(在远程服务器上运行)要多一倍。
Is it normal that sending a message to MSMQ queue is that slow or are we missing some configuration tweak? 向MSMQ队列发送消息是否很慢是正常现象,还是我们缺少一些配置调整?
The following is our current bus configuration (based on NServiceBus documentation - http://support.nservicebus.com/customer/portal/articles/894008-using-nservicebus-with-asp-net-mvc ): 以下是我们当前的总线配置(基于NServiceBus文档-http: //support.nservicebus.com/customer/portal/articles/894008-using-nservicebus-with-asp-net-mvc ):
// NServiceBus configuration
Configure
.WithWeb()
.CastleWindsorBuilder(_container)
.JsonSerializer()
.Log4Net()
.MsmqTransport()
.IsTransactional(false)
.PurgeOnStartup(true)
.UnicastBus()
.ImpersonateSender(false)
.SendOnly();
and web.config: 和web.config:
<MessageForwardingInCaseOfFaultConfig ErrorQueue="Error" />
<MsmqTransportConfig NumberOfWorkerThreads="1" MaxRetries="5" />
<UnicastBusConfig>
<MessageEndpointMappings>
<add Messages="Messages" Endpoint="MessageHandlers" />
</MessageEndpointMappings>
</UnicastBusConfig>
This looks like an MSMQ issue . 这看起来像是MSMQ问题 。 Transactional MSMQ simply isn't optimized for writing to it quickly.
事务型MSMQ根本没有针对快速写入进行优化。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.