NavigationContentFooter
Jump toSuggest an edit

Containers - Concepts

Reviewed on 14 November 2024

Cold Start

Cold start is the time a Container takes to handle a request when it is called for the first time.

Startup process steps are:

  • Downloading the container image to our infrastructure
  • Starting the container. Optimize your container startup speed to minimize this step (e.g., avoid waiting for slow connections or downloading large objects at startup)
  • Waiting for the container to listen on the configured port.

How to reduce cold starts

Concurrency

Concurrency defines the number of simultaneous requests a single instance of your container can handle at the same time. Once the number of incoming requests exceeds this value, your container scales according to your parameters.

Refer to the dedicated documentation for more information on container concurrency.

Container

A container is a package of software that includes all dependencies: code, runtime, configuration, and system libraries so that it can run on any host system. Scaleway provides custom Docker images that are entirely handled for you in the cloud.

Container Registry

Container Registry is the place where your images are stored before being deployed, we recommend using Scaleway Container Registry for optimal integration. Migration guide.

CRON trigger

A CRON trigger is a mechanism used to automatically invoke a Serverless Function at a specific time on a recurring schedule.

It works similarly to a traditional Linux cron job, using the * * * * * format, and uses the UTC time zone. Refer to our cron schedules reference for more information.

Custom domain

By default, a generated endpoint is assigned to your Serverless resource. Custom domains allows you to use your own domain - see our custom domain documentation for full details.

Deployment

Some parameter changes require a new deployment of the container to take effect. The deployment happens without causing downtime, as traffic is switched to the newest version.

Endpoint

An endpoint is the URL generated to access your resource. It can be customized with custom domains.

Environment variables

Environment variables are key/value pairs injected in your container. They are useful to share information such as configurations with your container. Some names are reserved. See details about reserved names.

Ephemeral storage

In addition to vCPU and RAM, Serverless Containers also provide a storage volume for the duration of the task. This storage space allows you to hold the data retrieved by the job, and disappears once the execution is complete.

The maximum size of the ephemeral storage is tied to the allocated memory.

GB-s

Unit used to measure the resource consumption of a container. It reflects the amount of memory consumed over time.

gRPC

gRPC is supported on Serverless Containers, as long as you have enabled http2 (h2c) protocol.

Healthcheck

To determine the status of a container, the default healthcheck automatically checks if basic requirements are met, to define the status as ready.

You can define custom healthcheck rules with a specific endpoint via the Scaleway API.

Instance

A Serverless Container instance handles incoming requests based on factors like the request volume, min scale, and max scale parameters.

JWT Token

JWT (JSON Web Token) is an access token you can create from the console or API to enable an application to access your private container. Find out how to secure a container.

Load balancing

The Serverless infrastructure manages incoming request traffic. In scenarios like sudden traffic spikes or load testing, resources are automatically scaled based on the max scale parameter to handle the load.

Max scale

This parameter sets the maximum number of container instances. You should adjust it based on your container’s traffic spikes, keeping in mind that you may wish to limit the max scale to manage costs effectively.

Min scale

Customizing the minimum scale for Serverless can help ensure that an instance remains pre-allocated and ready to handle requests, reducing delays associated with cold starts. However, this setting also impacts the costs of your Serverless Container.

mvCPU

A vCPU (Virtual Central Processing Unit) is equivalent to 1000 mvCPU.

Namespace

A namespace is a project that allows you to group your containers.

Containers in the same namespace can share environment variables, secrets and access tokens, defined at the namespace level.

NATS trigger

A NATS trigger is a mechanism that connects a container to a NATS subject and invokes the container automatically whenever a message is published to the subject.

For each message that is sent to a NATS subject, the NATS trigger reads the message and invokes the associated container with the message as the input parameter. The container can then process the message and perform any required actions, such as updating a database or sending a notification.

Port

The port parameter specifies the network port that your container listens on for incoming requests. If your application or container is set up to listen on a different port, you must specify it using the port parameter when deploying your container to Serverless Containers. It must reflect the port configuration within your container for your service to function correctly.

The value defined in the port parameter will then be passed to your container during the deployment inside the PORT environment variable.

Privacy policy

A container’s privacy policy defines whether a container may be invoked anonymously (public) or only via an authentication mechanism provided by the Scaleway API (private).

Registry endpoint

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

Sandbox

A sandbox is an isolation area for your container. Serverless Containers offer two sandboxing environments:

  • v2 - Recommended for faster cold starts. Can introduce some overhead on specific worklows with consequent amount of syscalls.
  • v1 - Legacy sandboxing with slower cold starts, but fully supports Linux system call interface. Prefer this option when processing large amount of syscalls.

Scale to zero

One of the advantages of Serverless Containers is that when your container is not triggered, it does not consume any resources, which enables great savings.

Scaling

Serverless Containers make scaling your application transparent, up to 50 instances of your container can be run at the same time.

Secrets

Secrets are an extra-secure type of environment variable. They are environment variables that are injected into your container and stored securely, but not displayed in the console after initial validation.

Serverless

Serverless allows you to deploy your Functions (FaaS) and Containerized Applications (CaaS) in a managed infrastructure. Scaleway ensures the deployment, availability, and scalability of all your projects.

Serverless Framework

Serverless.com (Serverless Framework) is a tool that allows you to deploy serverless applications without having to manage Serverless Container’s API call. Write and deploy a YAML configuration file, everything else is handled automatically, even the image building.

Serverless Job

Serverless Jobs are similar to Serverless Containers but are better suited for running longer workloads. See the comparaison between Serverless products for more information.

Queue trigger

A queue trigger is a mechanism that connects a container to a queue created with Scaleway Queues, and invokes the container automatically whenever a message is added to the queue.

For each message that is sent to a queue, the trigger reads the message and invokes the associated container with the message as the input parameter. The container can then process the message and perform any required actions, such as updating a database or sending a notification.

Stateless application

A stateless application is a computer program that does not save client data between sessions. Data generated in one session is not saved for use in the next session with that client.

To store data persistently, use products like [Managed Databases]/managed-databases/) or Object Storage.

Status

A Serverless Container can have the following statuses:

  • Ready: your Serverless Container is operational to serve requests.
  • Pending: your resource is under deployment.
  • Error: something went wrong during the deployment process. Check our troubleshooting documentation to solve the issue.

Terraform

Terraform is a tool for managing infrastructure using code. Read the Terraform documentation for Serverless Containers.

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 virtual Centralized Processing Unit. A vCPU represents a portion or share of the underlying physical CPU assigned to a particular container. The performance of a vCPU is determined by the percentage of time spent on the physical processor’s core. It is possible to allocate different resource allowances on specific vCPUs for specific containers or virtual machines.

vCPU-s

Unit used to measure the resource consumption of a container. It reflects the amount of vCPU used over time.

Protocol

Serverless Containers supports http1 (default) and http2 (h2c). Use HTTP/2 if your container application is configured to listen for HTTP/2 requests, such as a gRPC service or a web server that uses HTTP/2 features like multiplexing, otherwise HTTP/1 is recommended.

API DocsScaleway consoleDedibox consoleScaleway LearningScaleway.comPricingBlogCareers
© 2023-2024 – Scaleway