2 months ago
my Postgres memory is full how to I delete some of the data files to reuse the space I have purchased.
Pinned Solution
2 months ago
Memory or storage?
If you mean storage, follow these steps to clear the WAL:
1. This step is optional, but highly recommended: Backup the current volume in case something fatal happens. (Postgres service -> Backups -> New backup)
2. Set your Postgres start command to be sleep infinity and redeploy.
3. SSH into the container by clicking "Copy SSH Command" when right clicking Postgres
4. Run su postgres, followed by pg_resetwal -f /var/lib/postgresql/data/pgdata
5. There should be a log that says "Write-ahead log reset"
6. Remove the custom start command and redeploy
If you mean memory, you'd need to go to your service settings and increase the resource limit for memory then redeploy to save the configuration.
35 Replies
Status changed to Open Railway • about 2 months ago
2 months ago
Memory or storage?
If you mean storage, follow these steps to clear the WAL:
1. This step is optional, but highly recommended: Backup the current volume in case something fatal happens. (Postgres service -> Backups -> New backup)
2. Set your Postgres start command to be sleep infinity and redeploy.
3. SSH into the container by clicking "Copy SSH Command" when right clicking Postgres
4. Run su postgres, followed by pg_resetwal -f /var/lib/postgresql/data/pgdata
5. There should be a log that says "Write-ahead log reset"
6. Remove the custom start command and redeploy
If you mean memory, you'd need to go to your service settings and increase the resource limit for memory then redeploy to save the configuration.
0x5b62656e5d
Memory or storage? If you mean storage, follow these steps to clear the WAL: 1\. This step is optional, but highly recommended: Backup the current volume in case something fatal happens. (Postgres service -> Backups -> New backup) 2\. Set your Postgres start command to be sleep infinity and redeploy. 3\. SSH into the container by clicking "Copy SSH Command" when right clicking Postgres 4\. Run `su postgres`, followed by `pg_resetwal -f /var/lib/postgresql/data/pgdata` 5\. There should be a log that says "Write-ahead log reset" 6\. Remove the custom start command and redeploy If you mean memory, you'd need to go to your service settings and increase the resource limit for memory then redeploy to save the configuration.
2 months ago
Wouldn't trying to increase the volume size be better as a first solution (if OP didn't do it already)? Plus, OP is on the hobby plan, they don't have access to backups from their service settings.
2 months ago
An alternative to SSHing into your service is: after increasing the volume size you can set your start command as
bash -c 'rm -f /var/lib/postgresql/data/pgdata/postmaster.pid && runuser -u postgres -- pg_resetwal -f /var/lib/postgresql/data/pgdata && sleep 10 && exit 0'
If it logs: "Write-ahead log reset" you can remove the start command and redeploy to see if it works.
darseen
Wouldn't trying to increase the volume size be better as a first solution (if OP didn't do it already)? Plus, OP is on the hobby plan, they don't have access to backups from their service settings.
2 months ago
what should I do then?
medim
An alternative to SSHing into your service is: after increasing the volume size you can set your start command as `bash -c 'rm -f /var/lib/postgresql/data/pgdata/postmaster.pid && runuser -u postgres -- pg_resetwal -f /var/lib/postgresql/data/pgdata && sleep 10 && exit 0'` If it logs: "Write-ahead log reset" you can remove the start command and redeploy to see if it works.
2 months ago
if I remove some workflows will it help to decrease some volume?
if I remove some workflows will it help to decrease some volume?
2 months ago
Unlikely. Start with resetting the WAL.
0x5b62656e5d
Unlikely. Start with resetting the WAL.
2 months ago
how do I do that because now my n8n says workflow server down.
2 months ago
I can do backup on hobby account?
0x5b62656e5d
Unfortunately no.
2 months ago
ok so there is no other way then upgrading my plan to pro? can I do resize?
2 months ago
You can click into the volume, go to its settings, and resize from there.
2 months ago
yeh I m not able to do it its asking me to write I want to resize when I write it I dont get option for next step, and how much will I get charge for resizing?
2 months ago
Resizing is free. You'll only get charged for the amount of storage you use.
2 months ago
I dont understand??
2 months ago
You need to type exactly I want to resize the volume. There's an extra space at the back.
2 months ago
how much size should I chose
and I will be charge for the resize gb I used at the end of the month?
how much size should I chose and I will be charge for the resize gb I used at the end of the month?
2 months ago
You will only be charged for the amount of storage you used. If you used 3 GB, you'll be charged for how long you used 3 GB. Resizing to 5 GB does not mean you'll be charged for 5 GB, unless you actually used that much storage.
2 months ago
so what do you suggest I should chose 10gb or 20gb as I m just learning n8n at the moment?
2 months ago
This is up to you. You can start with resizing to 5 GB, then increase as needed.
You can also clear the WALs with the steps written above.
2 months ago
it says failed to resize?
what do I do now?
2 months ago
I have send you screenshot so you can see whats the error.
Attachments
2 months ago
The error explains everything...
You can only resize up to 5 GB on the Hobby plan.
2 months ago
yes but the is no option for 5 gb mini option is 10 gb
what should I do then?
2 months ago
Do not reset WAL to save disk space. It's a temporary fix that risks database corruption, unless you know what you're doing. Plus, it will fill up the space again.
You should increase your disk size instead. If your disk size is currently 5GB, then you need to upgrade to the pro plan to increase the size beyond 5GB.
2 months ago
so either way I need to upgrade to pro plan right?
2 months ago
You can reset WAL (with the risk of database corruption) or upgrade to the Pro plan to increase your volume limit.
2 months ago
yes I dont want to risk of data base corruption. I will probably upgrade, but do I need to restart entire system after upgrade.
2 months ago
After upgrading to Pro and expanding the volume, I would redeploy the service.
0x5b62656e5d
After upgrading to Pro and expanding the volume, I would redeploy the service.
2 months ago
so my n8n link will be changed or will it stay same?
Status changed to Open brody • about 2 months ago
Status changed to Solved 0x5b62656e5d • 10 days ago