BLASTA

REST API patterns load testing template

Every common REST scenario: lists, pagination, filters, items, caching, writes, bulk, uploads, content negotiation, error handling and auth.

Category APIStack Any JSON REST APIJobs 48

About this REST API patterns load test

Covers every common REST scenario for any JSON API: lists, pagination (first page and deep offset), filtering, sorting, sparse fields and expanded relations, single and missing items, conditional requests, create, replace, patch and delete, bulk and large bodies, uploads, content negotiation, error handling and authentication.

It holds 48 ready-made jobs: 29 single scenarios and an enterprise test plan of 19 stages to run in order, 15 of them with pass/fail targets (SLOs). Each job is a plain request pattern you can change before running.

Scenarios include list collection, pagination: first page, pagination: deep offset, filtered list and sorted list.

How to load test REST API patterns

  1. Open the template in BLASTA.
  2. Set url and id to point at your own REST API patterns system, ideally a staging copy.
  3. Pick a job and choose the rate and duration.
  4. Start the run and watch requests per second, latency percentiles and errors live; the result is saved to your history.

What you set before running

url
API base URL, no trailing slash
resource
A collection path
id
ID of an existing item
uploadPath
A file upload endpoint
token
A credential, supplied as an environment variable and never typed into the form. Bearer token. Read from API_TOKEN by the CLI.

Test scenarios (29)

list collection

Read-only

The most common call. If it is slow with no filters, look at default page size and missing indexes.

pagination: deep offset

Read-only

OFFSET 10000 forces the database to skip 10,000 rows per request, so latency grows with the page number. Compare with the first page; if it is slower, move to cursor (keyset) pagination.

filtered list

Read-only

Filtering on a column without an index is a table scan: the first thing to check when a list endpoint gets slower as data grows.

sorted list

Read-only

Sorting on an unindexed field sorts every matching row in memory.

sparse fields

Read-only

Asking for fewer fields should be cheaper. If it costs the same, the API loads everything anyway.

expanded relations

Read-only

?include= or ?expand= triggers extra queries per row (the N+1 problem). Latency that grows with limit gives it away.

get one item

Read-only

Primary key lookup: should be the fastest call the API has.

get a missing item

Read-only

404 path: must be as cheap as a hit, and must not leak stack traces.

HEAD item

Read-only

Existence check without the body.

OPTIONS (CORS preflight)

Read-only

Browsers send this before cross-origin writes; it should never reach the application code.

conditional GET (If-None-Match)

Read-only

Sends a deliberately stale ETag. A correct API answers 200 with the new body; a 304 on a wrong ETag would be a caching bug, so only 200 counts.

create an item (POST)

Writes data

Write path with validation and an insert. Creates a row per request, so clean up afterwards. Staging only.

retried create (Idempotency-Key)

Writes data

Clients retry on timeout. With the same Idempotency-Key the API must create ONE item and replay the response. 409 is also acceptable.

partial update (PATCH)

Writes data

Single-field update; row lock contention shows when many requests hit the same id. Staging only.

delete a missing item

Writes data

DELETE on an id that does not exist must be a fast 404 (or 204 if idempotent). Never points at a real item.

bulk create (100 items)

Writes data

One request carrying 100 rows: tests transaction size, validation loops and the request body limit. Creates 100 rows per request. Staging only.

multipart file upload (~4 KB)

Writes data

File upload path: multipart parsing, temp files and storage. Run with a larger file in your own job to test disk and proxy limits.

wrong Content-Type

Read-only

A JSON body sent as text/plain must be refused with 415 or 400, not parsed or crash.

no credentials

Read-only

Rejected requests should be cheaper than accepted ones.

OpenAPI document

Read-only

Swagger/OpenAPI JSON, fetched by docs and generators; it can be megabytes and is often generated per request.

Enterprise test plan (19)

Run in order: smoke, baseline, load, stress, spike, soak, breakpoint and failover window, each with pass/fail targets.

REST API patterns (any service): 01 smoke

Read-only

Enterprise plan, step 1 of 10. One request a second for 30 seconds. Run this first, every time: it proves the address, credentials and headers are right and that the environment is up before any real load is applied. Gate: zero errors. Reference request: list collection.

REST API patterns (any service): 02 baseline (20% load)

Read-only

Step 2 of 10. About a fifth of normal traffic for 5 minutes: the uncontended latency of this request. Every later result is judged against it, so record p50 and p95. Gate: at most 0.5% errors and the default latency targets. Reference request: list collection.

REST API patterns (any service): 03 average load (SLO check)

Read-only

Step 3 of 10. Normal busy-hour traffic for 10 minutes. The rate is the reference job's rate: raise it to your measured production peak-hour rate. This is the run that proves (or breaks) your SLO. Gate: at most 1% errors, p95 and p99 inside the targets. Reference request: list collection.

REST API patterns (any service): 04 peak load (2x average)

Read-only

Step 4 of 10. Twice the average for 10 minutes: the busiest hour of the year plus headroom. Latency may rise, but must stay in SLO; if it does not, you have no headroom. Gate: at most 2% errors, latency targets doubled. Reference request: list collection.

REST API patterns (any service): 05 stress (ramp to 4x)

Read-only

Step 5 of 10. Ramps to four times average over 10 minutes, then holds for 2. Finds where it degrades and HOW: gracefully (latency rises, errors stay low) or badly (errors, timeouts, crashes, restarts). Observation only, no gate. Reference request: list collection.

REST API patterns (any service): 06 spike (10x in 10 s)

Read-only

Step 6 of 10. Reaches ten times average within 10 seconds and holds for 2 minutes: a campaign email, a news link, a failover. Checks autoscaling, queue limits and load shedding. Gate: at most 5% errors, because shedding load is acceptable and crashing is not. Reference request: list collection.

REST API patterns (any service): 07 recovery after the spike

Read-only

Step 7 of 10. Run IMMEDIATELY after the spike, at average load for 5 minutes. Latency and errors must return to the baseline from step 2. If they do not, something is stuck: queues, connection pools, GC, an autoscaler cool-down. Gate: same as average load. Reference request: list collection.

REST API patterns (any service): 08 soak (1 hour at 60%)

Read-only

Step 8 of 10. One hour of steady load. Finds leaks and slow decay in memory, connections, file descriptors, disk, log volume and cache churn. Watch the resource graphs: any line that climbs and never flattens is a finding. Gate: at most 0.5% errors. Reference request: list collection.

REST API patterns (any service): 09 breakpoint (find the ceiling)

Read-only

Step 9 of 10. Ramps to twenty times average over 20 minutes. Stop it when errors pass about 5%: the rate at that moment is your ceiling, and ceiling divided by peak is your capacity margin. Use a production-like environment, never production. Reference request: list collection.

REST API patterns (any service): 10 resilience window (failover / deploy)

Read-only

Step 10 of 10. Average load for 15 minutes. About 5 minutes in, cause the event you are testing: kill a pod or node, fail over the database, roll out a new version, drain a zone. Errors in the window are your real availability loss. Gate: at most 1% errors overall; read the time series for how long the dip lasted. Reference request: list collection.

REST API patterns (any service): write peak

Writes data

Twice normal creates for 10 minutes: an import job or a busy ordering hour. Staging only. Reference request: create an item (POST). This job WRITES or creates data on every request: staging only, and expect a lot of rows.

Frequently asked questions

What does the REST API patterns load test cover?

The REST API patterns template has 48 jobs: 29 single scenarios and an enterprise test plan of 19 stages (smoke, baseline, load, stress, spike, soak, breakpoint and failover window). Scenarios include list collection, pagination: first page, pagination: deep offset and filtered list. 15 of them have pass/fail targets (SLOs), so a run can be judged against limits you set.

How do I load test REST API patterns with BLASTA?

Open the template in BLASTA and set url and id, then pick a job and start it. Results stream live: requests per second, latency percentiles and errors, and the run is kept in your history. To run from the command line, use blasta preset new rest-patterns with your address.

Is it safe to run the REST API patterns load test against production?

Of the 48 jobs, 39 are read-only, 9 write data and 0 change state. Run the writing and state-changing jobs against a staging system, never against production data. Only test systems you own or have permission to test.

Related templates

Run a load test

Point BLASTA at something you own, choose how hard to hit it, and press Start test. Results stream in live.

1 What do you want to test? Use a template

Request headers

2 How hard should it hit?

Advanced limits
Pass / fail targets (SLO) optional
The result is marked SLO met or SLO missed. The same targets live in a job file, where blasta run exits 2 on a miss so CI or Kubernetes can gate a release.

Set up this job

Quick check

Please confirm you are not a robot to start your free test.

Clear history

Delete every finished test in your history. Tests still running are kept. This cannot be undone.

Add identity provider

Add user

The account is active at once. Share the password with them securely; they can change it from their menu.

Sign in to use templates

Templates and test history are part of the full app. Sign in, or create a free account, to use them.

Sign inCreate account

Change password