DB growing, how to shrink?

Eria211

Cadet
Joined
May 19, 2020
Messages
9
Hi

Similar issue in this thread: https://www.truenas.com/community/threads/what-is-ixdb-base.88193/ my DB is now 50gb+

Just like the poster, I initially had this set to 24 months, ive now set it to 1 month and I have not seen any space recovered

I have left it for some time now and restarted the docker image hoping it was something that may run on boot

Is there something I can do to restore this space or is my only option starting over?
 

aervin

iXsystems
iXsystems
Joined
Jun 13, 2018
Messages
114
Hey @Eria211 , unfortunately there are no simple remedies for this :confused: . We've had a lot of issues with Postgres, which prompted us to move to InfluxDB for 2.0. We officially recommend that users facing your issue should update to the 2.0 nightlies (and upcoming beta). Your data will not be ported over, but it should give you a fresh start that doesn't bloat like Postgres. Sorry if this is not welcome news. Let us know if we can be of more help.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Hey @Eria211 , unfortunately there are no simple remedies for this :confused: . We've had a lot of issues with Postgres, which prompted us to move to InfluxDB for 2.0. We officially recommend that users facing your issue should update to the 2.0 nightlies (and upcoming beta). Your data will not be ported over, but it should give you a fresh start that doesn't bloat like Postgres. Sorry if this is not welcome news. Let us know if we can be of more help.
Ah! So that's why the disk usage shrank like *poof* when I switched to the nightlies :wink:
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
I am sure among others, but yes.
 

smillan

Cadet
Joined
Jan 15, 2021
Messages
8
Can somebody provide the link to the 2.0 as I'm facing this exact same ballooning of the underlying disk

cheers,
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Can somebody provide the link to the 2.0 as I'm facing this exact same ballooning of the underlying disk

If you are using docker-compose, simply replace ixsystems/truecommand:latest with ixsystems/truecommand:nightly
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
There is no dedicated download, that's why they are called "nightlies" :wink:

You can either reverse engineer (or maybe someone from iX is willing to share) how the VM is constructed and update inside the VM. Or you do as I did and install an empty Ubuntu VM, install Docker Compose, and then essentially this:

1. Install Docker and create application directory
Code:
apt-get install docker-compose
mkdir -p /app/ixsystems/truecommand


2. Create /app/ixsystems/truecommand/docker-compose.yml
Code:
version: '3.3'
services:
  truecommand:
    container_name: truecommand
    restart: always
    image: 'ixsystems/truecommand:nightly'
    ports:
      - '80:80'
      - '443:443'
    volumes:
      - '/app/ixsystems/truecommand:/data'


3. Create /app/ixsystems/truecommand/update.sh
Code:
#! /bin/sh

mydir=`dirname "$0"`

cd "${mydir}" || exit 1
exec >>update.log 2>&1

echo "======================================================"
echo -n "Checking for updates: "
date
echo "======================================================"

docker-compose pull
docker-compose up -d
docker image prune -f

echo ""


4. Make executable and create cron job: 0 0 * * * /app/ixsystems/truecommand/update.sh
Code:
chmod 755 /app/ixsystems/truecommand/update.sh
crontab -e


5. Run the job once manually: /app/ixsystems/truecommand/update.sh
 

aervin

iXsystems
iXsystems
Joined
Jun 13, 2018
Messages
114
Just some clarification, our old VM builds are essentially Ubuntu + Docker + a startup script. In the end, we feel it's simpler to just provide a stable container and allow self-hosters to manage the OS/Docker directly. Thanks for trying out the nightlies @smillan !
 
Top