From c31131ead36e85b7e07ec21a6dda7bac2258d27c Mon Sep 17 00:00:00 2001 From: Thomas Tacquet Date: Wed, 15 Jan 2025 16:54:58 +0100 Subject: [PATCH 1/8] feat(serverless): precision on timeout --- .../containers/reference-content/containers-limitations.mdx | 4 ++-- .../functions/reference-content/functions-limitations.mdx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/serverless/containers/reference-content/containers-limitations.mdx b/serverless/containers/reference-content/containers-limitations.mdx index f1cececfa2..5ab2b296d6 100644 --- a/serverless/containers/reference-content/containers-limitations.mdx +++ b/serverless/containers/reference-content/containers-limitations.mdx @@ -35,14 +35,14 @@ This section contains usage limits that apply when using Serverless Containers. | Secret environment variables | Max size | 65536 bytes | Secret environment variable | | Time before scale to zero | Time | 15 minutes | Instance | | Time before scale down | Time | 30 seconds | Instance | -| Timeout\*** | Max | 15 minutes | Request | +| Max HTTP request duration*** | Max | 15 minutes | Request | | Logs | Logs | 30000 per minute | Project | \* Lower limits may apply before account verification. Contact our support team if you have any questions. \** Total container memory is the sum of the memory allocated to all your containers at their maximum Scale. -\*** Use [Serverless Jobs](/serverless/jobs/) for longer tasks. +\*** Use [Serverless Jobs](/serverless/jobs/) tasks during up to 24h. These limits are enforced as [Organization quotas](/identity-and-access-management/organizations-and-projects/additional-content/organization-quotas/#serverless-containers). diff --git a/serverless/functions/reference-content/functions-limitations.mdx b/serverless/functions/reference-content/functions-limitations.mdx index 7c19e236d8..e4b6987a06 100644 --- a/serverless/functions/reference-content/functions-limitations.mdx +++ b/serverless/functions/reference-content/functions-limitations.mdx @@ -32,7 +32,7 @@ This section contains usage limits that apply when using Serverless Functions. | Secret Environment Variables | Max size | 65536 bytes | Secret Environment Variable | | Time before scale to zero | Time | 15 minutes | Instance | | Time before scale down | Time | 30 seconds | Instance | -| Timeout\*** | Max | 15 minutes | Request | +| Max HTTP request duration*** | Max | 15 minutes | Request | | Payload | Max size | 6 MiB | Request | | Logs | Logs | 30000 per minute | Project | @@ -40,7 +40,7 @@ This section contains usage limits that apply when using Serverless Functions. \** Total function memory is the sum of the memory allocated to all your functions at their maximum Scale. -\*** Use [Serverless Jobs](/serverless/jobs/) for longer tasks. +\*** Use [Serverless Jobs](/serverless/jobs/) tasks during up to 24h. These limits are enforced as [Organization quotas](/identity-and-access-management/organizations-and-projects/additional-content/organization-quotas/#serverless-functions). From c11205f86e022e81b9ce560ffb1c36e6e8e5df35 Mon Sep 17 00:00:00 2001 From: Thomas Tacquet Date: Wed, 15 Jan 2025 17:01:08 +0100 Subject: [PATCH 2/8] remove timeout --- .../serverless/difference-jobs-functions-containers.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/macros/serverless/difference-jobs-functions-containers.mdx b/macros/serverless/difference-jobs-functions-containers.mdx index 759a80b8aa..88aa328319 100644 --- a/macros/serverless/difference-jobs-functions-containers.mdx +++ b/macros/serverless/difference-jobs-functions-containers.mdx @@ -51,11 +51,11 @@ Choose Scaleway [Serverless Jobs](/serverless/jobs/quickstart/): Choose Scaleway [Serverless Functions](/serverless/functions/quickstart/): -- For stateless and short-lived workloads (< 15 minutes). -- For event-driven tasks. +- For HTTP and event-driven tasks. - For optimum performance in lightweight scenarios. - For autoscaling applications. - For web-facing applications and web servers. +- For stateless workloads. Serverless Functions can only be written in languages [available as runtimes](/serverless/functions/reference-content/functions-lifecycle/#available-runtimes). @@ -65,10 +65,10 @@ Choose Scaleway [Serverless Functions](/serverless/functions/quickstart/): Choose Scaleway [Serverless Containers](/serverless/containers/quickstart/): -- For stateless, short-lived applications (< 15 minutes). -- For event-driven tasks. +- For HTTP and event-driven tasks. - If your programming language is not supported as a Serverless Function runtime. - For autoscaling workloads. +- For stateless workloads. To run as a Serverless Container, your application must be containerized, giving you a lot of flexibility to configure your runtime environments. From a93dbdbb24b4f4f2b07471927f175b62fc5d8630 Mon Sep 17 00:00:00 2001 From: Thomas Tacquet Date: Wed, 15 Jan 2025 17:13:55 +0100 Subject: [PATCH 3/8] update concepts of timeouts --- serverless/containers/concepts.mdx | 12 ++++++++---- serverless/functions/concepts.mdx | 13 ++++++++----- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/serverless/containers/concepts.mdx b/serverless/containers/concepts.mdx index edf5411428..798bd76eb4 100644 --- a/serverless/containers/concepts.mdx +++ b/serverless/containers/concepts.mdx @@ -146,6 +146,14 @@ A container's privacy policy defines whether a container may be invoked anonymou The registry endpoint parameter is the resource linked to the container image used in your Serverless Container. +## Request timeout + +Request timeout is the maximum amount of time a request to a Serverless Function is allowed to run before the request is terminated. Purpose of this parameter is to ensure long-running requests do not hand indefinitely, which could impact ressource usage and scalability. + +Use cases: +* **Shorter timeouts:** Ideal for use cases with quick, predictable response times, such as HTTP APIs or real-time applications. +* **Longer timeouts:** Useful for tasks requiring extended processing times, like data processing, report generation, or integration with slower external services. + ## Sandbox A sandbox is an isolation area for your container. Serverless Containers offer two sandboxing environments: @@ -219,10 +227,6 @@ A Serverless Container can have the following statuses: Terraform is a tool for managing infrastructure using code. [Read the Terraform documentation for Serverless Containers](https://registry.terraform.io/providers/scaleway/scaleway/latest/docs/resources/container). -## Timeout - -The timeout is the maximum length of time your container can spend processing a request before being stopped. This value must be in the range 10s to 900s. - ## vCPU vCPU is the abbreviation for **v**irtual **C**entralized **P**rocessing **U**nit. A vCPU represents a portion or share of the underlying physical CPU assigned to a particular container. diff --git a/serverless/functions/concepts.mdx b/serverless/functions/concepts.mdx index bf77ce4cdc..75501f6abb 100644 --- a/serverless/functions/concepts.mdx +++ b/serverless/functions/concepts.mdx @@ -109,6 +109,14 @@ A queue trigger is a mechanism that connects a function to a queue created with For each message that is sent to a queue, the trigger reads the message and invokes the associated function with the message as the input parameter. The function can then process the message and perform any required actions, such as updating a database or sending a notification. +## Request timeout + +Request timeout is the maximum amount of time a request to a Serverless Function is allowed to run before the request is terminated. Purpose of this parameter is to ensure long-running requests do not hand indefinitely, which could impact ressource usage and scalability. + +Use cases: +* **Shorter timeouts:** Ideal for use cases with quick, predictable response times, such as HTTP APIs or real-time applications. +* **Longer timeouts:** Useful for tasks requiring extended processing times, like data processing, report generation, or integration with slower external services. + ## Rolling update When deploying a new version of a Serverless Function, a rolling update is applied by default. This means that the new version of the service is gradually rolled out to your users without downtime. @@ -175,11 +183,6 @@ A Serverless Function can have the following statuses: * **Pending**: your resource is under deployment. * **Error**: something went wrong during the deployment process or build of the source code to image. [Check our troubleshooting documentation](/serverless/functions/troubleshooting/function-in-error-state/) to solve the issue. - -## Timeout - -The timeout is the maximum length of time your handler can spend processing a request before being stopped. This value must be in the range 10s to 900s. - ## Trigger In a serverless architecture, a function is not running constantly, but is rather triggered by an event. From 17c27682fff55fb19a22cb2b123d544dbe3ec21c Mon Sep 17 00:00:00 2001 From: Thomas Tacquet Date: Wed, 15 Jan 2025 17:15:03 +0100 Subject: [PATCH 4/8] typo --- serverless/containers/concepts.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serverless/containers/concepts.mdx b/serverless/containers/concepts.mdx index 798bd76eb4..8308e556dd 100644 --- a/serverless/containers/concepts.mdx +++ b/serverless/containers/concepts.mdx @@ -148,7 +148,7 @@ The registry endpoint parameter is the resource linked to the container image us ## Request timeout -Request timeout is the maximum amount of time a request to a Serverless Function is allowed to run before the request is terminated. Purpose of this parameter is to ensure long-running requests do not hand indefinitely, which could impact ressource usage and scalability. +Request timeout is the maximum amount of time a request to a Serverless Container is allowed to run before the request is terminated. Purpose of this parameter is to ensure long-running requests do not hand indefinitely, which could impact ressource usage and scalability. Use cases: * **Shorter timeouts:** Ideal for use cases with quick, predictable response times, such as HTTP APIs or real-time applications. From 25bb2d1c708e30ce85baf85b51298f5a93cb6014 Mon Sep 17 00:00:00 2001 From: Thomas TACQUET Date: Wed, 15 Jan 2025 17:19:17 +0100 Subject: [PATCH 5/8] Apply suggestions from code review Co-authored-by: SamyOubouaziz --- .../containers/reference-content/containers-limitations.mdx | 4 ++-- .../functions/reference-content/functions-limitations.mdx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/serverless/containers/reference-content/containers-limitations.mdx b/serverless/containers/reference-content/containers-limitations.mdx index 5ab2b296d6..3dfdff52bb 100644 --- a/serverless/containers/reference-content/containers-limitations.mdx +++ b/serverless/containers/reference-content/containers-limitations.mdx @@ -35,14 +35,14 @@ This section contains usage limits that apply when using Serverless Containers. | Secret environment variables | Max size | 65536 bytes | Secret environment variable | | Time before scale to zero | Time | 15 minutes | Instance | | Time before scale down | Time | 30 seconds | Instance | -| Max HTTP request duration*** | Max | 15 minutes | Request | +| Max HTTP request duration\*** | Max | 15 minutes | Request | | Logs | Logs | 30000 per minute | Project | \* Lower limits may apply before account verification. Contact our support team if you have any questions. \** Total container memory is the sum of the memory allocated to all your containers at their maximum Scale. -\*** Use [Serverless Jobs](/serverless/jobs/) tasks during up to 24h. +\*** Use [Serverless Jobs](/serverless/jobs/) for tasks up to 24h. These limits are enforced as [Organization quotas](/identity-and-access-management/organizations-and-projects/additional-content/organization-quotas/#serverless-containers). diff --git a/serverless/functions/reference-content/functions-limitations.mdx b/serverless/functions/reference-content/functions-limitations.mdx index e4b6987a06..3b370aa30f 100644 --- a/serverless/functions/reference-content/functions-limitations.mdx +++ b/serverless/functions/reference-content/functions-limitations.mdx @@ -32,7 +32,7 @@ This section contains usage limits that apply when using Serverless Functions. | Secret Environment Variables | Max size | 65536 bytes | Secret Environment Variable | | Time before scale to zero | Time | 15 minutes | Instance | | Time before scale down | Time | 30 seconds | Instance | -| Max HTTP request duration*** | Max | 15 minutes | Request | +| Max HTTP request duration\*** | Max | 15 minutes | Request | | Payload | Max size | 6 MiB | Request | | Logs | Logs | 30000 per minute | Project | @@ -40,7 +40,7 @@ This section contains usage limits that apply when using Serverless Functions. \** Total function memory is the sum of the memory allocated to all your functions at their maximum Scale. -\*** Use [Serverless Jobs](/serverless/jobs/) tasks during up to 24h. +\*** Use [Serverless Jobs](/serverless/jobs/) for tasks up to 24h. These limits are enforced as [Organization quotas](/identity-and-access-management/organizations-and-projects/additional-content/organization-quotas/#serverless-functions). From df36b2a9e01de3cedfd6b0f399b2c62946fe1592 Mon Sep 17 00:00:00 2001 From: Thomas Tacquet Date: Wed, 15 Jan 2025 17:19:57 +0100 Subject: [PATCH 6/8] format --- .../containers/reference-content/containers-limitations.mdx | 2 +- .../functions/reference-content/functions-limitations.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/serverless/containers/reference-content/containers-limitations.mdx b/serverless/containers/reference-content/containers-limitations.mdx index 3dfdff52bb..b951ab64a3 100644 --- a/serverless/containers/reference-content/containers-limitations.mdx +++ b/serverless/containers/reference-content/containers-limitations.mdx @@ -35,7 +35,7 @@ This section contains usage limits that apply when using Serverless Containers. | Secret environment variables | Max size | 65536 bytes | Secret environment variable | | Time before scale to zero | Time | 15 minutes | Instance | | Time before scale down | Time | 30 seconds | Instance | -| Max HTTP request duration\*** | Max | 15 minutes | Request | +| Max HTTP request duration\*** | Max | 15 minutes | Request | | Logs | Logs | 30000 per minute | Project | \* Lower limits may apply before account verification. Contact our support team if you have any questions. diff --git a/serverless/functions/reference-content/functions-limitations.mdx b/serverless/functions/reference-content/functions-limitations.mdx index 3b370aa30f..4f12c3d9b1 100644 --- a/serverless/functions/reference-content/functions-limitations.mdx +++ b/serverless/functions/reference-content/functions-limitations.mdx @@ -32,7 +32,7 @@ This section contains usage limits that apply when using Serverless Functions. | Secret Environment Variables | Max size | 65536 bytes | Secret Environment Variable | | Time before scale to zero | Time | 15 minutes | Instance | | Time before scale down | Time | 30 seconds | Instance | -| Max HTTP request duration\*** | Max | 15 minutes | Request | +| Max HTTP request duration\*** | Max | 15 minutes | Request | | Payload | Max size | 6 MiB | Request | | Logs | Logs | 30000 per minute | Project | From 465539e2cf6698fe1d4cbce1ccced73d9309a006 Mon Sep 17 00:00:00 2001 From: SamyOubouaziz Date: Thu, 16 Jan 2025 10:17:37 +0100 Subject: [PATCH 7/8] Update serverless/containers/concepts.mdx --- serverless/containers/concepts.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serverless/containers/concepts.mdx b/serverless/containers/concepts.mdx index 8308e556dd..68c16daa77 100644 --- a/serverless/containers/concepts.mdx +++ b/serverless/containers/concepts.mdx @@ -148,7 +148,7 @@ The registry endpoint parameter is the resource linked to the container image us ## Request timeout -Request timeout is the maximum amount of time a request to a Serverless Container is allowed to run before the request is terminated. Purpose of this parameter is to ensure long-running requests do not hand indefinitely, which could impact ressource usage and scalability. +Request timeout is the maximum amount of time a request to a Serverless Container is allowed to run before the request is terminated. Purpose of this parameter is to ensure long-running requests do not hang indefinitely, which could impact ressource usage and scalability. Use cases: * **Shorter timeouts:** Ideal for use cases with quick, predictable response times, such as HTTP APIs or real-time applications. From f984384d47ad231fbacc5a76c18f396da329a926 Mon Sep 17 00:00:00 2001 From: SamyOubouaziz Date: Thu, 16 Jan 2025 10:17:51 +0100 Subject: [PATCH 8/8] Update serverless/functions/concepts.mdx --- serverless/functions/concepts.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serverless/functions/concepts.mdx b/serverless/functions/concepts.mdx index 75501f6abb..a26264761b 100644 --- a/serverless/functions/concepts.mdx +++ b/serverless/functions/concepts.mdx @@ -111,7 +111,7 @@ The function can then process the message and perform any required actions, such ## Request timeout -Request timeout is the maximum amount of time a request to a Serverless Function is allowed to run before the request is terminated. Purpose of this parameter is to ensure long-running requests do not hand indefinitely, which could impact ressource usage and scalability. +Request timeout is the maximum amount of time a request to a Serverless Function is allowed to run before the request is terminated. Purpose of this parameter is to ensure long-running requests do not hang indefinitely, which could impact ressource usage and scalability. Use cases: * **Shorter timeouts:** Ideal for use cases with quick, predictable response times, such as HTTP APIs or real-time applications.