What are GB-Hrs for Serverless Function Execution?

Serverless Function Execution on Vercel is measured using a metric called GB-Hrs. GB-Hrs is the duration (Hours) your Serverless Function runs for, multipled by the amount of memory (GB) allocated. The more memory you specify, or the longer your Serverless Function runs, the more GB-Hrs you will consume.

By default, Serverless Functions are allocated 1024 MB of memory, but can be configured to use more.

Serverless Function Execution Example

In this example, we will allocate 512 MB of memory and execute it 3 million times at a 1 second duration:

Total Seconds: 3M * (1s) = 3,000,000 Seconds

Total GB-Seconds: 512/1024 GB * 3,000,000 Seconds = 1,500,000 GB-Seconds

Total GB-Hrs: 1,500,000 GB-Seconds / 3600 = 416.67 GB-Hrs

The total Serverless Function Execution is 416.67 GB-Hrs.

Couldn't find the guide you need?