Your scraper works on your laptop. Now you need it to run every morning without leaving the laptop open. Should you put it on AWS Lambda or rent a VPS?
These are two different ways to host the same job. A VPS gives you a virtual computer to configure and maintain. Lambda lets you submit code that AWS runs when something triggers it, while AWS manages the servers underneath.
My starting choice is Lambda for a small, occasional HTTP scraper and a VPS for a worker that runs for hours or needs a continuing browser session. An hourly browser scraper is the interesting middle ground: Lambda can have a very small usage bill, but adapting the browser package may cost more effort than keeping a familiar Linux environment.
TL;DR
- Choose Lambda for short, independent jobs when you want AWS to handle server maintenance and your package fits its runtime.
- Choose a VPS for continuing workers, persistent browser processes, or an existing script that would otherwise need substantial adaptation.
- For an hourly browser job, compare setup effort as well as price. A cheap Lambda bill does not automatically make it the easiest deployment.
- If you already have a suitable VPS, start there. Spare capacity changes the cost comparison considerably.
What Are You Actually Comparing?

Lambda is an AWS service; VPS is a hosting category. AWS itself offers VPS instances through Amazon Lightsail. The choice is therefore between a managed function runtime and a server you administer, rather than between AWS and virtual servers.
On a VPS, you might install Python, Playwright, and a browser, copy over your script, and use a timer to launch it. You control installed software, local directories, and background processes. You also handle operating-system updates, access controls, and recovery when the server has a problem.
With a Lambda Event Function, you package the scraper behind a handler: the function AWS calls to start the job. A schedule sends it an event, the handler processes its inputs, and the application saves its results. You still maintain your application and dependencies, but AWS operates the underlying server infrastructure.
The broader serverless and VPS trade-offs come down to how much of the execution environment you want to control and maintain. For scraping, browser compatibility and process lifetime make that choice especially tangible.
AWS Lambda vs VPS at a Glance
| Decision | Scheduled On-Demand Lambda | Self-Managed Linux VPS |
|---|---|---|
| What you deploy | Application package plus a function handler | A script, service, or container on your server |
| Scheduling | EventBridge Scheduler invokes the function | A timer launches the command or service |
| Long jobs | Each scheduled invocation must fit the configured timeout | No Lambda-style invocation ceiling; the process depends on server resources and availability |
| Browser setup | Browser and dependencies must fit Lambda's execution environment | More control over libraries, browser installation, and runtime configuration |
| Continuing sessions | Do not depend on a browser process surviving between invocations | Can keep a browser process alive; still needs recovery after a crash or restart |
| Saving progress | Use storage outside the temporary execution environment | Can use local persistent storage, with backups for server loss |
| Parallel jobs | Managed scaling, with concurrency controls | Fit workers into purchased capacity or add servers |
| Maintenance | Maintain application code, dependencies, permissions, and configuration | Maintain those plus the operating system and server services |
| Spending pattern | Usage charges grow with executions and billed duration | Pay for provisioned capacity, including idle time |
Neither option fixes a fragile extractor. A changed page structure or an expired login can break the same application on either host.
Which Is Cheaper for the Same Scraper?
Occasional execution favors usage billing. A busy worker makes provisioned capacity worth investigating. The useful question is how much capacity your scraper consumes over a month, rather than whether one service advertises a smaller starting price.
For the calculations below, use a 30-day month and x86 on-demand Lambda in US East (N. Virginia): $0.0000166667 per GB-second and $0.20 per million request units. A GB-second combines allocated memory with billed execution time. These are gross charges before free allowances, credits, or commitments. See Lambda pricing.
For a concrete VPS reference, Lightsail lists a Linux bundle with public IPv4, 2 GB memory, 60 GB SSD storage, and 3 TB transfer allowance at $12/month. The examples assume it stays provisioned for the full month. This is a price reference, not a recommendation that every scraper fits that server. See Lightsail pricing.
| Illustrative Workload | Lambda Allocation and Billed Duration | Runs per Month | Lambda Compute + Requests | VPS Host Charge |
|---|---|---|---|---|
| Daily HTTP scrape | 512 MiB for 10 seconds | 30 | $0.002506 | $12 |
| Hourly browser scrape | 2,048 MiB for 60 seconds | 720 | $1.440147 | $12 |
| Continuous sequence of bounded jobs | 2,048 MiB for 300 seconds | 8,640 | $86.401901 | $12 |
Each assumed run produces one completed saved batch, uses one small-event request unit, and includes applicable initialization in its billed duration. There are no retries in this illustration. These are hosting subtotals: add storage, logging, scheduling, networking, backups, and external services where charged. The VPS column applies only if that server can complete the workload within its deadline.
Equal memory figures do not establish equal processing capacity. In particular, this Lightsail bundle uses CPU bursting and has a 20% performance baseline per vCPU. Check baseline and burst capacity before treating $12 as the cost of sustained CPU-heavy processing.
As a rough budget marker, 100 aggregate billed hours at 2 GiB produces about $12 in Lambda compute charges alone at the stated rate. That is a useful point to start pricing suitable VPS capacity. The actual crossover depends on the server's measured throughput and the extra costs on each side.
A Daily HTTP Scraper: I Would Start With Lambda
Suppose the scraper fetches a small set of pages, extracts records without a browser, and finishes in ten seconds. It runs once each morning and then has nothing to do for the rest of the day.
Renting a new server exclusively for that schedule is hard to justify on compute cost alone. Under the stated assumptions, Lambda's execution subtotal is a fraction of a cent. Even a very inexpensive VPS spends almost all its time waiting for the next job.
Lambda is my first choice here if packaging the application is straightforward. The important setup work is a working handler, a schedule, and somewhere durable to save the result.
The recommendation changes if you already operate a server with enough spare capacity. Adding a short timed command may involve less work than introducing another deployment system, and it may add nothing to your current host bill.
An Hourly Browser Scraper: Packaging Can Decide the Winner
Now suppose the job launches a browser, navigates a few pages, extracts records, and closes within a minute. At one execution per hour, the illustrative Lambda subtotal is about $1.44/month.
That is still considerably below a separate $12 host charge. But browser deployment is where the cheapest compute option can become the more involved project. If your existing scraper already runs cleanly in a conventional Linux container, a VPS may preserve more of that setup. Lambda needs a package that works under its own filesystem, runtime, and process restrictions.
I would use Lambda when the browser package is already compatible and each run can start independently. I would lean toward a VPS when keeping a working browser environment avoids substantial adaptation, especially if you already know how to maintain the server.
The hosting difference in this example is about $10.56 per month before extras. That is useful context when deciding how much engineering time to spend reducing the bill. Estimate the work on both sides: adapting Lambda once and maintaining a VPS over time.
A Continuing Worker: I Would Price a VPS First
The third row represents five-minute jobs running one after another throughout the month. It illustrates how usage charges accumulate even when each invocation is short enough to fit Lambda.
For a continuing queue consumer or a browser that processes inputs all day, I would price suitable VPS capacity first. A server can keep the worker and its browser process running, while the application deliberately controls its queue and pauses between requests.
The $12 reference is not proof that a small VPS can replace the assumed Lambda workload. Run a representative batch and check sustained CPU use, memory, and throughput. If the server cannot keep up, compare the next suitable configuration rather than keeping the cheapest row in the spreadsheet.
Long pauses strengthen the case for examining the execution design. An ordinary Event Function remains active while its handler sleeps. On a VPS, waiting still occupies provisioned capacity, but it does not add execution seconds to a separate function bill. For intermittent batches with long gaps, scheduling separate runs can be cleaner than keeping either worker alive unnecessarily.
What Can Change the Cost Verdict?
Start with the hosting subtotals, then account for the parts that differ between your actual deployments.
Storage and backups: Lambda results need a durable destination, such as object storage or a database. A VPS can save files locally, but local storage alone is not recovery from losing the server. Include the relevant S3 storage and request charges or your chosen storage and backup costs.
Scheduling and logs: Check the applicable EventBridge Scheduler charges and log retention. On the VPS, include any paid monitoring or logging service you choose. Apply free allowances only to the share your account actually has available.
Networking: Lambda does not automatically require a paid NAT gateway to reach public websites. Its default managed network has internet access. Connecting it to your own VPC changes the routing requirements; add NAT or other networking costs when your design uses those resources. AWS explains the distinction in its VPC internet-access guidance.
Retries and external services: Failed runs still consume resources. A paid proxy or remote browser can cost more than the scraper's host, so include it on whichever side uses it.
Finally, compare cost per completed job using the same output definition. If one deployment saves 720 valid batches and another saves 500, their invoices describe different results. Count retries in spending and avoid counting duplicate records as additional successes.
Does Playwright Make a VPS the Better Choice?
Often it makes the VPS easier to work with, but a browser requirement alone does not rule out Lambda.
On a VPS, you can install the required browser libraries, choose the runtime user, and inspect the process directly. That control is valuable when troubleshooting a scraper that worked locally but fails unattended.
For Lambda containers, adding a Docker image is not sufficient by itself. The image must implement the Lambda runtime API, target one supported architecture, and work with a read-only filesystem apart from writable /tmp. Browser profiles and downloads need suitable writable paths. See AWS's container image requirements.
Playwright also separates its browser/system dependencies from the application package. Its Docker documentation calls for matching versions and recommends a separate user with an appropriate seccomp profile for crawling. Treat sandbox configuration as part of the deployment, rather than disabling browser security to make startup succeed. The container's configured user deserves attention on either path.
For a short batch, starting a fresh browser each time may be perfectly acceptable. Lambda does not guarantee that an execution environment will persist between invocations. For a sweep that must preserve a live session across many inputs, a VPS worker is the more natural fit. Save recoverable progress separately even there: a persistent process can still crash.
When that control fits your workload, our Linux VPS gives you root access and a choice of Linux distributions to configure the scraper's runtime and services.
Runtime, Scheduling, and Scaling
For scheduled on-demand Event Functions in commercial AWS Regions, the configurable maximum timeout is now 30 minutes; the default remains three seconds. AWS raised the ceiling on November 19, 2026. Set a suitable value before testing, and leave headroom for slow inputs. See the current timeout documentation.
If one uninterrupted browser sweep takes two hours, the ordinary scheduled Lambda path cannot simply run the same command unchanged. You need independent batches with saved progress or a different execution design. Longer-running Lambda options have different behavior and economics; they do not remove this decision for the on-demand path compared here.
Scheduling exists on both sides. EventBridge Scheduler can invoke Lambda asynchronously without a public application endpoint. A systemd timer can activate the VPS worker. Choose what should happen when the previous run is still active, rather than assuming scheduling also solves coordination.
Lambda's managed scaling is useful when inputs are independent and arrive in bursts. A single VPS has finite worker capacity; beyond that, you need a larger server or more workers elsewhere. But parallelism only helps when the target sites, browser service, and output store can handle it. Use Lambda concurrency controls alongside application-level request limits. More simultaneous scrapers are not automatically a better scraper.
What Will You Have to Maintain?
Lambda removes server administration from your workload, but you still own the extractor, dependency updates, credentials, permissions, and failure handling. A selector that no longer matches the page needs an application fix regardless of who patches the operating system.
A self-managed VPS adds that operating system and its services to your responsibilities. You gain direct access for debugging and fewer constraints on how the process runs, in exchange for maintaining updates, disk space, service restarts, and backups. For one straightforward worker, that can be a sensible trade. For many separate bursty jobs, managing servers may become the larger distraction.
Before committing either deployment to its recurring schedule, check four things:
- Run the same permitted input set and read back the expected saved records.
- Repeat the job and confirm that retries do not duplicate committed output.
- Interrupt a run and verify that the next attempt can recover or safely reprocess it.
- Cause a failure and confirm that an actionable notification reaches you.
AWS's asynchronous retry guidance documents retries and possible duplicate delivery. On the VPS, deliberately configure the equivalent retry and notification behavior. A delivered trigger or a successful process exit is useful only when the required data was actually saved.
Which Should You Choose?

For a new daily HTTP scraper, I would start with Lambda. The application is easy to divide into independent runs, and buying a dedicated server for a few seconds of daily work makes little financial sense unless there is another reason to own that capacity.
For an hourly browser scraper, I would decide after checking packaging. A working Lambda browser package can make occasional execution inexpensive. A working Linux deployment can make a VPS the easier choice. The monthly hosting difference may be too small to justify rebuilding an otherwise reliable application.
For a continuing worker, a long browser sweep, or a job that needs persistent process control, I would start with a suitably sized VPS. Check sustained capacity and include maintenance in the decision. An existing server with spare resources deserves consideration before purchasing anything new.
The strongest choice is the one that matches how the scraper runs: independent invocations favor Lambda's managed execution, while continuing processes favor a server you control. Use the cost examples to shortlist an option, then confirm that it saves the required results on schedule.
FAQ
Is AWS Lambda a VPS?
No. In the Event Function model discussed here, Lambda provides a managed environment for invoking code. A VPS provides a virtual server that you configure and administer. Both use servers underneath; the difference is what you control and what the provider operates.
Can I Schedule a Scraper Without a Public Website?
Yes. EventBridge Scheduler can invoke the Lambda function directly, and a timer can launch a worker on a VPS. Neither setup requires you to create a public web application just to start the job.
Can Lambda Run a Scraper That Takes Longer Than 30 Minutes?
An ordinary scheduled on-demand invocation must fit its configured timeout, up to 30 minutes. You can divide suitable work into separate batches with saved progress or choose another execution design. A VPS is worth considering when the existing application needs one continuing process.
Can Lambda Connect to a Browser Hosted Elsewhere?
Yes, a compatible application can connect to a remote Playwright server. The external browser remains a separate service to operate or purchase. Include its cost, connection recovery, and version compatibility when evaluating that design.
Is Lambda Always Cheaper for Small Scrapers?
Its execution bill can be very small for occasional work. The complete cost also depends on storage, networking, external services, and deployment effort. If a suitable VPS is already paid for, adding the scraper may involve little or no extra hosting expense.
Discussion
Comments
Sign in to join the discussion.