Linux VPS

Serverless computing explained: functions, pricing and limits

What serverless means, how functions as a service run your code on demand, cold starts, pricing per request, typical use cases, and how serverless compares with running a VPS.

BeginnerCloud and hosting2 min read

Serverless computing lets you run code without managing any server. You upload a function, the platform runs it when a request or event arrives, and you pay only for the time it runs. Servers still exist, of course; you just never see them.

Before you start

How serverless works

  1. You write a function in a supported language and define a trigger: an HTTP route, a queue message, a file upload or a schedule.
  2. When the trigger fires, the platform starts an isolated environment (often a container or microVM), runs your function and returns the result.
  3. Idle functions scale to zero; busy ones scale out automatically to many copies.

Cold starts

If no warm instance exists, the platform must start one, adding latency from tens of milliseconds to seconds depending on runtime and package size. Small dependencies, lightweight runtimes and provisioned or kept-warm instances reduce it.

Pricing model

  • Charged per request and per unit of compute time (memory × duration).
  • Very cheap at low or spiky traffic, often within free tiers.
  • At steady high traffic, a VPS or container platform is usually cheaper.
  • Watch extra costs: API gateways, data transfer, managed databases.

Good use cases

  • Webhooks and lightweight APIs.
  • Image or file processing when something is uploaded.
  • Scheduled jobs and automation.
  • Event pipelines and chatbots with unpredictable traffic.

Limits

  • Maximum run time and memory per invocation.
  • Stateless: keep data in a database or object storage, not on local disk.
  • Long-lived connections (WebSockets, background workers) need special services.
  • Vendor lock-in through platform-specific triggers and APIs.

Serverless vs VPS

ServerlessVPS
Server managementNoneYou manage the OS
ScalingAutomatic, to zeroManual or scripted
Cost at steady loadCan be highPredictable, usually lower
Run time limitsYesNo
Software freedomSupported runtimesAnything

For a typical website, managed hosting or a VPS stays simpler. See how a VPS works.

Frequently asked questions

Is serverless the same as PaaS?

It is a form of PaaS focused on individual functions and per-request billing.

Can I self-host serverless?

Yes, open-source platforms such as OpenFaaS or Knative run functions on your own servers or Kubernetes cluster.

Can WordPress run serverless?

Not practically; it expects a persistent PHP server and filesystem. Use WordPress hosting instead.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.