Skip to content

Comments

reduce influxdb retention period and store interval#162

Merged
MarkTNO merged 3 commits intomainfrom
161-decrease-influxdb-memory-usage
Jul 14, 2025
Merged

reduce influxdb retention period and store interval#162
MarkTNO merged 3 commits intomainfrom
161-decrease-influxdb-memory-usage

Conversation

@MarkTNO
Copy link
Contributor

@MarkTNO MarkTNO commented Jul 4, 2025

No description provided.

@MarkTNO MarkTNO linked an issue Jul 4, 2025 that may be closed by this pull request
@MarkTNO MarkTNO requested a review from cwang39403 July 4, 2025 12:49
@MarkTNO
Copy link
Contributor Author

MarkTNO commented Jul 4, 2025

I restarted influx on the test env to apply these settings.
The _internal db size (and memory usage) should decrease now over the span of a week: the old retention setting was 1 week.
We wait for this before deploying on prod.

@cwang39403
Copy link

I restarted influx on the test env to apply these settings. The _internal db size (and memory usage) should decrease now over the span of a week: the old retention setting was 1 week. We wait for this before deploying on prod.

Was the old retention setting of 1 week applied manually in the past?

If I run the following query on Test InfluxDB
SHOW RETENTION POLICIES ON "_internal"

I see "monitor" policy is still there. I was expecting to see "short" policy instead. Do I miss anything?

@MarkTNO
Copy link
Contributor Author

MarkTNO commented Jul 7, 2025

You are right, that should have been there. Maybe it wasn't set properly or it got removed automatically.
The setup.sh script does not work properly when the influxdb contains a lot of data, since the startup of influxdb takes too long.
In the past this retention setting was set to default.
Now I updated this manually, we should keep an eye on this.
The store interval was setup properly (via influxdb.conf): since last Friday the size of the _interval database decreased from 3GB to 1.6GB.

@cwang39403
Copy link

Another reason to have a simple monitoring mechanism in OMOTES, perhaps?

Since we have now created the retention policy manually, maybe good to mention that in the README?

@MarkTNO
Copy link
Contributor Author

MarkTNO commented Jul 10, 2025

Readme updated 5ade481

On the NWN test environment after 1 week (old retention period) with store interval from 10s to 5 min and retention from 7d to 1d:

  • _internal db size from 3GB to 54 MB
  • influxdb memory usage, after a influxdb container restart, a factor 6/7 lower
  • lower cpu usage

@MarkTNO MarkTNO merged commit f90f77f into main Jul 14, 2025
1 check passed
@MarkTNO MarkTNO deleted the 161-decrease-influxdb-memory-usage branch July 14, 2025 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

decrease influxdb memory usage

2 participants