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. diff --git a/serverless/containers/concepts.mdx b/serverless/containers/concepts.mdx index edf5411428..68c16daa77 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 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. +* **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/containers/reference-content/containers-limitations.mdx b/serverless/containers/reference-content/containers-limitations.mdx index f1cececfa2..b951ab64a3 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/) 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/concepts.mdx b/serverless/functions/concepts.mdx index bf77ce4cdc..a26264761b 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 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. +* **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. diff --git a/serverless/functions/reference-content/functions-limitations.mdx b/serverless/functions/reference-content/functions-limitations.mdx index 7c19e236d8..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 | -| 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/) 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).