Skip to main content

UDP

Synopsis

Creates a server that accepts network messages over UDP connections. Supports high-volume message ingestion with configurable workers and buffering options.

Schema

- id: <numeric>
name: <string>
description: <string>
type: udp
tags: <string[]>
pipelines: <pipeline[]>
status: <boolean>
properties:
address: <string>
port: <numeric>
reuse: <boolean>
workers: <numeric>
buffer_size: <numeric>

Configuration

The following fields are used to define the device:

Device

FieldRequiredDefaultDescription
idYUnique identifier
nameYDevice name
descriptionN-Optional description
typeYMust be udp
tagsN-Optional tags
pipelinesN-Optional pre-processor pipelines
statusNtrueEnable/disable the device

Connection

FieldRequiredDefaultDescription
addressN"0.0.0.0"Listen address
portYListen port

Advanced Configuration

To enhance performance and achieve better event handling, the following settings are used.

Performance

FieldRequiredDefaultDescription
reuseNtrueEnable socket address reuse
workersNCPU countNumber of worker processes when reuse is enabled. Capped at the number of physical cores.
buffer_sizeN9000Network read buffer size in bytes
note

flush_interval and queue.interval are Director service-level settings configured in vmetric.yml and cannot be overridden per device.

Examples

The following are commonly used configuration types.

Basic

Creating a minimal UDP listener using defaults for address and buffer size:

Creating a simple UDP server...

devices:
- id: 1
name: basic_udp
type: udp
properties:
port: 514

High-Volume

Optimizing for high message volumes...

devices:
- id: 2
name: performant_udp
type: udp
properties:
address: "0.0.0.0"
port: 514
reuse: true
workers: 4
buffer_size: 32768
note

The worker count will be automatically capped at the number of available cores.

Multiple Ports

Multiple UDP servers with different ports and independent worker pools:

Listening on multiple ports using separate configurations...

devices:
- id: 3
name: udp_server_1
type: udp
properties:
port: 514
workers: 2

- id: 4
name: udp_server_2
type: udp
properties:
port: 515
workers: 2
note

When running multiple UDP servers, ensure that each configuration has a unique port number, and consider the total number of workers across all instances relative to the available system resources.