简体   繁体   English

服务结构演员计时器性能影响

[英]Service Fabric Actor Timers Performance Implications

We are thinking of potentially using Service Fabric Actor Timers for a sort of TTL management service. 我们正在考虑潜在地将Service Fabric Actor计时器用于某种TTL管理服务。 It has the potential to have 100 hundreds of thousands of actor timers at time. 它有可能同时具有10万个演员计时器。 We are concerned with the overhead of having this many actor timers running at a time but there does not seem to be any sort of documentation regarding actor timers their performance implications or underlying mechanisms. 我们担心一次运行这么多actor计时器会产生开销,但是似乎没有任何关于actor计时器性能影响或潜在机制的文档。 Any guidance would be greatly appreciated. 任何指导将不胜感激。

From what I know, Actor's Timer uses a lightweight 'System.Threading.Timer' under the hood, creating along a delegate that has a code to dispatch a call toward your 'wake-up' callback when the time comes. 据我所知,Actor的Timer在后台使用了轻量级的“ System.Threading.Timer”,并创建了一个具有代码的委托,以便在时间到时将调用分配给您的“唤醒”回调。 And seems like the dispatch happens just like any other incoming request would have, so I'd say that couple extra classes with a delegate are the cost of having SF Actor Timer. 而且似乎就像其他任何传入请求一样进行分派,因此我要说,与一个委托一起使用几个额外的类是使用SF Actor Timer的代价。

Of course, if your need to perform a lot of work within the timer's callback then it will lock up your actor, so it also depends on how many requests will get blocked and how fast you could leave the callback. 当然,如果您需要在计时器的回调中执行大量工作,那么它将锁定您的actor,因此它还取决于将阻止多少请求以及您离开回调的速度。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM