DEV Community

Cover image for Get upto 8x more serverless function invocations on Vercel!
Sivaram Pandariganthan
Sivaram Pandariganthan

Posted on

Get upto 8x more serverless function invocations on Vercel!

Add a simple configuration to your project to potentially give you upto 8x more serverless function calls on any of Vercel's tiers.

The above image shows a very simple API with Memory Size customized to 128MB instead of the default 1024MB.

The above image shows a very simple API with Memory Size customized to 128MB instead of the default 1024MB.

See how GB-Hrs are calculated

Vercel Guide: what-are-gb-hrs-for-serverless-function-execution

Configuring projects with vercel.json

Vercel Docs: Project Configuration

Nextjs 13 App Directory vercel.json config example

{
  "functions": {
    "app/api/hello/route.ts": {
      "memory": 3008,
      "maxDuration": 60
    },
    "app/api/another/route.ts": {
      "memory": 1024,
      "maxDuration": 30
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Sample vercel.json with multiple APIs and custom options

Sample config with multiple APIs and custom options

Happy Hacking fellow Devs :)

Check out some of my projects if you want to see the source of these discoveries 😀

Anaek Desi Log - Free CC0 Indian Placeholder Images & APIs

Free CC0 Desi / Indian placeholder image APIs for dynamically sized Avatars, Colourful as well as Black & White Characters!. Optimized & RAW high-quality assets also available via secure & fast CDN network. Lorem Picsum but for images. Desi logon ke colourful avatar aur characters vibrant aur black & white dono bilkul India ki tarah :)

favicon desilog.sivaramp.com

SWAPI.INFO - Star Wars APIs & Explorer

The Star Wars API, or "swapi" (Swah-pee)!. All the Star Wars data you've ever wanted. Inspired by swapi.dev. Access it via a CDN-powered, Wicked-fast, Unrestricted Star Wars data API provider.

favicon swapi.info

Top comments (0)