Skip to content

Shared memory

Gabriele Baldoni edited this page Apr 4, 2023 · 1 revision

Zenoh-Flow connectors and built-in Zenoh Sinks automatically use the Shared Memory transport of zenoh. Thus, some configuration parameters are exposed to configure the Shared Memory.

Connector

The connectors are the components that take care of sending user-plane data between two nodes, of the same flow, running on two different runtimes. Connectors are generated automatically by Zenoh Flow when instantiating the graph.

When using shared memory this connector, the one on sending side, must allocate a shared memory area where data is serialized and sent over zenoh to the receiving connector.

Connectors have a configurable size for the shared memory.

Connectors

Configuration within the runtime configuration, used for default values.

---
    pid_file : /var/zenoh-flow/runtime.pid
    path : /etc/zenoh-flow
    extensions: /etc/zenoh-flow/extensions.d
    zenoh_config: /etc/zenoh-flow/zenoh-daemon.json
    worker_pool_size: 4
    default_shared_memory_element_size: 10MiB
    default_shared_memory_elements: 10
    default_shared_memory_backoff: 100ms

And Configuration within the link descriptor is used only when specified

from:
   node : Counter
   output : Counter
to:
   node : SumOperator
   input : Number
shared_memory_element_size: 10MiB
shared_memory_elements: 10
shared_memory_backoff: 100ms

The configuration of the connector overwrites the one from the runtime.

Built-in sink

While for the built-in sink, the configuration can be part of the configuration dictionary, if not present the default values from the runtime will be used.

sinks:
  - id: zenoh-pub
    configuration:
        key-expressions: 
            id1: some/key/expr/to/publish
            id2: some/key/expr/to/publish2
         shared_memory_element_size: 5MiB
         shared_memory_elements: 10
         shared_memory_backoff: 100ms
    descriptor: builtin://zenoh

The configuration of the sink overwrites the one from the runtime.

Clone this wiki locally