1

I am working on a proof of concept implementation of NServiceBus v4.x for work.

Right now I have two subscribers and a single publisher.

The publisher can publish over 500 message per second. It runs great.

Subscriber A runs without distributors/workers. It is a single process.

Subscriber B runs with a single distributor powering N number of workers.

In my test I hit an endpoint that creates and publishes 100,000 messages. I do this publish with the subscribers off line.

Subscriber A processes a steady 100 messages per second. Subscriber B with 2+ workers (same result with 2, 3, or 4) struggles to top 50 messages per second gross across all workers.

It seems in my scenario that the workers (which I ramped up to 40 threads per worker) are waiting around for the distributor to give them work.

Am I missing something possibly that is causing the distributor to be throttled? All Buses are running an unlimited Dev license.

System Information: Intel Core i5 M520 @ 2.40 GHz 8 GBs of RAM SSD Hard Drive

UPDATE 08/06/2013: I finished deploying the system to a set of servers. I am experiencing the same results. Every server with a worker that I add decreases the performance of the subscriber.

Subscriber B has a distributor on one server and two additional servers for workers. With Subscriber B and one server with an active worker I am experiencing ~80 messages/events per second. Adding in another worker on an additional physical machine decreases that to ~50 messages per second. Also, these are "dummy messages". No logic actually happens in the handlers other than a log of the message through log4net. Turning off the logging doesn't increase performance.

Suggestions?

4

3 回答 3

3

如果您在一台服务器上使用 NServiceBus 主/工作节点向外扩展,那么尝试衡量性能是没有意义的。具有多个线程的一个进程总是比同一台机器上的分配器和多个工作节点做得更好,因为分配器将成为瓶颈,而一切都在竞争相同的计算资源。

如果工人被转移到不同的服务器上,情况就完全不同了。如果这是服务器上唯一发生的事情,则分发器在分发消息方面非常有效。

尝试使用多台服务器,看看会发生什么。

于 2013-07-24T19:05:46.370 回答
1

您可以通过添加一些睡眠时间(例如 5 秒)来模拟实际处理,而不是拥有一个什么都不做的虚拟处理程序。然后比较拥有订阅者和通过分销商的结果?

横向扩展(有或没有分配器)仅适用于单台机器完成的工作需要时间,因此更多的计算资源会有所帮助。为了帮助解决这个问题,请监视端点上的 CriticalTime 性能计数器,并在需要时添加分发器。无需更改代码,只需在分发服务器和工作人员配置文件中启动相同的端点,即可在需要时轻松扩展使用分发服务器。

于 2013-08-06T17:52:23.937 回答
0

整个链条是事务性的。你为此付出了沉重的代价。当您没有非常快速的磁盘存储并通过缓存写入来加速事务写入时,增加跨机器的工作负载实际上不会提高性能。

当您将 poc 扩展到多台服务器时,只需尝试将消息标记为“Express”,它不会在队列中进行事务性写入,并在总线实例上禁用 MSDTC 以查看没有事务的情况下可能有什么样的性能。除非您知道这不是强制性的,或者当您拥有不需要 DTC 的架构时,这不是真正可用于生产的。

于 2013-07-25T09:33:56.923 回答