W
Wasp2mo ago
Sven

How can i check size of my fly.io database size?

In fly I want to know how I can see the size of my fly.io database postgres. Like how much % of size is taken already I know not really wasp related but i know some people understnad this well and done it before.
1 Reply
kapa.ai
kapa.ai2mo ago
Hi @Sven. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- To check the size of your Fly.io PostgreSQL database, you can follow these steps: 1. First, connect to your Fly.io database using the Fly CLI. Run the following command in your terminal:
fly postgres connect -a <your-db-name>
fly postgres connect -a <your-db-name>
This will connect you to the PostgreSQL interactive terminal (psql) Fly.io (server and database) (https://wasp-lang.dev/docs/advanced/deployment/manually#flyio-server-and-database). 2. Once connected, you can use PostgreSQL queries to check the database size. Here's a query that will show you the size of your database and its usage:
SELECT pg_size_pretty(pg_database_size(current_database())) as db_size,
pg_size_pretty(pg_database_size(current_database()) * 100.0 /
(SELECT setting::bigint FROM pg_settings WHERE name = 'max_connections')) as usage_percentage;
SELECT pg_size_pretty(pg_database_size(current_database())) as db_size,
pg_size_pretty(pg_database_size(current_database()) * 100.0 /
(SELECT setting::bigint FROM pg_settings WHERE name = 'max_connections')) as usage_percentage;
This query will return the current size of your database and an estimate of the usage percentage based on the maximum connections setting. Unfortunately, I don't have specific information about Fly.io's database size limits or how to view them directly through the Fly.io interface. If you need more detailed information about your database usage and limits, you might want to check the Fly.io dashboard or contact their support for more specific guidance. Remember to be cautious when connecting to your production database and running queries, as it can affect your application's performance Github Issue: Update the database docs on seeding the production DB on Fly (https://github.com/wasp-lang/wasp/issues/1464). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Sven, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?

Did you find this page helpful?