avito-tech / bioyino

High performance and high-precision multithreaded StatsD server
The Unlicense
229 stars 20 forks source link

Standalone mode ? #7

Closed ihard closed 6 years ago

ihard commented 6 years ago

How run app for one node with out consul?

Albibek commented 6 years ago

Specify an empty list of nodes in network section. Consul will not started in this case. Not so obvious setting, but there is TODO to fix it.

ihard commented 6 years ago

My config:

# This is an example config showing all the options, filled with default values

verbosity = "warn"

# Number of async UDP network worker threads, use 0 to use all CPU core
n-threads = 2

# Prefix for sending own stats
stats-prefix = "bioyino.info.ten_second"

# How often to gather own stats, in ms. Use 0 to disable (stats are still gathered, but not included in
# metric dump
stats-interval = 10000

# Queue size for single counting thread before packet is dropped
task-queue-size = 1024

[metrics]
# Should we provide metrics with top update numbers
count-updates = true
# Prefix for metric update statistics (no trailing dot!)
update-counter-prefix = "bioyino.info.ten_second.updates"

# Suffix for metric update statistics (no leading dot!)
update-counter-suffix = "count1"

# Minimal update counter to be reported
update-counter-threshold = 1

# Network settings
[network]
# Address:port to listen for metrics at
listen = "127.0.0.1:8128"

# Address and port for replication/command server to listen on
peer-listen = "127.0.0.1:8136"

# IP and port of the carbon-protocol backend to send aggregated data to
backend = "127.0.0.1:2013"

# How often to send metrics to carbon backend, ms
backend-interval = 10000

# UDP buffer size for single packet. Needs to be around MTU. Packet's bytes after that value
# may be lost
bufsize = 1500

# Enable multimessage(recvmmsg) mode
multimessage = false

# Number of multimessage packets to receive at once if in multimessage mode
mm-packets = 100

# Nmber of green threads for single-message mode
greens = 4

# Socket pool size for single-message mode
snum = 4

# List of nodes to replicate metrics to
nodes = []

# Interval to send snapshots to nodes, ms
snapshot-interval = 1000

[consul]
# Start in disabled leader finding mode
start-disabled = false

# Consul agent address
agent = "127.0.0.1:8500"

# TTL of consul session, ms (Consul cannot set it to less than 10s)
session-ttl = 11000

# How often to renew Consul session, ms
renew-time = 1000

# Key name to lock in Consul
key-name = "service/bioyino/lock"

i tried: start-disabled = true app run, but not calculate any metric (only internal statistic)

nodes = nodes = "" app not run

Albibek commented 6 years ago

You need to use nodes = [] if you want empty list. No metrics is because you probably send only one. It stays in the buffer for performance reasons. If you have a low number of metrics, try decreasing task-queue-size to approximate number of metrics you receive per 10 seconds

ihard commented 6 years ago

Thank you!