Disk space being used at an alarming rate! Hungry Retool

Hello Retool brains trust!

I've noticed in the past few months that my self-hosted retool setup (done via Docker on Ubuntu) is continuously using more and more disk space on my server.

Is this normal behaviour?
All database use is external to this server so it is just the Retool instance which is on there.

Does anyone have any suggestions on how to stop or regulate this disk space usage by Retool?

Thanks in advance!

I think docker log rotation is required. But it is not clear to me how you implement that on a self hosted Retool that is already running.

Anyone have any ideas or suggestions?

Thanks :slight_smile:

Hi @bg1900 Thanks for reaching out! Are you still experiencing this issue? Docker can accumulate large volumes, images, and containers over time. Please make sure to always take a backup before conducting any clean-up operations.

You could try:

  • Docker Optimizations: Prune unused Docker objects using docker system prune to clean stopped containers, unused networks, and dangling images. You can delete old containers with docker container prune, unused images with docker image prune -a, and Docker volumes with docker volume prune. Docs from Docker on this can be found here. Backup all necessary data before executing these commands.
  • Logging: Trim the logs for your container if they are taking significant space.If you still observe high disk usage, a deeper dive into your Docker images and volumes would be helpful.

Let us know if that helps :crossed_fingers:

thanks Tess. It does seem like retool/docker is logging aggressively. But even with changing the settings (as advised elsewhere on the internet) it does seem to continue to progressively use up disk space.

Is there anything to prevent the logs from building up? - rather than pruning them or trimming them after they have already gotten large?

Thanks!

Hi @bg1900,

You could enable this environment variable, DISABLE_MEMORY_AND_CPU_USAGE_LOGGING

I'd also check what you have set for the log level env var, LOG_LEVEL

To minimise disk usage, would I want:
LOG_LEVEL = info
DEBUG = 0

DISABLE_MEMORY_AND_CPU_USAGE_LOGGING​ = true

is there anything else I am missing?

when I try modifyign the docker.env file I then get a bunch of errors when I put any of the above in

Hi @bg1900 Yes, that looks good. What errors? :thinking: Can you share a screenshot?

I believe if LOG_LEVEL and DEBUG are not included in the env file, the logging behaviour would be as though the env vars have been set to their respective default values:

  • LOG_LEVEL=info
  • DEBUG=0

The errors seem to have resolved. However the space taken up on the disk continues to increase.

Are there any other modifications I should be making?

Hmm what version of Retool are you using?

the latest stable self hosted version that was released (3.52.1-stable)

it seems that retool-onpremise_data/ is what is using up all of the space

and this directory gets bigger every day

Hi @bg1900,

Apologies for the delay here! Can you share where you configured the retool-onpremise_data volume? Are you able to share an example of what is being stored?

all good, figured it out. It was the logs!

Oh I'm glad to hear!

I have the same problem. How did you confirm it was the logs and how did you resolve your problem?

1. exec into your DB container like this:

(first get the name of your postgres DB container by running sudo docker ps)

then run this (where retool-onpremise_postgres_1 is:

sudo docker exec -it Your_postgres_container_name bash

2. then you can connect to your postgres DB from here with:

psql "dbname=$POSTGRES_DB host=$POSTGRES_HOST user=$POSTGRES_USER password = $POSTGRES_PASSWORD port=$POSTGRES_PORT" (you shouldn't have to replace these as it should use your environment variables) otherwise connect manually using psql and manually entering your values

3. Then you can query the table sizes of all the tables in your DB with:

SELECT relname as "Table", pg_size_pretty(pg_total_relation_size(relid)) As "Size", pg_size_pretty(pg_total_relation_size(relid) - pg_relation_size(relid)) as "External Size" FROM pg_catalog.pg_statio_user_tables ORDER BY pg_total_relation_size(relid) DESC;

1 Like