From 71fb44f146885f0f9a5b7964f0f091dfe79de761 Mon Sep 17 00:00:00 2001 From: Melissa Hale Date: Thu, 5 Oct 2023 19:53:43 -0500 Subject: [PATCH 1/5] scale to zero doc --- src/data/sidebar.ts | 1 + src/docs/reference/scale-to-zero.md | 49 +++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 src/docs/reference/scale-to-zero.md diff --git a/src/data/sidebar.ts b/src/data/sidebar.ts index 8f3cd7f99..26818745e 100644 --- a/src/data/sidebar.ts +++ b/src/data/sidebar.ts @@ -84,6 +84,7 @@ export const sidebarContent: ISidebarContent = [ makePage("Volumes", "reference"), makePage("Cron Jobs", "reference"), makePage("Pricing", "reference"), + makePage("Scale to Zero", "reference"), makePage("Usage Limits", "reference"), makePage("Accounts", "reference"), makePage("Teams", "reference"), diff --git a/src/docs/reference/scale-to-zero.md b/src/docs/reference/scale-to-zero.md new file mode 100644 index 000000000..875fb8514 --- /dev/null +++ b/src/docs/reference/scale-to-zero.md @@ -0,0 +1,49 @@ +--- +title: Scale to Zero +--- + +Scale to Zero enables you to reduce unnecessary costs by ensuring you only use what you need, when you need it. + +## What is App Sleeping? + +App sleeping enables automated detection of inactive [services](/develop/services) based on outbound traffic. + +Enabling App Sleep on a service tells Railway to stop the service when it is inactive, effectively reducing the overall cost to run it. + + + +### Inactive Service Detection + +Inactivity is based on outbound packets. If no packets are sent from the service for over 10 minutes or longer, the service is considered inactive. + + +### Reactivation + +When the service receives traffic from the _public network*_, it is sent a signal to wake. + +Only when the service is ready, is traffic routed to it, ensuring no requests are dropped during the startup process. + +_*Currently, requests made to the service over the private network do not cause it to awake from sleep._ + +## How to enable App Sleeping + +To enable App Sleeping simply toggle the feature on within the service configuration - + + + +1. Navigate to your service's settings > Deploy > App Sleeping. +2. Toggle "Enable App Sleeping". +3. This setting will be applied across all [replicas](https://docs.railway.app/develop/services#horizontal-scaling-with-replicas) automatically. +4. When your service is put to sleep, an event will be visible in the dashboard. +5. To _disable_ App Sleeping, simply toggle the setting again. + +## Things to Note +- **Latency** - There may be a small delay when requests arrive at a stopped application. +- **Private Networking** - Services that receive traffic exclusively over the private network should *not* be enabled with App Sleeping since only public network traffic will trigger the service to wake. +- **Conditions for Sleeping** - For a service to be considered inactive, it must not send outbound traffic for at least 10 minutes or more. Outbound traffic can include telemetry, NTP, etc. \ No newline at end of file From 04834d053c8f0530a7957256f17dce0b6ccd095b Mon Sep 17 00:00:00 2001 From: Melissa Hale Date: Thu, 5 Oct 2023 20:15:58 -0500 Subject: [PATCH 2/5] minor adjustments --- src/docs/reference/scale-to-zero.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/docs/reference/scale-to-zero.md b/src/docs/reference/scale-to-zero.md index 875fb8514..d013e3f28 100644 --- a/src/docs/reference/scale-to-zero.md +++ b/src/docs/reference/scale-to-zero.md @@ -2,11 +2,11 @@ title: Scale to Zero --- -Scale to Zero enables you to reduce unnecessary costs by ensuring you only use what you need, when you need it. +Scale to Zero means reducing unnecessary costs by ensuring you only use what you need, when you need it. ## What is App Sleeping? -App sleeping enables automated detection of inactive [services](/develop/services) based on outbound traffic. +App sleeping enables automated detection of an inactive [service](/develop/services) based on outbound traffic. Enabling App Sleep on a service tells Railway to stop the service when it is inactive, effectively reducing the overall cost to run it. From 6a207d75a0615275581415e44a805532602a81f5 Mon Sep 17 00:00:00 2001 From: Melissa Hale Date: Fri, 6 Oct 2023 10:27:05 -0500 Subject: [PATCH 3/5] implement Rays suggestions --- src/data/sidebar.ts | 2 +- src/docs/reference/app-sleeping.md | 48 ++++++++++++++++++++++++++++ src/docs/reference/scale-to-zero.md | 49 ----------------------------- 3 files changed, 49 insertions(+), 50 deletions(-) create mode 100644 src/docs/reference/app-sleeping.md delete mode 100644 src/docs/reference/scale-to-zero.md diff --git a/src/data/sidebar.ts b/src/data/sidebar.ts index 26818745e..ef4caf857 100644 --- a/src/data/sidebar.ts +++ b/src/data/sidebar.ts @@ -84,7 +84,7 @@ export const sidebarContent: ISidebarContent = [ makePage("Volumes", "reference"), makePage("Cron Jobs", "reference"), makePage("Pricing", "reference"), - makePage("Scale to Zero", "reference"), + makePage("App Sleeping", "reference"), makePage("Usage Limits", "reference"), makePage("Accounts", "reference"), makePage("Teams", "reference"), diff --git a/src/docs/reference/app-sleeping.md b/src/docs/reference/app-sleeping.md new file mode 100644 index 000000000..0f3641303 --- /dev/null +++ b/src/docs/reference/app-sleeping.md @@ -0,0 +1,48 @@ +--- +title: App Sleeping +--- + + + +App Sleeping allows you to increase the efficiency of resource utilization on Railway. It may reduce the resource usage cose of a [service](/develop/services) by ensuring you only use what you need, when you need it. + +## What is App Sleeping? + +Enabling App Sleep on a service tells Railway to stop a service when it is inactive, effectively reducing the overall cost to run it. + +App sleeping enables automated detection of an inactive [service](/develop/services) based on outbound traffic. + + + +### Inactive Service Detection + +Inactivity is based detection of any outbound packets, which could include telemetry or NTP. If no packets are sent from the service for over 10 minutes or longer, the service is considered inactive. + + +### Waking a Service Up + +We wake a service when it receives traffic from the internet. + +The first request made to a service wakes a sleeping service. It may take a small amount of time for the service to spin up again on the frist request (commonly known as "cold boot time"). + +## How to enable App Sleeping + +To enable App Sleeping, toggle the feature on within the service configuration pane in your project: + + + +1. Navigate to your service's settings > Deploy > App Sleeping +2. Toggle "Enable App Sleeping" +3. To _disable_ App Sleeping, toggle the setting again + +## Caveats +- There will be a small delay in the response time of the first request sent to a slept service (commonly known as "cold boot times") +- [Private Networking](/reference/private-networking) does not currently work with App Sleeping +- Outbound traffic is excluded from considering when to sleep a service. For Railway to put a service to sleep, a service must not send outbound traffic for at least 10 minutes. Outbound traffic can include telemetry, NTP, etc. +- Enabling App Sleeping will apply the setting across all [Replicas](https://docs.railway.app/develop/services#horizontal-scaling-with-replicas) \ No newline at end of file diff --git a/src/docs/reference/scale-to-zero.md b/src/docs/reference/scale-to-zero.md deleted file mode 100644 index d013e3f28..000000000 --- a/src/docs/reference/scale-to-zero.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: Scale to Zero ---- - -Scale to Zero means reducing unnecessary costs by ensuring you only use what you need, when you need it. - -## What is App Sleeping? - -App sleeping enables automated detection of an inactive [service](/develop/services) based on outbound traffic. - -Enabling App Sleep on a service tells Railway to stop the service when it is inactive, effectively reducing the overall cost to run it. - - - -### Inactive Service Detection - -Inactivity is based on outbound packets. If no packets are sent from the service for over 10 minutes or longer, the service is considered inactive. - - -### Reactivation - -When the service receives traffic from the _public network*_, it is sent a signal to wake. - -Only when the service is ready, is traffic routed to it, ensuring no requests are dropped during the startup process. - -_*Currently, requests made to the service over the private network do not cause it to awake from sleep._ - -## How to enable App Sleeping - -To enable App Sleeping simply toggle the feature on within the service configuration - - - - -1. Navigate to your service's settings > Deploy > App Sleeping. -2. Toggle "Enable App Sleeping". -3. This setting will be applied across all [replicas](https://docs.railway.app/develop/services#horizontal-scaling-with-replicas) automatically. -4. When your service is put to sleep, an event will be visible in the dashboard. -5. To _disable_ App Sleeping, simply toggle the setting again. - -## Things to Note -- **Latency** - There may be a small delay when requests arrive at a stopped application. -- **Private Networking** - Services that receive traffic exclusively over the private network should *not* be enabled with App Sleeping since only public network traffic will trigger the service to wake. -- **Conditions for Sleeping** - For a service to be considered inactive, it must not send outbound traffic for at least 10 minutes or more. Outbound traffic can include telemetry, NTP, etc. \ No newline at end of file From d9c0407af575238d6ec1eb07ee8045f1138ec6ba Mon Sep 17 00:00:00 2001 From: Melissa Hale Date: Fri, 6 Oct 2023 13:44:52 -0500 Subject: [PATCH 4/5] Update src/docs/reference/app-sleeping.md typo Co-authored-by: M. Casqueira <3946250+20k-ultra@users.noreply.github.com> --- src/docs/reference/app-sleeping.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docs/reference/app-sleeping.md b/src/docs/reference/app-sleeping.md index 0f3641303..5664dc1b3 100644 --- a/src/docs/reference/app-sleeping.md +++ b/src/docs/reference/app-sleeping.md @@ -4,7 +4,7 @@ title: App Sleeping -App Sleeping allows you to increase the efficiency of resource utilization on Railway. It may reduce the resource usage cose of a [service](/develop/services) by ensuring you only use what you need, when you need it. +App Sleeping allows you to increase the efficiency of resource utilization on Railway. It may reduce the resource usage cost of a [service](/develop/services) by ensuring you only use what you need, when you need it. ## What is App Sleeping? From 172cf0ec05352a940d36c0c1c67482e4df7d6453 Mon Sep 17 00:00:00 2001 From: Melissa Hale Date: Fri, 6 Oct 2023 13:51:46 -0500 Subject: [PATCH 5/5] Update app-sleeping.md remove extra link to services --- src/docs/reference/app-sleeping.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/docs/reference/app-sleeping.md b/src/docs/reference/app-sleeping.md index 5664dc1b3..8e73c86e4 100644 --- a/src/docs/reference/app-sleeping.md +++ b/src/docs/reference/app-sleeping.md @@ -10,7 +10,7 @@ App Sleeping allows you to increase the efficiency of resource utilization on Ra Enabling App Sleep on a service tells Railway to stop a service when it is inactive, effectively reducing the overall cost to run it. -App sleeping enables automated detection of an inactive [service](/develop/services) based on outbound traffic. +App sleeping enables automated detection of an inactive service based on outbound traffic. App Sleeping in the Activity Feed - There will be a small delay in the response time of the first request sent to a slept service (commonly known as "cold boot times") - [Private Networking](/reference/private-networking) does not currently work with App Sleeping - Outbound traffic is excluded from considering when to sleep a service. For Railway to put a service to sleep, a service must not send outbound traffic for at least 10 minutes. Outbound traffic can include telemetry, NTP, etc. -- Enabling App Sleeping will apply the setting across all [Replicas](https://docs.railway.app/develop/services#horizontal-scaling-with-replicas) \ No newline at end of file +- Enabling App Sleeping will apply the setting across all [Replicas](https://docs.railway.app/develop/services#horizontal-scaling-with-replicas)