Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does cardano-graphql-v7.0.0 use 1.8T disk space #808

Closed
apufvqsp opened this issue Feb 2, 2023 · 2 comments
Closed

Why does cardano-graphql-v7.0.0 use 1.8T disk space #808

apufvqsp opened this issue Feb 2, 2023 · 2 comments
Labels
question Further information is requested

Comments

@apufvqsp
Copy link

apufvqsp commented Feb 2, 2023

Ask a question

hi

I am using cardano-graphql-v7.0.0, it has been running for 4 months, and now I find that it takes up 1.8T of disk space,

is this a normal disk usage?
Is there a way to reduce disk usage?

@apufvqsp apufvqsp added the question Further information is requested label Feb 2, 2023
@airstring
Copy link

How did you deploy ada?My node takes up 700G of disk space.

@infnada
Copy link

infnada commented Feb 7, 2023

I also had an unusual increment of disk space in the Asset table caused by an error in Psql Toast. Thats a big shot without more info from your side but what i would do:

  1. Check which table/s is using this much space:

https://stackoverflow.com/a/52706756

Modified version:

select current_database() as database,
       pg_size_pretty(total_database_size) as total_database_size,
       schema_name,
       table_name,
       pg_size_pretty(total_table_size) as total_table_size,
       pg_size_pretty(table_size) as table_size,
       pg_size_pretty(index_size) as index_size
       from ( select table_name,
                table_schema as schema_name,
                pg_database_size(current_database()) as total_database_size,
                pg_total_relation_size(quote_ident(table_name)) as total_table_size,
                pg_relation_size(quote_ident(table_name)) as table_size,
                pg_indexes_size(quote_ident(table_name)) as index_size
                from information_schema.tables
                where table_schema=current_schema()
                order by total_table_size
            ) as sizes;
  1. check for any table where index_size + table_size != total_table_size
  2. perform a VACUUM FULL "TABLE_NAME"; on the tables affected
  3. if you have Toast error like me you can follow https://stackoverflow.com/a/68194898 to solve it

My DB is ~300GB but Assets metadata are not fully synced

NOTE: i'm not a psql DBA and i'm not using this in PROD environment. DYOR before executing anything

@apufvqsp apufvqsp closed this as completed May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants