InfluxDB vs VictoriaMetrics

There is an official docker Image of victoriametrics for all platforms, too. I can send you a docker-compose.yml and some examle config of you like. I used this for testing in a ARM MacBook m1 before i created the addon.

I have been using the official docker image since the start of this thread :slight_smile:

The title of this thread was " InfluxDB vs VictoriaMetrics"

What I read is InfluxDB 1.x was what people were using. InfluxDB 2.x is different and not so HA friendly.
Q1: Is it likely that InfluxDB 1 will become unsupported, stop working at some version change and leave the HA Grafana community with a broken solution

If Q1 would the HA community not be migrating or planning to migrate to something else?
Clearly the positive voices and contributors to community solutions in this thread have already moved away from InfluxDB

Q2: Do we think the HA community will move enmass to victoria metrics or is there some other time based DB the community will flock to (and support)?

Q3: How resource intensive is Victoria Metrics? Do I read correctly it has the least resource requirements of the time based DBs I might use?
[The question is can I run it (happily) on my Pi - B 1GB?
I know I could do with a better PI its on the list for when they become generally available again]

Any thoughts or answers gratefully received :slight_smile:

@ fuslwusl
or anyone using this add-on

Does this add-on auto-update the Victoria Metrics code/ executable?

Do I have to have a PI4?
“This Add-on makes it easy to run a Victoria Metrics Time Series Database on your Home Assistant OS on ARM64 systems like Raspberry Pi 4.”
( homeassistant-addon-victoriametrics/victoria-metrics at main · fuslwusl/homeassistant-addon-victoriametrics · GitHub )

Q3: How resource intensive is Victoria Metrics? Do I read correctly it has the least resource requirements of the time based DBs I might use?

Correct, VM is not (relatively) resource intensive.

The question is can I run it (happily) on my Pi - B 1GB?

Not sure what a Pi B is (it runs fine on my Pi 4b 2Gb though) alongside HA (docker) and a bunch of other things.

…hard to say what the trend will be, but I consider VM a top contender and the logical choice for those who don’t want to deal with InfluxDB 2.

fwiw, I’ve been running both side by side on a pi4 with no performance issues. as far as I can tell the storage is comparable and I’ll be shutting down Influx in the near future and sticking with VM.

Same experience here, but switched Influx off a couple of weeks ago. Keeping the data as I don’t know how to import it into VM.

sorry that was a typo, I meant: “Pi 3B+” it has 1GB of RAM from 2018
Raspberry Pi 3 B+

Sorry for my late answer. The binary ist loaded from the official Victoria metrics repo. I will release new versions when someone needs it.

I didn’t like the bloated influxdb way anymore and Victoria Metrics was the logical choice. Tiny, fast, stable and reliable. Never had a problem on my pi4 since the switch to Victoria Metrics. So give it a try and i hope you will like it as much as i do.

Tiny, fast, stable and reliable.
How Tiny?
Does anyone have any stats of how much memory /swap it uses.
I’m already struggling with the 1GB in my PI.
(Yes the obvious answer is a bigger PI, but as we all know they are in short supply!)

I will release new versions when someone needs it.
@fulwusl THANKYOU (My of my friends is already using, its on my plans too, see above)

I’ve been at this for some time now… I used InfluxDB for a long time but got discouraged when 2.0 was released because i couldn’t figure it out. Now I’ve managed to both have Grafana work with InfluxQL and have the InfluxDB-integration in Home Assistant write directly to VitoriaMetrics, which means values are written at change instead of scraped :slight_smile:
Write if you wanna know more.

Interesting. I would certainly like to knife more!

Some knifeledge for you @jchh :stuck_out_tongue_winking_eye:
I run it in docker with compose and my VictoriaM-container looks like this:

influxdb:
    container_name: influxdb
    image: "influxdb:latest"
    restart: unless-stopped
    ports:
      - 8086:8086
      - 8083:8083
      - 2003:2003
    env_file:
      - ~/iotstack/configurations/influxdb.env #<-- see below
    volumes:
      - ~/iotstack/influxdb/data:/var/lib/influxdb2
      - ~/iotstack/influxdb/backup:/var/lib/influxdb/backup
# I can't remember why I have the line below 😁
    command: influxd run --bolt-path /var/lib/influxdb2/influxd.bolt --engine-path /var/lib/influxdb2/engine --store bolt

  victoriametrics:
    container_name: victoriametrics
    image: victoriametrics/victoria-metrics:latest
    volumes:
      - ~/iotstack/victoriametrics/data:/storage
    command:
      - "--storageDataPath=/storage"
#      - "--graphiteListenAddr=:2003"
      - "--opentsdbListenAddr=:4242"
      - "--httpListenAddr=:8428"
      - "--influxListenAddr=:8089"
      - "--vmalert.proxyURL=http://vmalert:8880"
      - "--retentionPeriod=3y"
      - "--selfScrapeInterval=20s"
      - "--loggerTimezone=Europe/Stockholm"
    network_mode: host
    restart: unless-stopped

*I think there might be some commands in victoriametrics compose that aren’t needed…

#2012-12-07
TZ=Europe/Stockholm
INFLUXDB_DATA_ENGINE=tsm1
INFLUXDB_REPORTING_DISABLED=false
INFLUXDB_HTTP_ENABLED=true
INFLUXDB_HTTP_AUTH_ENABLED=true
INFLUXDB_ADMIN_ENABLED=true
INFLUXDB_ADMIN_USER=YOURUSER
INFLUXDB_ADMIN_PASSWORD=YOURPASSWORD

#INFLUXDB_USER=nodered
#INFLUXDB_USER_PASSWORD=nodered
#INFLUXDB_READ_USER=myreaduser
#INFLUXDB_READ_USER_PASSWORD=myreadpassword
#INFLUXDB_WRITE_USER=mywriteuser
#INFLUXDB_WRITE_USER_PASSWORD=mywritepassword

We can write immediately to VM with the influx integration in Home Assistant.

I just copied my previous Influx in configuration.yaml but chagned the port to 8428
(see “–httpListenAddr=:8428”)

#influxdb
influxdb:
  api_version: 2
  ssl: false
  host: 192.168.1.59
  port: 8086
  token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  organization: xxxxxxx
  bucket: HA
  tags:
    source: HA
  tags_attributes:
    - friendly_name
    - device_class
  default_measurement: units
  
#victoriametrics
influxdb:
  api_version: 2
  ssl: false
  host: 192.168.1.59
  port: 8428  #<-- port changed
  token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  organization: xxxxxxx
  bucket: HA
  tags:
    source: HA_VM
  tags_attributes:
    - friendly_name
    - device_class
  default_measurement: units

To read this in Grafana.
Influx-Query Language

Add datasource → InfluxDB
URL: http://192.168.1.59:8428
Select Basic Auth
User: YOURUSER
Password: YOURPASSWORD
I only use one user/pass and not different for each DB. Up to you.

Go to InfluxDB → “arrow pointing up in menu on the left” → API Tokens.
Generate a new token.
*Note, I also use this token in the compose file above.

Click Add header → Enter Authorization in the first field.
Enter Token YOUR VERY LONG TOKEN ← Note the space between Token and actual token.

Victoria Metrics
Add datasource → Prometheus
URL: http://192.168.1.59:8428
*I haven’t experimented with passwords for VM so there is not much more to do. Just click “Save and test”.

2 Likes

awesome - I also use Docker so will try this over the weekend - thanks!

Hey all,
I work as a DevRel over at InfluxData. Hearing your pain over the 1.X to 2.X move of InfluxDB OSS. If you have any questions or ideas to pass on happy to take them back to the team.

To help answer some of your questions:

  1. 2.X still has influxql support available: Use Grafana with InfluxDB OSS | InfluxDB OSS 2.6 Documentation

  2. 2.X also provides inbuilt dashboarding capabilities and automation via tasks.

  3. 1.8.10 or InfluxDB is also alive and well but completely understand if Victoria Metrics fits your use case better.

1 Like

would I be right in assuming the excludes/filters are that are listed for influx will be applied to VM as well?

eg:

influxdb:
  [[...]]
  exclude:
    domains:
      - alarm_control_panel
      - sun
      - updater
      - media_player
      - zone
      - device_tracker
      - remote
      - weather

in my current docker-compose (pre your changes), I only have the following:

    command:
      - "--selfScrapeInterval=60s"      # to enable self-monitoring => Grafana dashboard
      - "--retentionPeriod=3y"          # default is "1 m"
      - "--storageDataPath=/storage"
      - "--httpListenAddr=:8428" 

I would assume that since the filtering is done before pushing, and we only change where the data is pushed.

1 Like

I don’t have this line.

1 Like