All I want is simply to know how much space my InfluxDB database takes on my HDD. The stats() command gives me dozens of numbers but I don't know which one shows what I want.
4 Answers
Stats output does not contain that information. The size of the directory structure on disk will give that info.
du -sh /var/lib/influxdb/data/<db name>
Where /var/lib/influxdb/data
is the data directory defined in influxdb.conf
.

- 5,140
- 1
- 19
- 31
-
5Is there any way to check it using the influx CLI? – Saim Raza Aug 20 '20 at 07:05
-
6For InfluxDB 2.0, the path is `du -sh /var/lib/influxdb/engine/data/` – Alex May 06 '21 at 05:01
-
There are other built-in options for InfluxDB v1.x and v2.x. See my findings in the other thread below. – Munin Sep 29 '22 at 10:47
In InfluxDB v1.x, you can use following command to find out the disk usage of database, measurement and even shards:
influx_inspect report-disk -detailed /var/lib/influxdb/data/
In InfluxDB v2.x, you could take advantage of the internal stats as following:
from(bucket: "yourBucket")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "storage_shard_disk_size")
|> filter(fn: (r) => r["_field"] == "gauge")
|> last()

- 1,576
- 2
- 19
Also check .influxdb
in your user's home directory.
If you already run influxd
, you can check which file descriptors it keeps open:
$ pgrep -a influxd
<influxd PID> <full command path>
$ ls -l /proc/<influxd PID>/fd
For example, I have an influxd
from a prebuilt package influxdb-1.8.6_linux_amd64.tar.gz
. It is simply unpacked in /home/me/bin/
and runs as a user command. There is neither /var/lib/influxdb/
nor /etc/influxdb/influxdb.conf
. There is ~/bin/influxdb-1.8.6-1/etc/influxdb/influxdb.conf
, but it is not actually used. However, the list of file descriptors in /proc/<PID>/fd
shows that it keeps several files opened under:
/home/me/.influxdb/data
/home/me/.influxdb/data/<my_db_name>/_series
/home/me/.influxdb/wal/<my_db_name>/
But do not take this for granted, I am not an influxdb
expert. Notice that 1.8 is an old version, there might be some tricks in other versions.

- 4,224
- 4
- 27
- 36
For InfluxDB 2.0 on MacOS - (for me at least) - the location is ~/.influxdbv2/engine.
Running "du -sh *" will show you the disk usage.