Skip to content
This repository was archived by the owner on Dec 4, 2018. It is now read-only.
This repository was archived by the owner on Dec 4, 2018. It is now read-only.

Message buffering and frequencies #23

@nateyazdani

Description

@nateyazdani

Given that plugins are stateless, the function of running them at certain frequencies has really become to reduce traffic to/from the database and to ensure that the respective models are updated at a known frequency. For example, statscache has plugins to count the volume of messages over given intervals (e.g., 1s, 5s) that are run at frequencies of the same intervals. So the volume per second plugin runs once per second. However, it cannot take advantage of this fact and simply record the number of messages received each time it runs, firstly because it is supposed to be stateless and secondly because some messages timestamped within the interval may arrive too late. Therefore, each plugin realistically needs to iterate over all messages received, check each timestamp, and then perform whatever processing needed. If I'm not missing anything, then plugins are not really affected or benefited by controlling their individual processing frequencies.

I would like to propose that we consider the following two options:

  1. Real-time processing: Handle each message when it arrives, perhaps by implementing plugins as FedmsgConsumers directly. The obvious benefit to this is that stats models are always up-to-date, which is very cool, but the downside is potentially heavy traffic to the database when things get busy.
  2. Standard update frequency: Use a single polling producer to run all plugins at an application-configurable interval (e.g., 1s). This isn't a whole lot different from what we're doing now. If the first option is too risky, this would be a good middle-ground, as database I/O will be more predictable.

Thoughts? If there are any alternative ideas or aspects that I'm missing, I'd be happy to hear about them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions