17 days 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?
19 Replies
17 days 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 • 17 days ago
17 days 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
16 days 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?
16 days 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)
16 days 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)
16 days 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
16 days 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
16 days 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
16 days ago
Thanks, I will give it a go
16 days ago
also, probably increasing the DB_PING_INTERVAL_SECONDS to a high number, probably like 259200(3 days) or whatever suits your timeline
16 days ago
I added both variables but still don't see the service going to sleep?
yeeet
did you redeploy the service?
16 days ago
yeah, I deployed it and checked it after 10 minutes, then after 3 hours but it still shows it's active
yeeet
which n8n template did you use?
16 days ago
hrsattar
this one
15 days 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?
15 days ago
Thanks, yeah I applied the changes to both
15 days 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)
15 days ago
I just see these
WARNING: database "***" has a collation version mismatch
hrsattar
I just see theseWARNING: database "***" has a collation version mismatch
2 days ago
That would be unrelated
Status changed to Awaiting User Response Railway • 1 day ago
Status changed to Open ray-chen • 1 day ago
