监控系统中到底是pull还是push方案好?

最近在研究各种监控系统,但是发现push和pull的方案都有,我也不知道这个里面到底哪个方案比较好?大家说说两个的利弊?

这个是网上找到的一个对比优缺点:

Push Pull
Discovery Agent automatically sends metrics as soon as it starts up, ensuring that it is immediately detected and continuously monitored. Speed of discovery is independent of number of agents. Discovery requires collector to periodically sweep address space to find new agents. Speed of discovery depends on discovery sweep interval and size of address space.
Scalability Polling task fully distributed among agents, resulting in linear scalability. Lightweight central collector listens for updates and stores measurements. Minimal work for agents to periodically send fixed set of measurements. Agents are stateless, exporting data as soon as it is generated. Workload on central poller increases with the number of devices polled. Additional work on poller to generate requests and maintaining session state in order to match requests and responses. Additional work for agents to parse and process requests. Agents often required to maintain state so that metrics can be retrieved at a later time by the poller.
Security Push agents are inherently secure against remote attacks since they do not listen for network connections. Polling protocol can potentially open up system to remote access and denial of service attacks.
Operational Complexity Minimal configuration required for agents: polling interval and address of collector. Firewalls need to be configured for unidirectional communication of measurements from agents to collector. Poller needs to be configured with list of devices to poll, security credentials to access the devices and the set of measurements to retrieve. Firewalls need to be configured to allow bi-directional communication between poller and agents.
Latency The low overhead and distributed nature of the push model permits measurement to be sent more frequently, allowing the management system to quickly react to changes. In addition, many push protocols, like sFlow, are implemented on top of UDP, providing non-blocking, low-latency transport of measurements. The lack of scalability in polling typically means that measurements are retrieved less often, resulting in a delayed view of performance that makes the management system less responsive to changes. The two way communication involved in polling increases latency as connections are established and authenticated before measurements can be retrieved.
Flexibility Relatively inflexible: pre-determined, fixed set of measurements are periodically exported. Flexible: poller can ask for any metric at any time.
已邀请:

hxdhero

赞同来自:

给大神暖个贴

longXboy - golang

赞同来自:

pull 和push 最本质的区别是啥呢?

xu18158198660 - 90IT男

赞同来自:

如果处理系统来得及处理就push,反之pull

lrita

赞同来自:

方案选择没有统一的标准,参照上面的有缺对比,根据自己的项目需求、自己公司的体量、能够分配的资源统一做决定吧。 通常来说push的方案实现起来比较简单,起码不用考虑discovery的事。

gongxun - c/c++,golang,python,视频,深度学习领域

赞同来自:

  • 调研过好几个方案使用的都是push,如Scout/Datadog。
  • 我使用的是prometheus使用的是pull方式。

codinghxl

赞同来自:

之前我们公司用的是主动push模式

要回复问题请先登录注册