Transports

Overview

TransportLatencyStatus
LoopbackFastestAvailable, stacked simulations (single process).
TCPFastestPlanned.
RedisFasterRecommended.
Redis PubSubFastAvailable, stable.
RESPFastUnder consideration, for cloud connectivity (tunnelling).
gPPCFastUnder consideration, for cloud connectivity (HTTP).
Redis AsyncSlowerAvailable, experimental.
MsgQueueSlowestDiscontinued, poor performance at scale.

Usage

A transport can be specified in a number of ways, however typically a transport will be configured in a Stack Configuration (YAML) or via an Environment Variable.

Stack Configuration

Example Simulation Stack

simulation.yaml
---
kind: Stack
metadata:
  name: example
spec:
  connection:
    transport:
      redis:
        uri: redis://localhost:6379
        timeout: 60

Environment Variables

VariableCLI Option (ModelC/Simer)Default
SIMBUS_TRANSPORT--transportredispubsub
SIMBUS_URI--uriredis://localhost:6379
N/A--timeout60 (seconds)

Note: Simer parameters have only a single - prefix (i.e. -transport). Environment variables can be specified with the -env parameter.

Transports

Loopback

The loopback transport implements a limited SimBus algorithm which makes it possible to run a model, or a stack of models, without connecting to a SimBus. Because the messaging associated with connecting to a SimBus is removed (or internalised) by the loopback, this is the fastest transport available when building simulations, however it is only suitable for particular deployment scenarios and when developing models.

Note: The loopback transport is only suitable for stacked simulations (i.e. models are arranged within single process).

Configuration Parameters

ParameterExample
transport (name)loopback
uriloopback
timeout (seconds)60

Redis

The redis transport is recommended for connecting models in a simulation. It uses blocking Redis commands and simple data types to implement a message exchange mechanism.

Configuration Parameters

ParameterExample
transport (name)redis
uriredis://localhost:6379
timeout (seconds)60

Redis Async

An experimental transport which uses and asynchronous Redis library. The performance was slower than expected; its still fast, however the redis transport is faster; and development has stopped.

Configuration Parameters

ParameterExample
transport (name)redis
uriredisasync://localhost:6379
timeout (seconds)60

Redis PUB/SUB

The redispubsub transport is the original, and reference, implementaion. Migration to the newer redis transport is recommended.

Note: In some deployment scenarios, particularly clould environments, the redispubsub transport might not work. In such cases the newer redis transport will operate correctly.

Configuration Parameters

ParameterExample
transport (name)redispubsub
uriredis://localhost:6379
timeout (seconds)60