Page 1 of 1

How to investigate disk usage growth with v-df-snapshot-diff

Posted: Fri Apr 24, 2026 5:03 pm
by isscbta
This guide explains how to investigate why disk usage increased on a myVesta server by comparing two disk usage snapshots.

The command used for this is:

Code: Select all

v-df-snapshot-diff
It compares two saved disk usage snapshots and shows which folders grew or decreased between those two points in time.

Typical use case

A client reports that available disk space decreased significantly, for example:
Can you tell us what happened? Disk space decreased by around 20 GB in one month, but we did not add new products or new content to the website.
In this situation, we can compare the disk usage snapshot from one month ago with the latest snapshot.

Example command

Code: Select all

v-df-snapshot-diff /usr/local/vesta/data/df/snapshot-2026-03-24-04-05-01.txt /usr/local/vesta/data/df/snapshot-2026-04-24-04-05-01.txt
Example output:

Code: Select all

Comparing file1: /usr/local/vesta/data/df/snapshot-2026-03-24-04-05-01.txt
Comparing file2: /usr/local/vesta/data/df/snapshot-2026-04-24-04-05-01.txt
--------------------------------
Done.
You can do:
mcview /usr/local/vesta/data/df-diff/diff-2026-04-24-15-59-58.txt
mcview /usr/local/vesta/data/df-diff/diff-size-sorted-2026-04-24-15-59-58.txt
mcview /usr/local/vesta/data/df-diff/diff-folder-sorted-2026-04-24-15-59-58.txt
The command creates three output files:
  • diff-YYYY-MM-DD-HH-MM-SS.txt - raw diff output
  • diff-size-sorted-YYYY-MM-DD-HH-MM-SS.txt - diff sorted by size, descending
  • diff-folder-sorted-YYYY-MM-DD-HH-MM-SS.txt - diff sorted by folder path
The most useful file for troubleshooting disk growth is usually:

Code: Select all

mcview /usr/local/vesta/data/df-diff/diff-size-sorted-YYYY-MM-DD-HH-MM-SS.txt
Example result

In this case, the first lines of the size-sorted diff showed:

Code: Select all

49181 /
48821 /home/exampleuser
48821 /home
48634 /home/exampleuser/web/example.com
48634 /home/exampleuser/web
45784 /home/exampleuser/web/example.com/public_html
45304 /home/exampleuser/web/example.com/public_html/wp-content
3729 /var
3209 /var/lib/mysql
2774 /home/exampleuser/web/example.com/_REMOTE_EXTRACT_TXT_
776 /var/lib/mysql/exampleuser_exampledb
520 /var/log
439 /var/log/apache2
260 /home/exampleuser/web/example.com/public_html/images
245 /home/exampleuser/web/example.com/public_html/wp-content/cache
220 /home/exampleuser/web/example.com/public_html/FILE_LOG
20 /home/exampleuser/web/example.com/public_html/wp-content/uploads
This means that the largest increase happened inside:

Code: Select all

/home/exampleuser/web/example.com/public_html/wp-content
The folder increased by approximately:

Code: Select all

45304 MB
That is around 45 GB.

Important note about reading the output

The numbers in the output are shown in MB.

Positive numbers mean that the folder increased in size.

Example:

Code: Select all

45304 /home/exampleuser/web/example.com/public_html/wp-content
This means that the folder increased by approximately 45 GB.

Negative numbers mean that the folder decreased in size.

Example:

Code: Select all

/baze -701
/baze-arhiva -2630
This means that these folders became smaller compared to the older snapshot.


Short usage mode

The command can also be used with snapshot indexes instead of full file paths.

Example:

Code: Select all

v-df-snapshot-diff 2 1
This compares the second latest snapshot with the latest snapshot.

Example output:

Code: Select all

Comparing file1: /usr/local/vesta/data/df/snapshot-2026-04-23-04-05-02.txt
Comparing file2: /usr/local/vesta/data/df/snapshot-2026-04-24-04-05-01.txt
This is useful when you want to quickly compare recent daily changes.

Useful examples

Compare yesterday with today:

Code: Select all

v-df-snapshot-diff 2 1
Compare an older snapshot with the latest one:

Code: Select all

v-df-snapshot-diff 30 1
Compare two exact snapshot files:

Code: Select all

v-df-snapshot-diff /usr/local/vesta/data/df/snapshot-2026-03-24-04-05-01.txt /usr/local/vesta/data/df/snapshot-2026-04-24-04-05-01.txt
Open the result sorted by largest growth:

Code: Select all

mcview /usr/local/vesta/data/df-diff/diff-size-sorted-YYYY-MM-DD-HH-MM-SS.txt

How to create a very fresh snapshot and see a difference between it and the latest created snapshot?

Code: Select all

v-df-snapshot-make-and-diff
The latest snapshot is usually created around 04 AM that day.
So, this command will create a new snapshot when you run it and compare it with the snapshot from 04 AM that day.
Keep in mind that if you run that command again on the same day, then the latest snapshot will not be a snapshot from 04 AM, but the snapshot from the last time you ran that command that day.

Basically, this command is just a 'shortcut' for:

Code: Select all

v-df-snapshot-make
v-df-snapshot-diff 2 1
('2 1' means compare the second latest with the first latest)


How to see the list of all snapshots?

Code: Select all

ls -lt /usr/local/vesta/data/df/

Finding the real cause

After identifying the folder that grew the most, inspect that folder manually.

Example:

Code: Select all

cd /home/exampleuser/web/example.com/public_html/wp-content
du -sh * .[^.]* 2>/dev/null | sort -h
In this case, the investigation showed a very large WordPress debug log file:

Code: Select all

/home/exampleuser/web/example.com/public_html/wp-content/debug.log
The file size was:

Code: Select all

126590M
That is approximately 126 GB.

This means that the disk space issue was not caused by new products or uploaded media, but by a huge WordPress debug log file.

Example screenshot result

Inside the WordPress wp-content directory, the following file was found:

Code: Select all

debug.log    126590M
This clearly showed that the main reason for disk usage growth was the WordPress debug log.


Common causes of huge debug.log files

A very large WordPress debug.log file usually means that WordPress debug logging is enabled and that some plugin, theme, or custom code is repeatedly generating PHP warnings, notices, deprecated messages, or fatal errors.

Common causes include:
  • WordPress debugging left enabled on a production website
  • A plugin generating repeated PHP warnings
  • A theme function causing repeated errors
  • WooCommerce or another large plugin producing repeated logs
  • Cron jobs triggering the same PHP error again and again
  • Bot traffic repeatedly hitting a problematic endpoint
Recommended next steps

First check whether WordPress debug logging is enabled in wp-config.php:

Code: Select all

grep -n "WP_DEBUG\|WP_DEBUG_LOG\|WP_DEBUG_DISPLAY" /home/exampleuser/web/example.com/public_html/wp-config.php
Typical production-safe values are:

Code: Select all

define('WP_DEBUG', false);
define('WP_DEBUG_LOG', false);
define('WP_DEBUG_DISPLAY', false);
If debug logging is enabled, disable it unless the developer explicitly needs it.

Then rotate, truncate, or remove the huge debug.log file.

To truncate the file safely without deleting it:

Code: Select all

truncate -s 0 /home/exampleuser/web/example.com/public_html/wp-content/debug.log
Or remove it:

Code: Select all

rm /home/exampleuser/web/example.com/public_html/wp-content/debug.log
After that, monitor whether the file starts growing again:

Code: Select all

watch -n 5 'ls -lh /home/exampleuser/web/example.com/public_html/wp-content/debug.log 2>/dev/null'
If it grows again quickly, inspect the latest log entries:

Code: Select all

tail -n 100 /home/exampleuser/web/example.com/public_html/wp-content/debug.log

Example client explanation

A short client-friendly explanation can look like this:
We compared the disk usage snapshot from one month ago with the latest snapshot.

The largest growth was detected inside the WordPress wp-content folder:

45304 MB /home/exampleuser/web/example.com/public_html/wp-content

After checking that folder, we found that the file wp-content/debug.log had grown to approximately 126 GB.

This means that the disk usage increase was not caused by new products or uploaded media, but by a WordPress debug log file. Such files usually grow when WordPress debug logging is enabled and some plugin, theme, or custom code repeatedly generates PHP warnings or errors.

We recommend disabling WordPress debug logging on the production website and checking the latest entries in debug.log to identify what is generating the errors.
Summary

The command v-df-snapshot-diff is useful for quickly identifying which folders caused disk usage growth between two dates.

The usual workflow is:
  1. Compare two snapshots with v-df-snapshot-diff
  2. Open the size-sorted diff file
  3. Find the folder with the largest positive growth
  4. Inspect that folder with du, ls, or mc
  5. Identify the exact file or directory causing the increase
  6. Take action, for example clean logs, disable debug mode, remove temporary files, or investigate application errors