a month ago
my Postgres memory is full how to I delete some of the data files to reuse the space I have purchased.
35 Replies
Status changed to Open Railway • about 1 month ago
a month 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.
a month 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.
a month 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.
a month 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.
a month 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?
a month ago
Unlikely. Start with resetting the WAL.
0x5b62656e5d
Unlikely. Start with resetting the WAL.
a month ago
how do I do that because now my n8n says workflow server down.
a month ago
I can do backup on hobby account?
0x5b62656e5d
Unfortunately no.
a month ago
ok so there is no other way then upgrading my plan to pro? can I do resize?
a month ago
You can click into the volume, go to its settings, and resize from there.
a month 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?
a month ago
Resizing is free. You'll only get charged for the amount of storage you use.
a month ago
I dont understand??
a month ago
You need to type exactly I want to resize the volume. There's an extra space at the back.
a month 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?
a month 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.
a month ago
so what do you suggest I should chose 10gb or 20gb as I m just learning n8n at the moment?
a month 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.
a month ago
it says failed to resize?
what do I do now?
a month ago
I have send you screenshot so you can see whats the error.
Attachments
a month ago
The error explains everything...
You can only resize up to 5 GB on the Hobby plan.
a month ago
yes but the is no option for 5 gb mini option is 10 gb
what should I do then?
a month 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.
a month ago
so either way I need to upgrade to pro plan right?
a month ago
You can reset WAL (with the risk of database corruption) or upgrade to the Pro plan to increase your volume limit.
a month 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.
a month 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.
a month ago
so my n8n link will be changed or will it stay same?
Status changed to Open brody • about 1 month ago
