Skip to content

Commit 940d3e3

Browse files
feat(serverless): precision on timeout (#4227)
* feat(serverless): precision on timeout * remove timeout * update concepts of timeouts * typo * Apply suggestions from code review Co-authored-by: SamyOubouaziz <[email protected]> * format * Update serverless/containers/concepts.mdx * Update serverless/functions/concepts.mdx --------- Co-authored-by: SamyOubouaziz <[email protected]>
1 parent 8ef387f commit 940d3e3

File tree

5 files changed

+24
-17
lines changed

5 files changed

+24
-17
lines changed

macros/serverless/difference-jobs-functions-containers.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ Choose Scaleway [Serverless Jobs](/serverless/jobs/quickstart/):
5151

5252
Choose Scaleway [Serverless Functions](/serverless/functions/quickstart/):
5353

54-
- For stateless and short-lived workloads (< 15 minutes).
55-
- For event-driven tasks.
54+
- For HTTP and event-driven tasks.
5655
- For optimum performance in lightweight scenarios.
5756
- For autoscaling applications.
5857
- For web-facing applications and web servers.
58+
- For stateless workloads.
5959

6060
<Message type="note">
6161
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/):
6565

6666
Choose Scaleway [Serverless Containers](/serverless/containers/quickstart/):
6767

68-
- For stateless, short-lived applications (< 15 minutes).
69-
- For event-driven tasks.
68+
- For HTTP and event-driven tasks.
7069
- If your programming language is not supported as a Serverless Function runtime.
7170
- For autoscaling workloads.
71+
- For stateless workloads.
7272

7373
<Message type="note">
7474
To run as a Serverless Container, your application must be containerized, giving you a lot of flexibility to configure your runtime environments.

serverless/containers/concepts.mdx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,14 @@ A container's privacy policy defines whether a container may be invoked anonymou
146146

147147
The registry endpoint parameter is the resource linked to the container image used in your Serverless Container.
148148

149+
## Request timeout
150+
151+
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.
152+
153+
Use cases:
154+
* **Shorter timeouts:** Ideal for use cases with quick, predictable response times, such as HTTP APIs or real-time applications.
155+
* **Longer timeouts:** Useful for tasks requiring extended processing times, like data processing, report generation, or integration with slower external services.
156+
149157
## Sandbox
150158

151159
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:
219227

220228
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).
221229

222-
## Timeout
223-
224-
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.
225-
226230
## vCPU
227231

228232
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.

serverless/containers/reference-content/containers-limitations.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ This section contains usage limits that apply when using Serverless Containers.
3535
| Secret environment variables | Max size | 65536 bytes | Secret environment variable |
3636
| Time before scale to zero | Time | 15 minutes | Instance |
3737
| Time before scale down | Time | 30 seconds | Instance |
38-
| Timeout\*** | Max | 15 minutes | Request |
38+
| Max HTTP request duration\*** | Max | 15 minutes | Request |
3939
| Logs | Logs | 30000 per minute | Project |
4040

4141
\* Lower limits may apply before account verification. Contact our support team if you have any questions.
4242

4343
\** Total container memory is the sum of the memory allocated to all your containers at their maximum Scale.
4444

45-
\*** Use [Serverless Jobs](/serverless/jobs/) for longer tasks.
45+
\*** Use [Serverless Jobs](/serverless/jobs/) for tasks up to 24h.
4646

4747
These limits are enforced as [Organization quotas](/identity-and-access-management/organizations-and-projects/additional-content/organization-quotas/#serverless-containers).
4848

serverless/functions/concepts.mdx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,14 @@ A queue trigger is a mechanism that connects a function to a queue created with
109109
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.
110110
The function can then process the message and perform any required actions, such as updating a database or sending a notification.
111111

112+
## Request timeout
113+
114+
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.
115+
116+
Use cases:
117+
* **Shorter timeouts:** Ideal for use cases with quick, predictable response times, such as HTTP APIs or real-time applications.
118+
* **Longer timeouts:** Useful for tasks requiring extended processing times, like data processing, report generation, or integration with slower external services.
119+
112120
## Rolling update
113121

114122
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:
175183
* **Pending**: your resource is under deployment.
176184
* **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.
177185

178-
179-
## Timeout
180-
181-
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.
182-
183186
## Trigger
184187

185188
In a serverless architecture, a function is not running constantly, but is rather triggered by an event.

serverless/functions/reference-content/functions-limitations.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ This section contains usage limits that apply when using Serverless Functions.
3232
| Secret Environment Variables | Max size | 65536 bytes | Secret Environment Variable |
3333
| Time before scale to zero | Time | 15 minutes | Instance |
3434
| Time before scale down | Time | 30 seconds | Instance |
35-
| Timeout\*** | Max | 15 minutes | Request |
35+
| Max HTTP request duration\*** | Max | 15 minutes | Request |
3636
| Payload | Max size | 6 MiB | Request |
3737
| Logs | Logs | 30000 per minute | Project |
3838

3939
\* Lower limits may apply before account verification. [Contact our support team](https://console.scaleway.com/support) if you have any questions.
4040

4141
\** Total function memory is the sum of the memory allocated to all your functions at their maximum Scale.
4242

43-
\*** Use [Serverless Jobs](/serverless/jobs/) for longer tasks.
43+
\*** Use [Serverless Jobs](/serverless/jobs/) for tasks up to 24h.
4444

4545
These limits are enforced as [Organization quotas](/identity-and-access-management/organizations-and-projects/additional-content/organization-quotas/#serverless-functions).
4646

0 commit comments

Comments
 (0)