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?
#Vercel serverless functions
37 messages · Page 1 of 1 (latest)
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?
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
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
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
okay, so if anything it'd probably be more instances?
they just keep scaling the lambdas horizontally
gotcha
exactly
interesting
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
oh okay
GitHub
A modern load testing tool, using Go and JavaScript - https://k6.io - GitHub - grafana/k6: A modern load testing tool, using Go and JavaScript - https://k6.io
this is how ive tested aws lambda and found bottlenecks in architectures before
but have never done so for vercel
regarding that, is there usually another tool that exists such as k6? I see that it's limited to 50 cloud tests