Windows Workflow Foundation 状态机是否适合高性能场景?
我目前正在处理一个系统,我必须并行跟踪数千个对象的状态,这些对象每分钟发送几次可能的状态更新。另外我必须执行额外的计算(没有慢速的 IO 东西,只是使用 CPU)。
我目前使用自定义状态机实现。然而,由于 WF 在系统的其他部分中使用,我想知道 WF 状态机是否适合这种具有少数(<5)状态的场景。
我担心在性能方面的开销可能太大。由于 MS 文档并未真正涵盖有关 WF 状态机性能的主题,我想知道某些 SO 成员是否有一些有关 WF 状态机性能的信息或资源?
问候 j。
i´m currently dealing with a system where i have to track the state for several thousand objects in parallel that send possible state updates a few times every minute. In addition i have to perform additional computation (no slow IO stuff, just using CPU).
I currently use a custom state machine implementation. however, as WF is used within other parts of the system, i wonder if the WF state machine´s may be suitable for such a scenario with a handful (<5) of states.
I fear that the overhead might be too big when it comes to performance. As the MS documentation does not really cover topics regarding performance for WF state machines, i wonder if some SO member has some information or resources regaring WF state machine performance?
regards
j.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
状态机非常适合高性能系统。如果您确实需要非常高的性能,那么使用工作流基础会增加很多复杂性和开销。我发现 biztalk 完全不适合非常高的性能。
State machines are great for a high performance system. If you really need very high performance using workflow foundation adds a lot of complexity and overhead. I've found biztalk to be totally unsuitable for very high performance.
如果您正在寻找基于 .Net 的高性能状态机,我会推荐 Stateless。以下是项目网站的摘录:
支持大多数标准状态机构造:
任何 .NET 类型的触发器(数字、
字符串、枚举等)
状态事件
转换
还提供了一些有用的扩展:
(例如,在跟踪的属性中
by Linq to SQL)
配置如下:
好处是,由于它实现了泛型,您可以使用 int 或 string 来表示状态和触发器,从而使您可以非常轻松地与数据库或 ORM 集成。美妙之处在于,您无需担心额外的运行时主机,只需从对象或记录加载状态机的当前状态即可。
If you are looking for a .Net based high performance state machine I would recommend Stateless. Here is an excerpt from the project site:
Most standard state machine constructs are supported:
triggers of any .NET type (numbers,
strings, enums, etc.)
events for states
transitions
Some useful extensions are also provided:
(for example, in a property tracked
by Linq to SQL)
Configuration is as follows:
And the nice thing is that since it implements Generics, you can use int or string to represent the states and triggers, allowing you to integrate very easily with your database or ORM. The beauty is that there is no additional runtime host that you have to worry about, just load the state machine with the current state from an object or a record and you are good to go.
Microsoft 目前在其服务器产品中使用 WF,并且正在扩展此功能。例如,WF 引擎可以在 Share Point Server (MOSS) 和 BizTalk Server 中找到。两者都可以很好地扩展并允许横向扩展场景 - 即,如果您需要更多的计算能力,则可以在负载平衡集群中添加更多(廉价)硬件。
哈特哈,
托马斯
Microsoft is currently using WF in their server products and they are expanding this. So for example the WF engine can be found in Share Point Server (MOSS) and in BizTalk Server. Both scale quite well and allow scale out scenarios - i.e. you add more (cheap) hardware in a load balanced cluster if you need more computing power.
HTH,
Thomas
这并不直接影响性能,但如果您计划最终迁移到 WF 4.0,您应该意识到 StateMachineActivity 可能 不会晋级。
This doesn't speak directly to performance, but if you're planning to eventually move to WF 4.0 you should be aware that StateMachineActivity likely won't be making the cut.