负载均衡,使用WCF和MSMQ喜负载服务器 [英] Hi load server with load balancing, using WCF and MSMQ

查看:404
本文介绍了负载均衡,使用WCF和MSMQ喜负载服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我正在开发的空间数据处理服务器。
以下是要求:

Currently I'm developing a spatial data processing server. Here are requirements:


  1. 服务器必须能够接收和处理每秒约150-200小消息(GPS定位,一些额外的数据)。

  2. 它必须是可伸缩的。例如在几台机器和平衡负载本身(不NLB)运行

目前我已经测试了这种体系结构:

Currently I have tested this kind of architecture:


  1. 接收邮件服务,只负责收取邮件到(不msmqwcf绑定)

  2. 信息解析器服务。从MSMQ获取信息,分析他们,并写入到数据库,也会发送通知到下一个服务(再次与普通MSMQ互操作)。这一个是能够​​在多台PC的工作

  3. 数据出版商服务。含有少量缓存并负责从数据库中获取所需的数据。将通知发送到使用TCP通过WCF绑定的客户。

此外所有服务,它们通过WCF TCP要求的配置方法和其他一些任务显示绑定。

Also all services have methods for configuration and some other tasks which are called via WCF TCP binding.

小的性能测试,它的工作原理相当快,但我不知道这是使用那些MSMQ和WCF共同为这一特定的应用程序一个最好的办法。或者,也许有人可以给我一个方向去哪里找?

Small performance tests shown that it works quite fast, but i wonder is this a best way to use those MSMQ and WCF together for this specific app. Or maybe someone can give me a direction where to look?

推荐答案

我真的不知道你有具体的问题,似乎像更多的是一般的设计问题,但我爱MSMQ我会在这里随意插入内容。

I am not really sure of the specific question you have, seems like more of a general design question, but as I love MSMQ I'll chime in here.

MSMQ确实有一些缺点,特别是关于负载均衡的事务性消息,但整体的相当真棒。

MSMQ does have some drawbacks, specifically about load balancing transactional messages, but on whole its pretty awesome.

但是,没有你的要求提到任何特别原因需要使用MSMQ:耐用性,可恢复消息,断开连接的客户端,等..所以我假设你有这些规定,但他们没有明确提出了

However, none of your requirements mentioned any specific reason to use MSMQ: durability, recoverable messaging, disconnected clients, etc.. so I am assuming you have some of these requirements, but that they are not explicitly called out.

要求#1应该是容易满足/节拍,特别是如果这些都是小的消息,而且对它们正在执行没有明显的逻辑(例如,只是香草插入/更新)和MSMQ处理竞争消费者非常好。

Requirement #1 should be easy to meet/beat, especially if these are small messages and there is no apparent logic being performed on them (e.g. just vanilla inserts/updates) and MSMQ handles competing consumers very well.

要求#2除非你的使用事务的消息与MSMQ,它不是不可能的负载平衡MSMQ,使缩放,但是它有一些注意事项。你怎么负载均衡MSMQ?见如何负载均衡MSMQ:简要讨论了解一些细节,如果你还没有他们。

Requirement #2 unless your using transactional messaging with MSMQ, its not impossible to load balance MSMQ to enable scaling, but it has some caveats. How are you load balancing MSMQ? See How to Load-Balancing MSMQ: A Brief Discussion for some details if you don't already have them.

除非潜在天翻地覆与负载均衡MSMQ,其中没有一个是不可逾越的,没有什么不对的做法。

Barring potential snafu's with load-balancing MSMQ, none of which are insurmountable, there is nothing wrong with this approach.

缩放MSMQ

MSMQ的非常好垂直(同一台机器)和中等水平(多机)。然而,这是难以使MSMQ真正高度可用,其可以是或可以不是一个问题。见链接已经在这个答案就使其具有高可用性的想法。

Scaling MSMQ
MSMQ scales very well vertically (same machine) and moderately horizontally (many machines). However, it is difficult to make MSMQ truly highly available, which may or may not be a concern. See the links already in this answer for thoughts on making it highly available.

垂直缩放

当垂直缩放MSMQ,有一台机器上运行的队列读取器(S)的许多实例,从一个单一的队列中读取。 MSMQ处理这个非常好。我们所有的队列中的数据是在本地计算机上的时间存储。

Scaling Vertically
When scaling MSMQ vertically, there are many instances of the queue reader(s) running on a single machine, reading from a single queue. MSMQ handles this very well. All of our queue data is in a temporal store on the local machine.

如果我们失去了托管队列中的机会怎么样?

客户端可以发送和消息将在叠加起来客户端的传出队列,但我们不能直到服务器恢复后接收它们。

What happens if we lose the machine hosting the queue?
Clients can send and messages will stack up in the outgoing queue of the client, but we can't receive them until the server comes back up.

会发生什么事在队列中的消息?

不引入某种高度可用的备份磁盘子系统的他们很可能会消失的。即便如此,让挂钩,以该数据文件的另一个队列可以是一个挑战。从理论上讲,你可以让他们回来。在实践中,它有可能更容易地重新发送从边缘系统消息

What happens to the messages in the queue?
Without the introduction of some sort of highly available backed disk subsystem they are likely gone. Even so, getting another queue 'hooked up' to that data file can be a challenge. In theory, you can get them back. In practice, its likely easier to resend the message from the edge system.

根据交易量,队列可能是空的大部分时间,以便数据的风险损失需要与使其高度可用的努力/成本进行权衡。

Depending on transaction volumes, the queue may be empty the majority of the time so the risk of data loss needs to be weighed with the effort/cost of making it highly available.

缩放水平

当水平伸缩MSMQ,有各处理机上的队列的一个实例。各机器可以具有用于机器从队列接收消息上运行的队列[n]的读者。我们所有的队列中的数据是在几台机器的时间商店。

Scaling Horizontally
When scaling MSMQ horizontally, there is an instance of a queue on each processing machine. Each machine may have [n] readers for that queue running on the machine receiving messages from the queue. All of our queue data is in temporal stores on several machines.

您可以使用任何的文档中的负载均衡MSMQ,但是,我的经验中描述的方法几乎始终与应用负载平衡,描述为软件负载均衡:客户端具有可用的msmq端点的列表提供给。 。托管队列中的每个服务器受到相同的可用性问题,因为单个队列

You can use any of the methods described in the documentation for load-balancing MSMQ, however, my experience has almost always been with application load balancing, described as software load-balancing: the client has a list of available msmq end points to deliver to. Each server hosting the queue is subject to the same availability problems as the single queue.

可能还需要检查出的九提示企业防MSMQ 一些额外MSMQ相关的信息。

Also might want to check out Nine Tips to Enterprise-proof MSMQ for some additional MSMQ related information.

这篇关于负载均衡,使用WCF和MSMQ喜负载服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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