Is it possible to switch Serverless from Lambda to EC2?

Hello, newbie here.

Suppose you have a Serverless web application running on AWS Lambda, but for some reason you want to temporarily run your Serverless web application on EC2 instances.

For example, you predict a large spike in traffic during the upcoming holidays, and you’re afraid that Lambda won’t scale fast enough to accommodate that traffic which leads to high latency. To fight this, you want to launch an EC2 group running the Serverless application and redirect traffic to that group. After the holidays, you want to switch back to AWS Lambda.

(This is just one use case, there could be others like cost savings during high loads)

My question is, is it possible to run a Serverless application on servers?

No. Not for Lambda.

If this is important to you then you could look at IBM Cloud Function/OpenWhisk but I don’t know enough about them to give a definitive answer.

I guess you could do this with OpenFaaS on EC2. You will have to do your testing if it scales any faster than Lambda though.

I meant manual scaling, i.e. scaling your servers in advance in anticipation for a high traffic season. I’m not sure Lambda can do this though.

Basically no. You can’t pre-scale Lambda by using EC2. The best you could do is throw a lot of fake traffic at the end point and cause Lambda to launch additional instances.

I believe spotinst is running lambda on EC2.