Project Usage - Billing
hrsattar
HOBBYOP

4 months ago

Hi,

I have 2 projects deployed on railway, I've enabled serverless and just use them a few times a month. I notice my bill always goes up even when I don't use them?

Please could you explain how and what I'm paying for?

$10 Bounty

19 Replies

4 months ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open brody 4 months ago


4 months ago

when serverless mode is enabled, your app sleeps when it’s not receiving traffic, doesn't have any telemetry, etc. youll typically see it being asleep as a service. your additional charges are likely based off resource usage, which you are incurring since your services are up. you can set a hard limit if you want to stop this

Attachments


hrsattar
HOBBYOP

4 months ago

Hi, I have serverless mode enabled, but I don't see the sleeping since x hours ago badge. One project uses the n8n template, which also has a db, all resources in the project have serverless enabled. Is there another setting I need to change for the to be put to sleep/not send any outbound packets when I'm not using it?

Attachments


hrsattar

Hi, I have serverless mode enabled, but I don't see the sleeping since x hours ago badge. One project uses the n8n template, which also has a db, all resources in the project have serverless enabled. Is there another setting I need to change for the to be put to sleep/not send any outbound packets when I'm not using it?

4 months ago

to answer your question, there is no other setting. it entirely depends on your services. even if you have n8n and a db, i dont know what you end up running in terms of workflows or automations. iirc n8n uses typeORM which i believe keeps persistence in idle connections (sends TCP keepalive packets)


4 months ago

what does your network activity look like? if you go to the service (either n8n or the db), and hit on metrics


yeeet

to answer your question, there is no other setting. it entirely depends on your services. even if you have n8n and a db, i dont know what you end up running in terms of workflows or automations. iirc n8n uses typeORM which i believe keeps persistence in idle connections (sends TCP keepalive packets)

hrsattar
HOBBYOP

4 months ago

None of my workflows are active at the minute


yeeet

what does your network activity look like? if you go to the service (either n8n or the db), and hit on metrics

hrsattar
HOBBYOP

4 months ago

The DB metrics are a flat line, the one for the web interface has spikes 4 times a day under the public network traffic, though it's not receiving any requests


hrsattar

None of my workflows are active at the minute

4 months ago

any sort of activity will not put the services to sleep (private networking doesn't show on the metrics tab either). from the looks of it, n8n keeps pinging the database to check if the connection is alive, so it's always on https://docs.n8n.io/hosting/configuration/environment-variables/database/

you can probably increase it to something like DB_POSTGRESDB_IDLE_CONNECTION_TIMEOUT=10000


yeeet

any sort of activity will not put the services to sleep (private networking doesn't show on the metrics tab either). from the looks of it, n8n keeps pinging the database to check if the connection is alive, so it's always on https://docs.n8n.io/hosting/configuration/environment-variables/database/you can probably increase it to something like DB_POSTGRESDB_IDLE_CONNECTION_TIMEOUT=10000

hrsattar
HOBBYOP

4 months ago

Thanks, I will give it a go


4 months ago

also, probably increasing the DB_PING_INTERVAL_SECONDS to a high number, probably like 259200(3 days) or whatever suits your timeline


hrsattar
HOBBYOP

4 months ago

I added both variables but still don't see the service going to sleep?


4 months ago

did you redeploy the service?


yeeet

did you redeploy the service?

hrsattar
HOBBYOP

4 months ago

yeah, I deployed it and checked it after 10 minutes, then after 3 hours but it still shows it's active


4 months ago

which n8n template did you use?


yeeet

which n8n template did you use?

hrsattar
HOBBYOP

4 months ago

this one


hrsattar

this one

3 months ago

i had to check it, but nothing seems wrong from OOTB as it uses the n8n docker. I assume you added it to both the n8n and the worker?


hrsattar
HOBBYOP

3 months ago

Thanks, yeah I applied the changes to both


3 months ago

if the services don’t sleep, what are your logs like? as soon as it was redeployed it should’ve outputted logs (early on in the deploy or build process). don’t show any sensitive info if there is in the logs (feel free to redact them)


yeeet

if the services don’t sleep, what are your logs like? as soon as it was redeployed it should’ve outputted logs (early on in the deploy or build process). don’t show any sensitive info if there is in the logs (feel free to redact them)

hrsattar
HOBBYOP

3 months ago

I just see these

WARNING: database "***" has a collation version mismatch


hrsattar

I just see theseWARNING: database "***" has a collation version mismatch

3 months ago

That would be unrelated


Status changed to Awaiting User Response Railway 3 months ago


Status changed to Open ray-chen 3 months ago


Loading...