#Vercel serverless functions

37 messages · Page 1 of 1 (latest)

dawn raven
#

Does vercel create a new serverless function instance for every request regardless of the geographic location of the serverless function? For example, if I have a serverless vercel function running in us-east-1, if 5 users of mine create 5 separate requests to the function, 5 new instances of the serverless function would get created? Is that the case?

rough flower
#

it will be reused

#

(usually)

#

I believe vercel is built on top of aws lambda

#

and the way the functions/containers warm up, scale and cool down is fairly predictable

#

but at the same time I've observed multiple lambda containers spin up before

#

Is there something specific you're looking for here?

dawn raven
#

hmm i see, I'm guessing that's the case when an instance of the function is still running due to a prior request?

#

i'm just trying to understand how vercel serverless functions scale relative to an increase in traffic

rough flower
#

Most of the time subsquent requests will be routed to an already warm container

#

but there is no gaurantee

#

that a new container wont be created for the incoming traffic

#

(but typically it wont)

#

I'm not sure what sort of scaling parameters they use

#

would be interesting to find out details but it's all hidden

#

It's likely a function of traffic + memory usage

dawn raven
#

oh okay, would've been nice to know exactly how it works

#

just that "they automatically scale up" is a little general

#

like, i'm just not if that means multiple instances of the function or somehow they add more resources to the existing serverless function server

rough flower
#

they dont add more resources

#

i'm fairly certain of that

dawn raven
#

okay, so if anything it'd probably be more instances?

rough flower
#

they just keep scaling the lambdas horizontally

dawn raven
#

gotcha

rough flower
#

exactly

dawn raven
#

interesting

rough flower
#

If you're realy curious on how this works, deploy a simple function to vercel

#

and then load test the hell out of it

#

using k6

dawn raven
#

oh okay

rough flower
#

this is how ive tested aws lambda and found bottlenecks in architectures before

#

but have never done so for vercel

dawn raven
#

regarding that, is there usually another tool that exists such as k6? I see that it's limited to 50 cloud tests

rough flower
#

Artillery

#

But I’ve only ever ran k6 locally btw

#

If you need to run it from multiple geographical locations, you could run it from digital ocean droplet or something similar