# API Maker Documentation : Benchmarks
> The pages of https://docs.apimaker.dev in the order of the navigation, each with its title, its description and its URL. The code is in TypeScript : the Markdown of a page (its URL with .md) has every language.
---
# API Maker benchmarks : requests per second and memory on real servers
> API Maker benchmarks on 7 Linode servers, 1 to 8 vCPUs, shared and dedicated : requests per second, latency and memory on MongoDB, PostgreSQL and MySQL.
Source: https://docs.apimaker.dev/v4/docs/benchmarks/index.html
Benchmarks · API Maker 4.0.0 · 7 servers · measured 12 October 2026
**How fast is API Maker ? Measured, not promised.**
API Maker installed by its own installer on 7 Linode servers, from 1 to 8 vCPUs, shared and dedicated CPU, its databases on the same machine. Every API loaded for 15 seconds by autocannon from a second server, two rounds each, on MongoDB, PostgreSQL and MySQL : 136,821,729 requests, 0 errors. Every page shows the full autocannon output and what each part of the server held in memory.
Get all · 8 vCPU dedicated
12,640req/s
a whole table, MongoDB · 1 vCPU : 2,435
Get by id, cached · 8 vCPU
47,980req/s
answered from Redis · 1 vCPU : 12,140
Custom API · 8 vCPU
8,893req/s
TypeScript, get all inside, run in the server · in the sandbox 7,569
API Maker memory
84MB
the process at rest · up to 112 MB on 8 vCPUs
## The servers
### Shared CPU
- [1 vCPU · 1 GB RAM · Shared CPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html) : Linode Nanode 1 GB (g6-nanode-1), $5 a month. Get all 2,435 req/s, get by id cached 12,140 req/s, custom API 1,909 req/s (MongoDB). (12 October 2026 · 8,390,598 requests, 0 errors)
- [2 vCPU · 4 GB RAM · Shared CPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html) : Linode 4 GB (g6-standard-2), $24 a month. Get all 4,692 req/s, get by id cached 18,970 req/s, custom API 3,178 req/s (MongoDB). (12 October 2026 · 13,338,901 requests, 0 errors)
- [4 vCPU · 8 GB RAM · Shared CPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html) : Linode 8 GB (g6-standard-4), $48 a month. Get all 7,423 req/s, get by id cached 26,444 req/s, custom API 5,178 req/s (MongoDB). (12 October 2026 · 19,370,117 requests, 0 errors)
- [8 vCPU · 32 GB RAM · Shared CPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html) : Linode 32 GB (g6-standard-8), $192 a month. Get all 11,002 req/s, get by id cached 44,564 req/s, custom API 8,062 req/s (MongoDB). (12 October 2026 · 30,678,581 requests, 0 errors)
### Dedicated CPU
- [2 vCPU · 4 GB RAM · Dedicated CPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html) : Linode Dedicated 4 GB (g6-dedicated-2), $36 a month. Get all 3,712 req/s, get by id cached 16,455 req/s, custom API 2,591 req/s (MongoDB). (12 October 2026 · 10,989,400 requests, 0 errors)
- [4 vCPU · 8 GB RAM · Dedicated CPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html) : Linode Dedicated 8 GB (g6-dedicated-4), $72 a month. Get all 7,614 req/s, get by id cached 32,588 req/s, custom API 5,228 req/s (MongoDB). (12 October 2026 · 21,624,231 requests, 0 errors)
- [8 vCPU · 16 GB RAM · Dedicated CPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html) : Linode Dedicated 16 GB (g6-dedicated-8), $144 a month. Get all 12,640 req/s, get by id cached 47,980 req/s, custom API 8,893 req/s (MongoDB). (12 October 2026 · 32,429,901 requests, 0 errors)
## Results at a glance
**Get all, public : requests per second** · MongoDB · PostgreSQL · MySQL
[1 vCPU · 1 GB](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html) · shared · $5 / month · 2,435 · 3,787 · 4,623
[2 vCPU · 4 GB](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html) · shared · $24 / month · 4,692 · 5,577 · 6,660
[4 vCPU · 8 GB](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html) · shared · $48 / month · 7,423 · 8,395 · 9,375
[8 vCPU · 32 GB](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html) · shared · $192 / month · 11,002 · 13,054 · 13,816
[2 vCPU · 4 GB](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html) · dedicated · $36 / month · 3,712 · 4,782 · 5,418
[4 vCPU · 8 GB](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html) · dedicated · $72 / month · 7,614 · 8,912 · 10,000
[8 vCPU · 16 GB](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html) · dedicated · $144 / month · 12,640 · 12,641 · 13,748
A whole table of ten rows, read from the database on every request.
**Get by id with caching, public : requests per second** · MongoDB · PostgreSQL · MySQL
[1 vCPU · 1 GB](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html) · shared · $5 / month · 12,140 · 12,083 · 12,193
[2 vCPU · 4 GB](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html) · shared · $24 / month · 18,970 · 19,622 · 19,858
[4 vCPU · 8 GB](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html) · shared · $48 / month · 26,444 · 26,617 · 27,185
[8 vCPU · 32 GB](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html) · shared · $192 / month · 44,564 · 43,050 · 43,160
[2 vCPU · 4 GB](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html) · dedicated · $36 / month · 16,455 · 16,517 · 16,379
[4 vCPU · 8 GB](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html) · dedicated · $72 / month · 32,588 · 33,015 · 32,897
[8 vCPU · 16 GB](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html) · dedicated · $144 / month · 47,980 · 47,888 · 48,818
One row, answered from Redis.
| Server | CPU · price / month | Get all, MongoDB | Get all, PostgreSQL | Get all, MySQL | Get by id, cached | Custom API | API Maker at rest |
|---|---|--:|--:|--:|--:|--:|--:|
| [1 vCPU · 1 GB](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html) | Shared · $5 | **2,435** | **3,787** | **4,623** | 12,140 | 1,909 | 84 MB |
| [2 vCPU · 4 GB](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html) | Shared · $24 | **4,692** | **5,577** | **6,660** | 18,970 | 3,178 | 101 MB |
| [4 vCPU · 8 GB](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html) | Shared · $48 | **7,423** | **8,395** | **9,375** | 26,444 | 5,178 | 109 MB |
| [8 vCPU · 32 GB](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html) | Shared · $192 | **11,002** | **13,054** | **13,816** | 44,564 | 8,062 | 112 MB |
| [2 vCPU · 4 GB](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html) | Dedicated · $36 | **3,712** | **4,782** | **5,418** | 16,455 | 2,591 | 99 MB |
| [4 vCPU · 8 GB](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html) | Dedicated · $72 | **7,614** | **8,912** | **10,000** | 32,588 | 5,228 | 104 MB |
| [8 vCPU · 16 GB](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html) | Dedicated · $144 | **12,640** | **12,641** | **13,748** | 47,980 | 8,893 | 111 MB |
Requests per second : the average of two rounds of 15 seconds with 100 connections, public APIs ; get by id cached and the custom API on MongoDB. **[All results](https://docs.apimaker.dev/v4/docs/benchmarks/summary.html)** puts every API of every server side by side, with the latencies and the memory. The page of each server gives every API public and with both tokens, on the three databases, with the full autocannon output and the memory and CPU of every part.
## WebSockets
API Maker serves WebSockets on the port of its APIs. The same servers were filled with WebSocket clients, each with both tokens and a subscription : 26,484 clients connected at once on 1 vCPU and 1 GB, 3,662,564 on 8 vCPUs and 32 GB, 8.5 to 8.8 KB per client.
- [WebSocket benchmarks](https://docs.apimaker.dev/v4/docs/benchmarks/websockets/index.html) : How many connections one server holds, the memory when it is full, new clients and notifications a second.
- [Scale to N users](https://docs.apimaker.dev/v4/docs/benchmarks/websockets/scaling.html) : One big server or several small ones, the picture of N users, and the rule to count the servers.
- [All WebSocket results](https://docs.apimaker.dev/v4/docs/benchmarks/websockets/summary.html) : Every server side by side : clients, memory per client, delivery times.
## What is measured
Every API is measured on MongoDB, PostgreSQL and MySQL, public and with both tokens (`x-am-authorization` + `x-am-user-authorization`, checked on every request) :
- **Get all** : The schema API of a table answers all its rows.
- **Get all with caching** : The same request on a table whose API settings say `enableCaching: true`.
- **Get all by stream** : `GET …/
/stream`.
- **Custom API calling get all** : A custom API written in TypeScript, `return await g.sys.db.getAll({ instance, database, collection })`.
- **Custom API in the sandbox** : The same custom API, with one line more.
- **Get all with a pre hook** : Get all, with both tokens, on a table whose get all API has a pre hook written in TypeScript.
- **Get by id** : One row by its primary key.
- **Get by id with caching** : One row by its primary key, on a table with `enableCaching: true`.
- **Insert one row** : `POST …/
/save-single-or-multiple` with one row of 9 columns in the body.
- **Custom API without a database** : what running code costs, in the server (lean code) and in the sandbox.
- **More connections** : from 10 to 1,000 clients at once.
The data is the [API Maker benchmark dataset](https://apimaker.dev/json/benchmark_dataset.json) (`https://apimaker.dev/json/benchmark_dataset.json`) : ten rows of customers, ten columns each, in every table.
## How it is measured
1. **A real installation** API Maker is installed by its [installer](https://docs.apimaker.dev/v4/docs/getting-started/install-on-server.html) with its default answers, MongoDB and Redis in Docker on the same server, PostgreSQL and MySQL from their official images.
2. **Only what is needed runs** While a database is measured, the other ones are stopped. API Maker is restarted, its two sandboxes started and the swap emptied before each database.
3. **A second server makes the load** autocannon runs on a dedicated server of the same data centre, on the private network, sized to the server under test and sampled too : it never comes near its limit.
4. **Every answer is checked** Before its load, the answer of each API is checked (status, ten rows, the row), and the APIs with tokens are checked to refuse a request without them. Errors, non-2xx answers and timeouts are counted : 0 in 136,821,729 requests.
5. **Two rounds, the average** 5 seconds of warm-up, then 15 seconds measured, two times, the second time in the reverse order. The page shows the average and the autocannon output of the round closer to it.
6. **Memory and CPU every second** The server samples its CPU (with steal time), its memory, the API Maker process and every container while the load runs.
The whole method, with the settings of every API and the commands to run it yourself : [How API Maker is benchmarked](https://docs.apimaker.dev/v4/docs/benchmarks/methodology.html).
## Questions
### How many requests per second can API Maker serve ?
On the servers measured, with MongoDB, Redis and the database under test on the same machine, a whole table of ten rows (get all, public, MongoDB) was answered 2,435 times a second on 1 shared vCPU, 4,692 times a second on 2 shared vCPUs, 7,423 times a second on 4 shared vCPUs, 11,002 times a second on 8 shared vCPUs, 3,712 times a second on 2 dedicated vCPUs, 7,614 times a second on 4 dedicated vCPUs, 12,640 times a second on 8 dedicated vCPUs. A cached row reached 47,980 requests per second on 8 dedicated vCPUs.
### Is API Maker fast on a small server ?
On the smallest Linode server (1 vCPU, 1 GB, $5 a month), API Maker answered 2,435 requests per second for a whole table on MongoDB (PostgreSQL 3,787, MySQL 4,623) and 12,140 for a cached row.
### How much memory does API Maker need ?
The API Maker process held 84 to 112 MB at rest on these servers, with its two sandboxes running beside it. Most of the memory of a server goes to the databases and to the sandboxes which run your code : each server page shows every part, at rest and under load.
### Why is the database on the same server ?
It is the cheapest way to run API Maker, and the hardest test : API Maker, its sandboxes and the database share the same vCPUs, so every number counts the work of all of them.
### How are the benchmarks made ?
API Maker is installed by its own installer on a fresh server, the load comes from autocannon on a second server of the same data centre, every API runs two rounds of 15 seconds and the average is shown with the full autocannon output of a round.
---
# API Maker benchmark results : every API on every server
> Every API Maker benchmark side by side : req/s and latency on 7 Linode servers (1 to 8 vCPUs, shared and dedicated), scaling, memory.
Source: https://docs.apimaker.dev/v4/docs/benchmarks/summary.html
Benchmarks · All results · 7 servers
**Every API, every server : side by side.**
The average requests per second of every API Maker benchmark, on 7 Linode servers from 1 to 8 vCPUs, shared and dedicated CPU, on MongoDB, PostgreSQL and MySQL. 136,821,729 requests, 0 errors. Each number links to its run, with the full autocannon output.
Servers
7
4 shared CPU · 3 dedicated CPU
APIs per server
46
15 on each of 3 databases + a custom API without one
Requests
137million
2 rounds of 15 s per API, plus the sweeps of connections
Errors
0
non-2xx, errors, timeouts
## Every API on every server
**MongoDB**
Requests per second (the average of two rounds of 15 seconds, 100 connections) :
| API | [1 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html) shared · 1 GB | [2 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html) shared · 4 GB | [4 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html) shared · 8 GB | [8 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html) shared · 32 GB | [2 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html) dedicated · 4 GB | [4 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html) dedicated · 8 GB | [8 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html) dedicated · 16 GB |
|---|--:|--:|--:|--:|--:|--:|--:|
| Get all | [**2,435**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-all) | [**4,692**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-all) | [**7,423**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-all) | [**11,002**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all) | [**3,712**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-all) | [**7,614**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-all) | [**12,640**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-all) |
| Get all · both tokens | [**2,439**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-all) | [**4,425**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-all) | [**7,021**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-all) | [**11,882**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all) | [**3,564**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-all) | [**7,220**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-all) | [**12,106**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-all) |
| Get all with caching | [**11,054**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-all-with-caching) | [**18,195**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-all-with-caching) | [**26,115**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-all-with-caching) | [**41,093**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all-with-caching) | [**15,152**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-all-with-caching) | [**29,762**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-all-with-caching) | [**43,980**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-all-with-caching) |
| Get all with caching · both tokens | [**8,709**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-all-with-caching) | [**14,144**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-all-with-caching) | [**20,550**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-all-with-caching) | [**34,364**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all-with-caching) | [**11,750**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-all-with-caching) | [**23,619**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-all-with-caching) | [**36,123**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-all-with-caching) |
| Get all by stream | [**2,545**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-all-by-stream) | [**4,548**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-all-by-stream) | [**6,724**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-all-by-stream) | [**10,646**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all-by-stream) | [**3,661**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-all-by-stream) | [**7,342**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-all-by-stream) | [**11,898**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-all-by-stream) |
| Get all by stream · both tokens | [**2,548**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-all-by-stream) | [**4,297**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-all-by-stream) | [**6,737**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-all-by-stream) | [**11,025**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all-by-stream) | [**3,462**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-all-by-stream) | [**6,933**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-all-by-stream) | [**11,516**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-all-by-stream) |
| Custom API calling get all QuickJS | [**1,909**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#custom-api-calling-get-all) | [**3,178**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#custom-api-calling-get-all) | [**5,178**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#custom-api-calling-get-all) | [**8,062**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#custom-api-calling-get-all) | [**2,591**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#custom-api-calling-get-all) | [**5,228**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#custom-api-calling-get-all) | [**8,893**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#custom-api-calling-get-all) |
| Custom API calling get all · both tokens QuickJS | [**1,699**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#custom-api-calling-get-all) | [**2,957**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#custom-api-calling-get-all) | [**4,910**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#custom-api-calling-get-all) | [**8,393**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#custom-api-calling-get-all) | [**2,420**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#custom-api-calling-get-all) | [**4,933**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#custom-api-calling-get-all) | [**8,426**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#custom-api-calling-get-all) |
| Custom API in the sandbox Sandbox | [**1,389**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#custom-api-in-the-sandbox) | [**3,015**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#custom-api-in-the-sandbox) | [**4,649**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#custom-api-in-the-sandbox) | [**7,636**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#custom-api-in-the-sandbox) | [**2,269**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#custom-api-in-the-sandbox) | [**4,491**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#custom-api-in-the-sandbox) | [**7,569**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#custom-api-in-the-sandbox) |
| Get all with a pre hook · both tokens QuickJS | [**1,984**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-all-with-a-pre-hook) | [**3,339**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-all-with-a-pre-hook) | [**5,327**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-all-with-a-pre-hook) | [**8,512**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all-with-a-pre-hook) | [**2,713**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-all-with-a-pre-hook) | [**5,460**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-all-with-a-pre-hook) | [**9,279**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-all-with-a-pre-hook) |
| Get by id | [**3,100**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-by-id) | [**5,397**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-by-id) | [**8,076**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-by-id) | [**12,297**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-by-id) | [**4,323**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-by-id) | [**8,777**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-by-id) | [**14,224**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-by-id) |
| Get by id · both tokens | [**3,044**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-by-id) | [**4,947**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-by-id) | [**7,513**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-by-id) | [**12,654**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-by-id) | [**4,044**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-by-id) | [**8,182**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-by-id) | [**13,443**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-by-id) |
| Get by id with caching | [**12,140**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-by-id-with-caching) | [**18,970**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-by-id-with-caching) | [**26,444**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-by-id-with-caching) | [**44,564**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-by-id-with-caching) | [**16,455**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-by-id-with-caching) | [**32,588**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-by-id-with-caching) | [**47,980**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-by-id-with-caching) |
| Get by id with caching · both tokens | [**9,481**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-by-id-with-caching) | [**14,695**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-by-id-with-caching) | [**20,887**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-by-id-with-caching) | [**36,219**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-by-id-with-caching) | [**12,553**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-by-id-with-caching) | [**25,516**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-by-id-with-caching) | [**38,521**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-by-id-with-caching) |
| Insert one row | [**1,156**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#insert-one-row) | [**2,352**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#insert-one-row) | [**3,198**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#insert-one-row) | [**4,620**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#insert-one-row) | [**1,735**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#insert-one-row) | [**3,574**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#insert-one-row) | [**5,490**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#insert-one-row) |
Latency in milliseconds, p50 / **p99**, of the same runs :
| API | [1 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html) shared · 1 GB | [2 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html) shared · 4 GB | [4 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html) shared · 8 GB | [8 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html) shared · 32 GB | [2 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html) dedicated · 4 GB | [4 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html) dedicated · 8 GB | [8 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html) dedicated · 16 GB |
|---|--:|--:|--:|--:|--:|--:|--:|
| Get all | 39 / **46** | 20 / **40** | 11 / **28** | 8 / **20** | 26 / **68** | 12 / **28** | 7 / **17** |
| Get all · both tokens | 39 / **52** | 22 / **38** | 14 / **28** | 7 / **17** | 27 / **48** | 13 / **27** | 7 / **17** |
| Get all with caching | 9 / **13** | 5 / **8** | 3 / **5** | 2 / **3** | 6 / **10** | 3 / **5** | 2 / **3** |
| Get all with caching · both tokens | 11 / **17** | 7 / **10** | 4 / **7** | 2 / **4** | 8 / **12** | 4 / **6** | 2 / **4** |
| Get all by stream | 38 / **46** | 21 / **39** | 14 / **33** | 8 / **21** | 26 / **50** | 13 / **27** | 8 / **17** |
| Get all by stream · both tokens | 39 / **54** | 23 / **39** | 14 / **29** | 8 / **18** | 29 / **48** | 13 / **26** | 8 / **18** |
| Custom API calling get all QuickJS | 53 / **69** | 31 / **50** | 19 / **34** | 12 / **23** | 38 / **62** | 18 / **32** | 11 / **20** |
| Custom API calling get all · both tokens QuickJS | 61 / **125** | 33 / **54** | 19 / **34** | 11 / **21** | 41 / **67** | 20 / **35** | 11 / **21** |
| Custom API in the sandbox Sandbox | 75 / **97** | 31 / **64** | 20 / **42** | 12 / **28** | 42 / **77** | 21 / **41** | 13 / **24** |
| Get all with a pre hook · both tokens QuickJS | 52 / **66** | 29 / **50** | 18 / **34** | 11 / **24** | 36 / **61** | 18 / **31** | 10 / **20** |
| Get by id | 31 / **37** | 18 / **33** | 11 / **26** | 7 / **18** | 22 / **42** | 11 / **22** | 6 / **14** |
| Get by id · both tokens | 33 / **44** | 20 / **35** | 12 / **23** | 7 / **15** | 24 / **41** | 12 / **22** | 7 / **14** |
| Get by id with caching | 7 / **12** | 5 / **8** | 3 / **5** | 2 / **3** | 6 / **9** | 3 / **4** | 2 / **3** |
| Get by id with caching · both tokens | 10 / **16** | 6 / **10** | 4 / **7** | 2 / **4** | 8 / **12** | 3 / **6** | 2 / **4** |
| Insert one row | 83 / **110** | 38 / **83** | 30 / **63** | 21 / **38** | 58 / **99** | 27 / **52** | 17 / **32** |
**PostgreSQL**
Requests per second (the average of two rounds of 15 seconds, 100 connections) :
| API | [1 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html) shared · 1 GB | [2 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html) shared · 4 GB | [4 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html) shared · 8 GB | [8 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html) shared · 32 GB | [2 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html) dedicated · 4 GB | [4 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html) dedicated · 8 GB | [8 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html) dedicated · 16 GB |
|---|--:|--:|--:|--:|--:|--:|--:|
| Get all | [**3,787**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-all) | [**5,577**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-all) | [**8,395**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-all) | [**13,054**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all) | [**4,782**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-all) | [**8,912**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-all) | [**12,641**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-all) |
| Get all · both tokens | [**3,560**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-all) | [**5,290**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-all) | [**7,680**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-all) | [**12,013**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all) | [**4,384**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-all) | [**8,245**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-all) | [**11,913**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-all) |
| Get all with caching | [**11,064**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-all-with-caching) | [**17,836**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-all-with-caching) | [**26,420**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-all-with-caching) | [**39,947**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all-with-caching) | [**14,883**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-all-with-caching) | [**30,205**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-all-with-caching) | [**43,173**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-all-with-caching) |
| Get all with caching · both tokens | [**8,797**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-all-with-caching) | [**14,083**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-all-with-caching) | [**20,113**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-all-with-caching) | [**32,966**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all-with-caching) | [**11,615**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-all-with-caching) | [**24,179**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-all-with-caching) | [**35,403**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-all-with-caching) |
| Get all by stream | [**3,989**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-all-by-stream) | [**5,866**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-all-by-stream) | [**8,226**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-all-by-stream) | [**12,914**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all-by-stream) | [**4,837**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-all-by-stream) | [**9,098**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-all-by-stream) | [**13,073**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-all-by-stream) |
| Get all by stream · both tokens | [**3,461**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-all-by-stream) | [**5,189**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-all-by-stream) | [**7,486**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-all-by-stream) | [**12,049**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all-by-stream) | [**4,427**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-all-by-stream) | [**8,490**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-all-by-stream) | [**12,162**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-all-by-stream) |
| Custom API calling get all QuickJS | [**2,178**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#custom-api-calling-get-all) | [**3,806**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#custom-api-calling-get-all) | [**5,658**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#custom-api-calling-get-all) | [**9,350**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#custom-api-calling-get-all) | [**3,059**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#custom-api-calling-get-all) | [**5,886**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#custom-api-calling-get-all) | [**9,176**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#custom-api-calling-get-all) |
| Custom API calling get all · both tokens QuickJS | [**2,016**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#custom-api-calling-get-all) | [**3,461**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#custom-api-calling-get-all) | [**5,158**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#custom-api-calling-get-all) | [**8,433**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#custom-api-calling-get-all) | [**2,801**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#custom-api-calling-get-all) | [**5,442**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#custom-api-calling-get-all) | [**8,561**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#custom-api-calling-get-all) |
| Custom API in the sandbox Sandbox | [**1,871**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#custom-api-in-the-sandbox) | [**3,423**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#custom-api-in-the-sandbox) | [**5,126**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#custom-api-in-the-sandbox) | [**8,682**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#custom-api-in-the-sandbox) | [**2,389**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#custom-api-in-the-sandbox) | [**4,673**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#custom-api-in-the-sandbox) | [**7,916**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#custom-api-in-the-sandbox) |
| Get all with a pre hook · both tokens QuickJS | [**2,318**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-all-with-a-pre-hook) | [**3,884**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-all-with-a-pre-hook) | [**6,151**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-all-with-a-pre-hook) | [**9,668**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all-with-a-pre-hook) | [**3,246**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-all-with-a-pre-hook) | [**6,280**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-all-with-a-pre-hook) | [**9,524**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-all-with-a-pre-hook) |
| Get by id | [**4,105**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-by-id) | [**6,325**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-by-id) | [**9,446**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-by-id) | [**13,656**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-by-id) | [**5,090**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-by-id) | [**9,655**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-by-id) | [**13,571**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-by-id) |
| Get by id · both tokens | [**3,887**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-by-id) | [**5,739**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-by-id) | [**8,233**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-by-id) | [**12,548**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-by-id) | [**4,626**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-by-id) | [**8,790**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-by-id) | [**12,656**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-by-id) |
| Get by id with caching | [**12,083**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-by-id-with-caching) | [**19,622**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-by-id-with-caching) | [**26,617**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-by-id-with-caching) | [**43,050**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-by-id-with-caching) | [**16,517**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-by-id-with-caching) | [**33,015**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-by-id-with-caching) | [**47,888**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-by-id-with-caching) |
| Get by id with caching · both tokens | [**9,402**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-by-id-with-caching) | [**14,989**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-by-id-with-caching) | [**21,238**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-by-id-with-caching) | [**34,322**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-by-id-with-caching) | [**12,500**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-by-id-with-caching) | [**25,875**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-by-id-with-caching) | [**38,045**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-by-id-with-caching) |
| Insert one row | [**1,818**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#insert-one-row) | [**3,021**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#insert-one-row) | [**3,969**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#insert-one-row) | [**5,754**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#insert-one-row) | [**2,335**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#insert-one-row) | [**4,236**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#insert-one-row) | [**5,874**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#insert-one-row) |
Latency in milliseconds, p50 / **p99**, of the same runs :
| API | [1 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html) shared · 1 GB | [2 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html) shared · 4 GB | [4 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html) shared · 8 GB | [8 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html) shared · 32 GB | [2 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html) dedicated · 4 GB | [4 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html) dedicated · 8 GB | [8 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html) dedicated · 16 GB |
|---|--:|--:|--:|--:|--:|--:|--:|
| Get all | 25 / **51** | 18 / **22** | 11 / **14** | 7 / **9** | 20 / **24** | 11 / **13** | 7 / **10** |
| Get all · both tokens | 28 / **36** | 18 / **22** | 12 / **15** | 8 / **10** | 22 / **27** | 12 / **14** | 8 / **10** |
| Get all with caching | 8 / **13** | 5 / **8** | 3 / **5** | 2 / **3** | 6 / **10** | 3 / **5** | 2 / **3** |
| Get all with caching · both tokens | 11 / **17** | 7 / **12** | 4 / **8** | 3 / **4** | 8 / **12** | 4 / **6** | 2 / **4** |
| Get all by stream | 24 / **31** | 17 / **20** | 12 / **14** | 7 / **9** | 20 / **25** | 10 / **13** | 7 / **9** |
| Get all by stream · both tokens | 29 / **37** | 19 / **23** | 13 / **15** | 8 / **10** | 22 / **26** | 11 / **13** | 8 / **10** |
| Custom API calling get all QuickJS | 46 / **57** | 26 / **30** | 17 / **20** | 10 / **13** | 32 / **37** | 16 / **19** | 10 / **13** |
| Custom API calling get all · both tokens QuickJS | 48 / **57** | 28 / **32** | 19 / **22** | 11 / **14** | 35 / **41** | 18 / **21** | 11 / **14** |
| Custom API in the sandbox Sandbox | 52 / **100** | 28 / **51** | 19 / **35** | 11 / **20** | 40 / **72** | 21 / **38** | 12 / **22** |
| Get all with a pre hook · both tokens QuickJS | 42 / **53** | 25 / **31** | 16 / **18** | 10 / **12** | 30 / **36** | 15 / **18** | 10 / **13** |
| Get by id | 24 / **31** | 15 / **19** | 10 / **12** | 7 / **8** | 19 / **22** | 10 / **12** | 7 / **9** |
| Get by id · both tokens | 25 / **32** | 17 / **21** | 11 / **17** | 7 / **10** | 20 / **40** | 11 / **13** | 7 / **11** |
| Get by id with caching | 8 / **12** | 5 / **7** | 3 / **5** | 2 / **3** | 5 / **9** | 3 / **4** | 2 / **3** |
| Get by id with caching · both tokens | 10 / **16** | 6 / **10** | 4 / **7** | 2 / **4** | 7 / **12** | 3 / **5** | 2 / **4** |
| Insert one row | 54 / **64** | 33 / **38** | 24 / **28** | 17 / **19** | 42 / **49** | 23 / **28** | 16 / **19** |
**MySQL**
Requests per second (the average of two rounds of 15 seconds, 100 connections) :
| API | [1 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html) shared · 1 GB | [2 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html) shared · 4 GB | [4 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html) shared · 8 GB | [8 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html) shared · 32 GB | [2 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html) dedicated · 4 GB | [4 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html) dedicated · 8 GB | [8 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html) dedicated · 16 GB |
|---|--:|--:|--:|--:|--:|--:|--:|
| Get all | [**4,623**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-all) | [**6,660**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-all) | [**9,375**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-all) | [**13,816**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all) | [**5,418**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-all) | [**10,000**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-all) | [**13,748**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-all) |
| Get all · both tokens | [**4,126**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-all) | [**5,902**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-all) | [**8,338**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-all) | [**12,645**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all) | [**4,939**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-all) | [**9,236**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-all) | [**12,712**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-all) |
| Get all with caching | [**11,245**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-all-with-caching) | [**18,227**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-all-with-caching) | [**25,630**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-all-with-caching) | [**40,335**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all-with-caching) | [**15,123**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-all-with-caching) | [**30,217**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-all-with-caching) | [**44,027**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-all-with-caching) |
| Get all with caching · both tokens | [**8,870**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-all-with-caching) | [**13,394**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-all-with-caching) | [**20,763**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-all-with-caching) | [**33,000**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all-with-caching) | [**11,626**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-all-with-caching) | [**24,025**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-all-with-caching) | [**35,915**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-all-with-caching) |
| Get all by stream | [**4,213**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-all-by-stream) | [**5,815**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-all-by-stream) | [**8,355**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-all-by-stream) | [**12,489**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all-by-stream) | [**5,034**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-all-by-stream) | [**9,458**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-all-by-stream) | [**13,095**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-all-by-stream) |
| Get all by stream · both tokens | [**3,662**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-all-by-stream) | [**5,317**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-all-by-stream) | [**7,469**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-all-by-stream) | [**11,587**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all-by-stream) | [**4,518**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-all-by-stream) | [**8,733**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-all-by-stream) | [**12,340**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-all-by-stream) |
| Custom API calling get all QuickJS | [**2,419**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#custom-api-calling-get-all) | [**4,090**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#custom-api-calling-get-all) | [**6,016**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#custom-api-calling-get-all) | [**9,698**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#custom-api-calling-get-all) | [**3,357**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#custom-api-calling-get-all) | [**6,513**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#custom-api-calling-get-all) | [**9,820**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#custom-api-calling-get-all) |
| Custom API calling get all · both tokens QuickJS | [**2,231**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#custom-api-calling-get-all) | [**3,666**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#custom-api-calling-get-all) | [**5,536**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#custom-api-calling-get-all) | [**8,962**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#custom-api-calling-get-all) | [**3,058**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#custom-api-calling-get-all) | [**6,032**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#custom-api-calling-get-all) | [**9,129**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#custom-api-calling-get-all) |
| Custom API in the sandbox Sandbox | [**2,170**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#custom-api-in-the-sandbox) | [**3,834**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#custom-api-in-the-sandbox) | [**5,486**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#custom-api-in-the-sandbox) | [**9,181**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#custom-api-in-the-sandbox) | [**2,714**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#custom-api-in-the-sandbox) | [**5,174**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#custom-api-in-the-sandbox) | [**8,657**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#custom-api-in-the-sandbox) |
| Get all with a pre hook · both tokens QuickJS | [**2,688**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-all-with-a-pre-hook) | [**4,389**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-all-with-a-pre-hook) | [**6,768**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-all-with-a-pre-hook) | [**10,192**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all-with-a-pre-hook) | [**3,524**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-all-with-a-pre-hook) | [**6,820**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-all-with-a-pre-hook) | [**10,204**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-all-with-a-pre-hook) |
| Get by id | [**5,090**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-by-id) | [**7,155**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-by-id) | [**9,893**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-by-id) | [**14,402**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-by-id) | [**5,874**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-by-id) | [**10,654**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-by-id) | [**14,510**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-by-id) |
| Get by id · both tokens | [**4,526**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-by-id) | [**6,551**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-by-id) | [**8,892**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-by-id) | [**13,222**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-by-id) | [**5,304**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-by-id) | [**9,758**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-by-id) | [**13,517**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-by-id) |
| Get by id with caching | [**12,193**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-by-id-with-caching) | [**19,858**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-by-id-with-caching) | [**27,185**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-by-id-with-caching) | [**43,160**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-by-id-with-caching) | [**16,379**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-by-id-with-caching) | [**32,897**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-by-id-with-caching) | [**48,818**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-by-id-with-caching) |
| Get by id with caching · both tokens | [**9,217**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-by-id-with-caching) | [**15,385**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-by-id-with-caching) | [**22,684**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-by-id-with-caching) | [**34,667**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-by-id-with-caching) | [**12,515**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-by-id-with-caching) | [**25,837**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-by-id-with-caching) | [**38,544**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-by-id-with-caching) |
| Insert one row | [**1,651**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#insert-one-row) | [**2,371**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#insert-one-row) | [**3,181**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#insert-one-row) | [**3,532**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#insert-one-row) | [**2,081**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#insert-one-row) | [**3,462**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#insert-one-row) | [**3,542**](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#insert-one-row) |
Latency in milliseconds, p50 / **p99**, of the same runs :
| API | [1 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html) shared · 1 GB | [2 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html) shared · 4 GB | [4 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html) shared · 8 GB | [8 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html) shared · 32 GB | [2 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html) dedicated · 4 GB | [4 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html) dedicated · 8 GB | [8 vCPU](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html) dedicated · 16 GB |
|---|--:|--:|--:|--:|--:|--:|--:|
| Get all | 21 / **27** | 14 / **17** | 10 / **12** | 6 / **8** | 18 / **22** | 9 / **11** | 7 / **9** |
| Get all · both tokens | 23 / **31** | 16 / **20** | 12 / **17** | 7 / **10** | 20 / **24** | 10 / **12** | 7 / **10** |
| Get all with caching | 8 / **13** | 5 / **8** | 3 / **6** | 2 / **3** | 6 / **9** | 3 / **5** | 2 / **3** |
| Get all with caching · both tokens | 11 / **17** | 7 / **10** | 4 / **7** | 3 / **4** | 8 / **13** | 4 / **6** | 2 / **4** |
| Get all by stream | 22 / **29** | 17 / **21** | 12 / **14** | 8 / **10** | 19 / **23** | 10 / **12** | 7 / **9** |
| Get all by stream · both tokens | 26 / **34** | 18 / **22** | 13 / **15** | 8 / **10** | 21 / **26** | 11 / **13** | 8 / **10** |
| Custom API calling get all QuickJS | 41 / **51** | 24 / **28** | 16 / **19** | 10 / **12** | 30 / **35** | 15 / **17** | 10 / **12** |
| Custom API calling get all · both tokens QuickJS | 44 / **53** | 27 / **31** | 17 / **20** | 11 / **14** | 32 / **38** | 16 / **19** | 10 / **13** |
| Custom API in the sandbox Sandbox | 43 / **70** | 25 / **46** | 17 / **33** | 10 / **19** | 35 / **64** | 19 / **35** | 11 / **20** |
| Get all with a pre hook · both tokens QuickJS | 37 / **47** | 22 / **27** | 14 / **17** | 9 / **13** | 27 / **59** | 14 / **17** | 9 / **13** |
| Get by id | 19 / **25** | 13 / **16** | 9 / **11** | 6 / **8** | 16 / **20** | 9 / **11** | 6 / **8** |
| Get by id · both tokens | 21 / **28** | 15 / **19** | 10 / **13** | 7 / **9** | 18 / **22** | 10 / **12** | 7 / **9** |
| Get by id with caching | 8 / **12** | 4 / **7** | 3 / **5** | 2 / **3** | 5 / **9** | 2 / **4** | 2 / **3** |
| Get by id with caching · both tokens | 10 / **16** | 6 / **9** | 4 / **6** | 2 / **4** | 7 / **12** | 3 / **5** | 2 / **4** |
| Insert one row | 59 / **71** | 41 / **49** | 31 / **35** | 28 / **35** | 48 / **54** | 29 / **33** | 28 / **38** |
The custom API without a database, requests per second : in the server (lean code) 1 vCPU shared **8,096** · 2 vCPU shared **14,731** · 4 vCPU shared **26,046** · 8 vCPU shared **47,967** · 2 vCPU dedicated **10,790** · 4 vCPU dedicated **21,532** · 8 vCPU dedicated **39,192** ; in the sandbox 1 vCPU shared **9,258** · 2 vCPU shared **12,669** · 4 vCPU shared **17,702** · 8 vCPU shared **27,302** · 2 vCPU dedicated **9,953** · 4 vCPU dedicated **18,562** · 8 vCPU dedicated **27,920**.
## More vCPUs
API Maker is one process which uses every vCPU of its server : the same APIs, from the smallest server to the largest.
**Get all, public, MongoDB : by vCPUs** · Shared CPU · Dedicated CPU
1 vCPUshared 1 GB $5 · 2,435
2 vCPUsshared 4 GB $24 · dedicated 4 GB $36 · 4,692 · 3,712
4 vCPUsshared 8 GB $48 · dedicated 8 GB $72 · 7,423 · 7,614
8 vCPUsshared 32 GB $192 · dedicated 16 GB $144 · 11,002 · 12,640
**Get by id with caching, public, MongoDB : by vCPUs** · Shared CPU · Dedicated CPU
1 vCPUshared 1 GB $5 · 12,140
2 vCPUsshared 4 GB $24 · dedicated 4 GB $36 · 18,970 · 16,455
4 vCPUsshared 8 GB $48 · dedicated 8 GB $72 · 26,444 · 32,588
8 vCPUsshared 32 GB $192 · dedicated 16 GB $144 · 44,564 · 47,980
**Custom API calling get all, public, MongoDB : by vCPUs QuickJS** · Shared CPU · Dedicated CPU
1 vCPUshared 1 GB $5 · 1,909
2 vCPUsshared 4 GB $24 · dedicated 4 GB $36 · 3,178 · 2,591
4 vCPUsshared 8 GB $48 · dedicated 8 GB $72 · 5,178 · 5,228
8 vCPUsshared 32 GB $192 · dedicated 16 GB $144 · 8,062 · 8,893
| API · database | 1 vCPU shared | 2 vCPU shared | 4 vCPU shared | 8 vCPU shared | 2 vCPU dedicated | 4 vCPU dedicated | 8 vCPU dedicated |
|---|--:|--:|--:|--:|--:|--:|--:|
| Get all · MongoDB | 2,435 | 4,692 × 1.9 | 7,423 × 3.0 | 11,002 × 4.5 | 3,712 × 1.5 | 7,614 × 3.1 | 12,640 × 5.2 |
| Get all · PostgreSQL | 3,787 | 5,577 × 1.5 | 8,395 × 2.2 | 13,054 × 3.4 | 4,782 × 1.3 | 8,912 × 2.4 | 12,641 × 3.3 |
| Get all · MySQL | 4,623 | 6,660 × 1.4 | 9,375 × 2.0 | 13,816 × 3.0 | 5,418 × 1.2 | 10,000 × 2.2 | 13,748 × 3.0 |
| Get by id with caching · MongoDB | 12,140 | 18,970 × 1.6 | 26,444 × 2.2 | 44,564 × 3.7 | 16,455 × 1.4 | 32,588 × 2.7 | 47,980 × 4.0 |
| Get by id with caching · PostgreSQL | 12,083 | 19,622 × 1.6 | 26,617 × 2.2 | 43,050 × 3.6 | 16,517 × 1.4 | 33,015 × 2.7 | 47,888 × 4.0 |
| Get by id with caching · MySQL | 12,193 | 19,858 × 1.6 | 27,185 × 2.2 | 43,160 × 3.5 | 16,379 × 1.3 | 32,897 × 2.7 | 48,818 × 4.0 |
| Custom API calling get all · MongoDB QuickJS | 1,909 | 3,178 × 1.7 | 5,178 × 2.7 | 8,062 × 4.2 | 2,591 × 1.4 | 5,228 × 2.7 | 8,893 × 4.7 |
| Custom API in the sandbox · MongoDB Sandbox | 1,389 | 3,015 × 2.2 | 4,649 × 3.3 | 7,636 × 5.5 | 2,269 × 1.6 | 4,491 × 3.2 | 7,569 × 5.5 |
| Get all with a pre hook · MongoDB QuickJS | 1,984 | 3,339 × 1.7 | 5,327 × 2.7 | 8,512 × 4.3 | 2,713 × 1.4 | 5,460 × 2.8 | 9,279 × 4.7 |
*× n* : the requests per second against the 1 vCPU server (1 GB of memory : it also used its swap). From 1 to 8 shared vCPUs : get all ×4.5 on MongoDB, ×3.4 on PostgreSQL and ×3.0 on MySQL, get by id with caching ×3.7, the custom API ×4.2. On every server the database, Redis and the sandboxes run beside API Maker and take their share of the same vCPUs.
## Memory
The API Maker process at rest (with its two sandboxes started, before any request) and the most it held under load, the two sandboxes at rest, and the whole server : at rest with MongoDB, and the most it used while any database was loaded.
| Server | CPU | API Maker at rest | API Maker under load | Sandboxes at rest | Server at rest | Server under load |
|---|---|--:|--:|--:|--:|--:|
| [1 vCPU · 1 GB](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#memory) | shared | 84 MB | 111 MB | 50 MB | 686 MB | 807 MB of 961 MB |
| [2 vCPU · 4 GB](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#memory) | shared | 101 MB | 125 MB | 50 MB | 803 MB | 1658 MB of 3,915 MB |
| [4 vCPU · 8 GB](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#memory) | shared | 109 MB | 142 MB | 55 MB | 872 MB | 2048 MB of 7,941 MB |
| [8 vCPU · 32 GB](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#memory) | shared | 112 MB | 154 MB | 55 MB | 1102 MB | 2710 MB of 32,095 MB |
| [2 vCPU · 4 GB](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#memory) | dedicated | 99 MB | 127 MB | 50 MB | 773 MB | 1600 MB of 3,915 MB |
| [4 vCPU · 8 GB](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#memory) | dedicated | 104 MB | 140 MB | 55 MB | 872 MB | 2024 MB of 7,941 MB |
| [8 vCPU · 16 GB](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#memory) | dedicated | 111 MB | 176 MB | 55 MB | 946 MB | 2602 MB of 15,991 MB |
## WebSockets
API Maker serves WebSockets on the port of its APIs. The same servers were filled with WebSocket clients, each with both tokens and a subscription : 26,484 clients connected at once on 1 vCPU and 1 GB, 3,662,564 on 8 vCPUs and 32 GB, 8.5 to 8.8 KB per client.
- [WebSocket benchmarks](https://docs.apimaker.dev/v4/docs/benchmarks/websockets/index.html) : How many connections one server holds, the memory when it is full, new clients and notifications a second.
- [Scale to N users](https://docs.apimaker.dev/v4/docs/benchmarks/websockets/scaling.html) : One big server or several small ones, the picture of N users, and the rule to count the servers.
- [All WebSocket results](https://docs.apimaker.dev/v4/docs/benchmarks/websockets/summary.html) : Every server side by side : clients, memory per client, delivery times.
## Questions
### Does API Maker scale with more vCPUs ?
Yes : API Maker is one process which uses every vCPU of its server. Get all on MongoDB went from 2,435 requests per second on 1 vCPU to 4,692 on 2 shared, 7,423 on 4 shared, 11,002 on 8 shared, 3,712 on 2 dedicated, 7,614 on 4 dedicated, 12,640 on 8 dedicated. The database runs on the same server, so its own work grows with the load too.
---
# How API Maker is benchmarked
> How API Maker is benchmarked - Linode servers of 1 to 8 vCPUs, autocannon with 100 connections for 15 s, two rounds, the dataset, every API setting and the commands to run it yourself.
Source: https://docs.apimaker.dev/v4/docs/benchmarks/methodology.html
The benchmarks measure what you would get yourself : API Maker set up by its own installer on a plain cloud server, the databases on the same machine, and the load sent from a second server. This page shows every step, so you can check any number, or run the benchmarks again.
| | |
|---|---|
| Servers | 7 [Linode](https://www.linode.com) servers in Mumbai, from 1 to 8 vCPUs, shared and dedicated CPU, all on the same CPU (AMD EPYC 7642). Each one runs API Maker and its databases. |
| Load | autocannon 8 on a second, dedicated server in the same data centre : 100 connections, 5 seconds of warm-up, then 15 seconds measured. |
| Rounds | Every API runs twice, the second time in reverse order. The pages show the average of the two. |
| Data | The [benchmark dataset](https://apimaker.dev/json/benchmark_dataset.json) : 10 customers with 10 columns each, in MongoDB, PostgreSQL and MySQL. |
| Installation | The API Maker installer with its default answers and no reverse proxy. One setting changed : the sandboxes keep running. |
| Checks | Every API answers once before its load : the status and the rows are checked, and an API with tokens refuses a request with none, or only one. Every error, non-2xx answer and timeout is counted. |
## The servers
Every benchmark uses two servers in the same data centre :
| | Server under test | Load generator |
|---|---|---|
| Runs | API Maker, its MongoDB and Redis, PostgreSQL, MySQL, the sandboxes | autocannon, nothing else |
| Plan | Shared or dedicated CPU, as named on each page | Dedicated CPU, four times the vCPUs of the server under test |
| System | Ubuntu 24.04 LTS | Ubuntu 24.04 LTS, Node.js 24.21.0, autocannon 8.0.0 |
| Network | Private network of the data centre | The same network, 0.5 ms away (ping) |
The load comes from its own machine, so autocannon never takes CPU away from API Maker. That machine has dedicated CPUs, so its speed does not depend on its neighbours, and it is big enough never to be the limit : it was never more than 29 % busy during a run (42 % for the 1 vCPU server). Every page shows how busy it was.
| Server under test | Load generator | autocannon threads |
|---|---|--:|
| 1 vCPU | Dedicated 8 GB (g6-dedicated-4) : 4 vCPUs | 4 (25 connections each) |
| 2 vCPU, shared and dedicated | Dedicated 16 GB (g6-dedicated-8) : 8 vCPUs | 5 (20 connections each) |
| 4 vCPU, shared and dedicated | Dedicated 32 GB (g6-dedicated-16) : 16 vCPUs | 10 (10 connections each) |
| 8 vCPU, shared and dedicated | Dedicated 64 GB (g6-dedicated-32) : 32 vCPUs | 20 (5 connections each) |
### Enough autocannon threads
One autocannon thread cannot keep up with the fastest APIs. On the 1 vCPU server, *get by id with caching* gave about 10,400 requests per second with one thread, and about 12,000 with four, at the same latency. So autocannon runs several threads, which share the 100 connections.
To be sure the threads were not the limit, the same API was loaded again after each run, with more threads. It gave the same requests per second :
| Server | Threads of the run : req/s | More threads : req/s |
|---|--:|--:|
| [2 vCPU, shared](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html) | 5 : 19,709 and 19,524 | 10 : 19,766 and 20,058 |
| [2 vCPU, dedicated](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html) | 5 : 16,442 and 16,466 | 10 : 16,176 and 16,412 |
| [4 vCPU, shared](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html) | 10 : 26,932 and 27,201 | 20 : 27,304 and 26,271 |
| [4 vCPU, dedicated](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html) | 10 : 32,748 and 32,841 | 20 : 32,998 and 32,970 |
| [8 vCPU, shared](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html) | 20 : 41,740 and 41,994 | 25 : 42,075 and 42,190 |
| [8 vCPU, dedicated](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html) | 20 : 48,650 and 48,364 | 25 : 47,617 and 47,700 |
### The same CPU, at the same time
A Linode server runs on whatever CPU its host has. All seven servers under test run on the **AMD EPYC 7642**, so every size and both plans are compared on the same CPU. The load generators run on AMD EPYC 7642 or 7713 ; each page names its own.
All seven servers were measured at the same time, each with its own load generator. Linode placement groups (strict *anti-affinity*) kept the three shared CPU servers of 2, 4 and 8 vCPUs on three different hosts, and the three dedicated servers too. Every page shows the steal time of each run : the CPU the hypervisor gave to other servers.
### Why 100 connections
The fastest server (8 dedicated vCPUs) was loaded with 100, 200 and 400 connections, 20 seconds each :
| API | 100 connections | 200 | 400 | Server busy |
|---|--:|--:|--:|--:|
| Get by id with caching, public, MongoDB | 45,742 | 46,061 | 44,016 | 87 to 90 % |
| Get all, public, MongoDB | 11,059 | 11,114 | 11,049 | 95 % |
| Custom API with both tokens, PostgreSQL | 5,395 | 5,962 | 6,128 | 99 to 100 % |
At 100 connections the server already works at full speed. More connections mostly add waiting : the latency doubles at each step, for few more requests. The *more connections* runs of every page, from 10 to 1,000, say the same for *get all* : above 100 connections it gained 2.0 % at most. Only *get by id with caching* on the smallest server gained more : on 1 shared vCPU, 250 connections gave 15,248 requests per second against 12,096 with 100, at twice the latency (16 ms p50 against 8 ms).
## The installation
API Maker is installed on a fresh server with its own [installer](https://docs.apimaker.dev/v4/docs/getting-started/install-on-server.html), its default answers and no reverse proxy, so nothing stands between autocannon and API Maker :
```sh
bash install.sh --default --primary --caddy=no --ssl=no --qa_uat_prod=no --package=api-maker-4.0.0-linux-x64.tar.gz
```
The installer sets up Docker, MongoDB 8.0.10 and Redis 7.0.5 in Docker, swap, and API Maker as a systemd service. API Maker keeps its default settings :
- one worker thread per vCPU ;
- the Redis of the installation for cached answers, kept two hours (`redisValueExpireInSeconds` 7200) ;
- two sandboxes per environment of an account (`sandboxCountForAdmin`), each opening up to one runner per vCPU while it is busy ;
- no request logs : a fresh installation has no database for them.
One setting is changed, in `~/config/.env` :
```sh
am__sandbox__removeSandboxInactiveSinceMinutes=1440
```
By default, a sandbox nobody used for 5 minutes stops, and the next custom API starts it again. Here the two sandboxes of the account keep running while a database is measured, so every API runs with them, and their memory is counted.
### PostgreSQL and MySQL
PostgreSQL 18 and MySQL 8.4 run from their official images. On the servers of 2 to 8 vCPUs they allow 500 connections (100 and 151 by default) ; the 1 vCPU server keeps their defaults :
```sh
docker run -d --name bench_postgres -e POSTGRES_PASSWORD=… -p 5432:5432 postgres:18 -c max_connections=500
docker run -d --name bench_mysql -e MYSQL_ROOT_PASSWORD=… -p 3306:3306 mysql:8.4 --max-connections=500
```
Code that runs in a sandbox opens connection pools of its own, one per runner. On 8 vCPUs, a custom API in the sandbox on PostgreSQL can hold **161 connections** : 2 sandboxes × 8 runners × a pool of 10, plus the pool of API Maker itself. That is more than the 100 PostgreSQL allows by default. If your server has many vCPUs and runs code on a SQL database, raise `max_connections`, or lower *Max pool connections* of the instance.
The MongoDB data of the benchmarks lives in the MongoDB of API Maker itself (database `am_bench`), the way a small installation keeps everything in one MongoDB.
## The data
Every table holds the ten rows of the benchmark dataset. One row :
```json
{
"_id": "60ae2488c37cd955cc144161",
"customer_id": 2,
"first_name": "NICK",
"last_name": "WAHLBERG",
"phone": 1123456789,
"last_update": "2006-02-15T04:34:00.330Z",
"pincode": 111111,
"shipping_id": 2,
"dob": "2022-10-30T03:25:03.000Z",
"country": "India"
}
```
Each database (`am_bench` in MongoDB, PostgreSQL and MySQL) has six tables. API Maker made the schema of each from the table :
| Table | Its APIs | Caching |
|---|---|---|
| `customers_public` | Public | Off |
| `customers` | Both tokens | Off |
| `customers_public_cached` | Public | On |
| `customers_cached` | Both tokens | On |
| `customers_pre_hook` | Both tokens, a pre hook on its get all | Off |
| `inserts_public` | Public : the insert benchmark writes here | Off |
In SQL, `customer_id` is the primary key (`SERIAL` / `AUTO_INCREMENT` in `inserts_public`) and the dates are `TIMESTAMP(3)` / `DATETIME(3)`. In PostgreSQL the URLs name the tables with their schema : `public.customers_public`.
## The APIs
The settings of the APIs of a table (`__COLLECTION_SETTINGS__`), for each kind of table :
**Public**
```typescript
import * as T from 'types';
let settings: T.IInstanceApiSettingsTypes = {
enableCaching: false,
apiAccessType: T.EAPIAccessType.IS_PUBLIC,
};
module.exports = settings;
```
**Both tokens**
```typescript
import * as T from 'types';
let settings: T.IInstanceApiSettingsTypes = {
enableCaching: false,
apiAccessType: T.EAPIAccessType.TOKEN_ACCESS,
authProviders: ["bench_token_mongodb"],
};
module.exports = settings;
```
**Cached**
```typescript
import * as T from 'types';
let settings: T.IInstanceApiSettingsTypes = {
enableCaching: true,
apiAccessType: T.EAPIAccessType.IS_PUBLIC,
};
module.exports = settings;
```
The custom APIs are TypeScript :
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
return await g.sys.db.getAll({ instance: 'mongodb', database: 'am_bench', collection: 'customers_public' });
}
module.exports = main;
```
The custom API with both tokens is the same, with `apiAccessType: TOKEN_ACCESS` and the token generator of its database in `authProviders`, and reads `customers`. The custom API without a database returns `{ message: 'Hello from API Maker', time: 1 }`.
### In the server or in the sandbox
The code above is **lean** : it only reads what it is given and calls `g.sys`. API Maker runs lean code inside the server, with QuickJS, on the thread that answers the request : the request never leaves the server. The pre hook below is lean too. Code that needs more (a package, `g.shared`, the clock, a timer, `try`) runs in a sandbox of the account : a container with Node.js 24.
To measure both, every database also has a custom API that runs in the sandbox : the same code with one more line, which reads `Date.now()` and so is not lean. The custom API without a database has a sandbox twin too (`{ message: 'Hello from the sandbox', time: Date.now() }`).
**The custom API which runs in the sandbox**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
const started = Date.now(); // the time of the machine : this code runs in the sandbox of the account
return await g.sys.db.getAll({ instance: 'mongodb', database: 'am_bench', collection: 'customers_public' });
}
module.exports = main;
```
### The pre hook
The table `customers_pre_hook` has the settings of *both tokens*, and a pre hook on its get all API (`SCHEMA_GET_ALL`) : row scoping, the pre hook most applications write. It reads the signed-in person from `x-am-user-authorization` and keeps the rows of their country :
**Pre hook of SCHEMA_GET_ALL on customers_pre_hook**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
if (!g.req.isApiRequestFromUser) return;
const person = g.req.auth.authAMDB; // the person, from x-am-user-authorization
if (!person) throw [{ code: T.EStatusCode.UNAUTHORIZED, message: 'Sign in first.' }];
const find = g.req.query.find ? (typeof g.req.query.find === 'string' ? JSON.parse(g.req.query.find) : g.req.query.find) : {};
g.req.query.find = { $and: [find, { country: person.country }] };
}
module.exports = main;
```
Every row of the dataset is in India, like the person of the token, so the answer is the same ten rows as *get all*, after the hook ran. Before the benchmarks, a first hook adds a warning to the answer, to prove that the hooks of the table run ; then the hook above takes its place.
### The two tokens
*Both tokens* means what a real application sends : the token of an API user and the token of a user of the application.
- **`x-am-authorization`** : the token of an [API user](https://docs.apimaker.dev/v4/docs/apis-security/api-user-permission.html), from the [token API](https://docs.apimaker.dev/v4/docs/apis-all/system-apis/system-generated-token-api.html). Its groups say which APIs it may call ; here one group allows everything.
- **`x-am-user-authorization`** : the token of a row of the `customers` table, made by a [DB token generator](https://docs.apimaker.dev/v4/docs/authorization/AMDB.html) of the database (`first_name` as the user name, `last_name` as the password). Its `select` puts `customer_id` and `country` in `g.req.auth.authAMDB`, for the pre hook : a column which is not selected is not there.
```typescript
import * as T from 'types';
let dbTokenGenerator: T.IAuthTokenAMDB = {
name: 'bench_token_mongodb',
instance: 'mongodb',
database: 'am_bench',
collection: 'customers',
usernameColumn: 'first_name',
passwordColumn: 'last_name',
select: 'customer_id,country',
expiresInSeconds: 2592000,
runOnNativeProcess: false,
};
module.exports = dbTokenGenerator;
```
Both tokens are asked for again before every run, and sent with every request. API Maker checks both on every request.
## The load
For every API, on every database :
1. **Check** : one request checks the answer. Status 200 (201 for the insert), ten rows for *get all*, the row for *get by id*, the saved row for the insert. Before the first run, every API with tokens was also checked to answer 401 without its tokens, and with only one of them.
2. **Warm-up** : 5 seconds, so the cache fills, the connections to the database open, and the code of the custom API or the hook is loaded.
3. **Measure** : a pause of 3 seconds, then **15 seconds** of load, no pipelining :
```sh
autocannon -c 100 -d 15 -w 4 -l "http://:38246/api/schema/bench/mongodb/am_bench/customers_public"
autocannon -c 100 -d 15 -w 4 -l \
-H "x-am-authorization: " -H "x-am-user-authorization: " \
"http://:38246/api/schema/bench/mongodb/am_bench/customers"
```
4. **Rest** : 15 seconds before the next API.
All the APIs of a database run once (round 1), then again in reverse order (round 2), so a slow moment of a shared CPU does not fall on the same API twice. **The number shown is the average of the two rounds**, and the autocannon output shown is the round closer to it. The page of each server also shows both rounds and how far apart they are.
*More connections* is a separate run of *get all, public* and *get by id with caching, public* on MongoDB : 15 seconds for each number of connections (10, 50, 100, 250, 500 and 1,000).
## Nothing else runs
Before the APIs of a database are loaded :
- the other benchmark databases are stopped (the MongoDB and Redis of API Maker keep running : API Maker needs them) ;
- API Maker is restarted, so every database starts with a fresh process, and its two sandboxes are started and checked ;
- the swap is emptied back into memory, when it fits. On the 1 vCPU server it did not fit before MySQL : MySQL 8.4, MongoDB, Redis, API Maker and its sandboxes need more than the 961 MB of that server, so its MySQL runs started with swap in use ;
- the server rests 60 seconds : this is the memory *at rest* of the pages.
Nothing else runs on the server : no reverse proxy, no admin panel open, no other load. The periodic jobs of Ubuntu (apt, man-db, sysstat, fstrim and the others) are stopped on both servers for the benchmarks. The job which rotates the log of API Maker, part of its installation, stays on.
## Memory and CPU
A small script reads `/proc` and the cgroups of the containers once a second, on the server and on the load generator. It costs a few milliseconds of CPU a second.
| Measure | What it is |
|---|---|
| API Maker | The resident memory (RSS) of the `api_maker_be` process, and its CPU in percent of one core. |
| Containers | MongoDB, Redis, PostgreSQL, MySQL and the sandboxes : memory as `docker stats` counts it (without the inactive file cache), and CPU. |
| Whole server | Memory used (total − available), swap used, pages swapped in and out. |
| CPU | User, system, softirq, idle and **steal** : the time the hypervisor gave to other servers. On a shared CPU, steal shows whether a neighbour took the CPU during a run. |
*Under load* on the pages is the most a part held while the APIs of its database ran, leaving out the first two seconds of each run, while autocannon opens its connections. *At rest* is the average of the 60 seconds before, with API Maker and its two sandboxes started and no request.
## What these numbers are not
- **No HTTPS, no reverse proxy.** Caddy (which the installer puts in front by default) and TLS cost CPU of their own, on the same cores.
- **A small table.** Ten rows of ten columns measure what API Maker adds to each request. Bigger answers cost more bytes, and more time in the database.
- **Not your server.** Your CPU, your neighbours on a shared plan, your network and your data change the numbers. The method is here so you can measure your own.
- **Not a published version.** The pages say API Maker 4.0.0 : the number of the build that was measured (commit `864bb64`, 12 October 2026), before the beta releases were numbered.
- **Not a rule about shared and dedicated CPU.** Get all reached 4,692 req/s on 2 shared vCPUs and 3,712 on 2 dedicated vCPUs, on the same CPU model. A shared vCPU can run faster while its host is quiet, the two load generators differed (an EPYC 7713 and an EPYC 7642), and each server was measured once. Read a gap of this size as the spread of one run. Choose dedicated vCPUs for a speed which does not depend on the neighbours.
## Run it yourself
1. Make two servers in the same data centre. Install API Maker on the first one, and the databases you want to measure.
2. Load the [dataset](https://apimaker.dev/json/benchmark_dataset.json) into the tables above. Add an [instance](https://docs.apimaker.dev/v4/docs/apis-all/overview.html#instances) for each database, then the schemas, the settings, the token generators and the custom APIs of this page.
3. On the second server : `npm install autocannon@8`, ask for the two tokens with the [token API](https://docs.apimaker.dev/v4/docs/apis-all/system-apis/system-generated-token-api.html), and run the commands of [The load](https://docs.apimaker.dev/v4/docs/benchmarks/methodology.html#the-load) for each API.
The results : [API benchmarks](https://docs.apimaker.dev/v4/docs/benchmarks/index.html).
---
# API Maker benchmark : 1 vCPU, 1 GB RAM (Linode shared CPU)
> API Maker on 1 shared vCPU, 1 GB (Linode) : 2,435 req/s get all, 12,140 cached, on MongoDB, PostgreSQL and MySQL, with memory and autocannon output.
Source: https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html
Benchmark · Linode (Akamai Cloud) · Shared CPU · 12 October 2026
**1 vCPU, 1 GB RAM : 2,435 to 4,623 requests per second for a whole table.**
API Maker 4.0.0 on the smallest Linode server, a Nanode 1 GB (g6-nanode-1) at $5 a month, its databases on the same machine. Every API was loaded for 15 seconds by autocannon from a second server, two times, on MongoDB, PostgreSQL and MySQL, public and with two tokens, while the server sampled the memory and CPU of every part each second.
Get all · MongoDB
2,435req/s
PostgreSQL 3,787 · MySQL 4,623
Get by id, cached
12,140req/s
answered from Redis · PostgreSQL 12,083 · MySQL 12,193
Custom API · MongoDB
1,909req/s
TypeScript, lean : run in the server · in the sandbox 1,389
API Maker memory
84MB
at rest · 111 MB at most under load
## The server
| | |
|---|---|
| Server | Linode (Akamai Cloud), Nanode 1 GB (g6-nanode-1), shared cpu, $5 / month |
| CPU | AMD EPYC 7642 48-Core Processor, 1 shared vCPU (KVM) KVM guest, 1 thread per core · L1d 64 KiB (1 instance) · L2 512 KiB (1 instance) · L3 16 MiB (1 instance) · BogoMIPS 4600.00 |
| Memory | 1 GB (961 MB usable), swap 2.5 GB (496 MB of Linode + 2 GB made by the installer) |
| Disk, region | 25 GB SSD, Mumbai, India (ap-west) |
| System | Ubuntu 24.04.4 LTS, Linux 6.8.0-134, Docker 29.9.0 |
| API Maker | 4.0.0 : release build of api_maker_be_rust 864bb64 (opt-level 3, fat LTO), installed by its installer (https://apimaker.dev/v4/install.sh), no reverse proxy |
| Settings | the defaults of the installer (lean code of the account runs in the server with QuickJS : sandbox.codeInServer), and the sandboxes kept running for the whole run (removeSandboxInactiveSinceMinutes 1440) |
| Databases | MongoDB 8.0.10 (the MongoDB of API Maker, a replica set of one member, in Docker) · Redis 7.0.5 (the Redis of API Maker, in Docker) · PostgreSQL 18.6 (official image postgres:18, max_connections 500) · MySQL 8.4.11 (official image mysql:8.4, max_connections 500) : all on the same server |
| Sandboxes | TypeScript on Node.js 24.21.0 (an image of 403 MB built by API Maker), 2 sandboxes of the account (sandboxCountForAdmin 2, the default), each opening up to 1 runner when it is busy (one per vCPU) |
| Load generator | Dedicated 8 GB (g6-dedicated-4) : AMD EPYC 7713 64-Core Processor, 4 dedicated vCPUs, Ubuntu 24.04.4 LTS, Node.js 24.21.0, autocannon 8.0.0 with 4 worker threads |
| Network | Private network of the same data centre, round trip 0.45 ms (ping) |
| Host | All seven servers were measured at the same time, each by a load generator of its own. |
| Date | 12 October 2026, 05:30 to 07:05 UTC (its MongoDB block measured again from 06:46) |
Only what a database needs was running while it was measured : API Maker and its two sandboxes, its MongoDB and Redis (API Maker always needs them) and the database under test. The other benchmark databases were stopped, API Maker was restarted and the swap emptied back into memory before each database, when it fitted there. How every number was taken : [How API Maker is benchmarked](https://docs.apimaker.dev/v4/docs/benchmarks/methodology.html). Every server side by side : [All results](https://docs.apimaker.dev/v4/docs/benchmarks/summary.html).
## The data
Every table holds the ten rows of the [API Maker benchmark dataset](https://apimaker.dev/json/benchmark_dataset.json) : `https://apimaker.dev/json/benchmark_dataset.json`. Ten customers, ten columns each ; a *get all* answers all ten (2,418 bytes of JSON on MongoDB), a *get by id* one of them.
| `_id` | `customer_id` | `first_name` | `last_name` | `phone` | `last_update` | `pincode` | `shipping_id` | `dob` | `country` |
|---|---|---|---|---|---|---|---|---|---|
| 60ae2488c37cd955cc144161 | 2 | NICK | WAHLBERG | 1123456789 | 2006-02-15T04:34:00.330Z | 111111 | 2 | 2022-10-30T03:25:03.000Z | India |
| 60ae24c8c37cd955cc144162 | 1 | PENELOPE | GUINESS | 123456789 | 2006-02-15T04:34:00.330Z | 100050 | 1 | 2022-10-30T03:25:03.000Z | India |
| 60ae247ac37cd955cc144160 | 3 | ED | CHASE | 2123456789 | 2006-02-15T04:34:00.330Z | 222222 | 3 | 2022-10-30T03:25:03.000Z | India |
| 60ace1401efc56684403c68c | 4 | JENNIFER | DAVIS | 3123456789 | 2006-02-15T04:34:00.330Z | 100050 | 4 | 2022-10-30T03:25:03.000Z | India |
| 60accda51efc56684403c685 | 5 | JOHNNY | LOLLOBRIGIDA | 4123456789 | 2006-02-15T04:34:00.330Z | 485125 | 1 | 2022-10-30T03:25:03.000Z | India |
| 606b7d364bebce00196eade7 | 6 | JOHNNY | LOLLOBRIGIDA | 5123456789 | 2006-02-15T04:34:00.330Z | 123456 | 2 | 2022-10-30T03:25:03.000Z | India |
| 606b75961055000018fa9d98 | 7 | GRACE | MOSTEL | 6123456789 | 2006-02-15T04:34:00.330Z | 356589 | 3 | 2022-10-30T03:25:03.000Z | India |
| 6064dd02730026001956663e | 8 | MATTHEW | JOHANSSON | 7123456789 | 2006-02-15T04:34:00.330Z | 100050 | 4 | 2022-10-30T03:25:03.000Z | India |
| 6064dcb8730026001956663c | 9 | JOE | SWANK | 8123456789 | 2006-02-15T04:34:00.330Z | 251415 | 1 | 2022-10-30T03:25:03.000Z | India |
| 6064c4c02bafb90018955299 | 10 | CHRISTIAN | GABLE | 9123456789 | 2006-02-15T04:34:00.330Z | 100050 | | 2022-10-30T03:25:03.000Z | India |
## Results at a glance
Requests per second, the average of two rounds of 15 seconds with 100 connections. *Public* APIs need no token ; *both tokens* means every request carries `x-am-authorization` (the token of an API user, whose groups decide what it may call) and `x-am-user-authorization` (the token of a row of the `customers` table, made by a DB token generator), and API Maker checks both.
**Requests per second · 1 vCPU, 1 GB RAM, shared CPU** · MongoDB · PostgreSQL · MySQL
Get allpublic · 2,435 · 3,787 · 4,623
Get allboth tokens · 2,439 · 3,560 · 4,126
Get all with cachingpublic · 11,054 · 11,064 · 11,245
Get all with cachingboth tokens · 8,709 · 8,797 · 8,870
Get all by streampublic · 2,545 · 3,989 · 4,213
Get all by streamboth tokens · 2,548 · 3,461 · 3,662
Custom API calling get all QuickJS · public · 1,909 · 2,178 · 2,419
Custom API calling get all QuickJS · both tokens · 1,699 · 2,016 · 2,231
Custom API in the sandbox Sandbox · public · 1,389 · 1,871 · 2,170
Get all with a pre hook QuickJS · both tokens · 1,984 · 2,318 · 2,688
Get by idpublic · 3,100 · 4,105 · 5,090
Get by idboth tokens · 3,044 · 3,887 · 4,526
Get by id with cachingpublic · 12,140 · 12,083 · 12,193
Get by id with cachingboth tokens · 9,481 · 9,402 · 9,217
Insert one rowpublic · 1,156 · 1,818 · 1,651
| API | Access | MongoDB | PostgreSQL | MySQL |
|---|---|--:|--:|--:|
| [Get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-all) | Public | **2,435** p99 46 ms | **3,787** p99 51 ms | **4,623** p99 27 ms |
| [Get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-all) | Both tokens | **2,439** p99 52 ms | **3,560** p99 36 ms | **4,126** p99 31 ms |
| [Get all with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-all-with-caching) | Public | **11,054** p99 13 ms | **11,064** p99 13 ms | **11,245** p99 13 ms |
| [Get all with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-all-with-caching) | Both tokens | **8,709** p99 17 ms | **8,797** p99 17 ms | **8,870** p99 17 ms |
| [Get all by stream](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-all-by-stream) | Public | **2,545** p99 46 ms | **3,989** p99 31 ms | **4,213** p99 29 ms |
| [Get all by stream](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-all-by-stream) | Both tokens | **2,548** p99 54 ms | **3,461** p99 37 ms | **3,662** p99 34 ms |
| [Custom API calling get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#custom-api-calling-get-all) QuickJS | Public | **1,909** p99 69 ms | **2,178** p99 57 ms | **2,419** p99 51 ms |
| [Custom API calling get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#custom-api-calling-get-all) QuickJS | Both tokens | **1,699** p99 125 ms | **2,016** p99 57 ms | **2,231** p99 53 ms |
| [Custom API in the sandbox](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#custom-api-in-the-sandbox) Sandbox | Public | **1,389** p99 97 ms | **1,871** p99 100 ms | **2,170** p99 70 ms |
| [Get all with a pre hook](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-all-with-a-pre-hook) QuickJS | Both tokens | **1,984** p99 66 ms | **2,318** p99 53 ms | **2,688** p99 47 ms |
| [Get by id](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-by-id) | Public | **3,100** p99 37 ms | **4,105** p99 31 ms | **5,090** p99 25 ms |
| [Get by id](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-by-id) | Both tokens | **3,044** p99 44 ms | **3,887** p99 32 ms | **4,526** p99 28 ms |
| [Get by id with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-by-id-with-caching) | Public | **12,140** p99 12 ms | **12,083** p99 12 ms | **12,193** p99 12 ms |
| [Get by id with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#get-by-id-with-caching) | Both tokens | **9,481** p99 16 ms | **9,402** p99 16 ms | **9,217** p99 16 ms |
| [Insert one row](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#insert-one-row) | Public | **1,156** p99 110 ms | **1,818** p99 64 ms | **1,651** p99 71 ms |
| [Custom API without a database](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#custom-api-without-a-database) | Public | **8,096** p99 18 ms | | |
| [Custom API without a database, in the sandbox](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html#custom-api-without-a-database) | Public | **9,258** p99 17 ms | | |
(0 errors) Every one of the **8,390,598 requests** of these runs was answered with status 200 or 201 : no error, no timeout.
## Memory
What each part of the server held, in MB : at rest (the 60 seconds after API Maker and its sandboxes started, before any request) and under load. The bars show the second the whole server held the most memory while its database was loaded, out of the 961 MB of the server ; the table gives the most each part held on its own. API Maker is the resident memory of its process ; a container is counted the way `docker stats` counts it.
With 961 MB for API Maker, its MongoDB, Redis, the database under test and two sandboxes, the server used its swap : up to 634 MB. Linux puts there the memory nothing touches, and takes it back when it is touched again. API Maker had up to 50 MB in swap, memory it holds but does not use while it serves requests, and kept as little as 44 MB in RAM. The rows *in swap* show what each part had there, the counts of pages swapped in and out are in the line under each run. Before MySQL, the swap could not be emptied : with it running, what the swap held did not fit in the memory of the server any more, and the runs of MySQL started with the swap in use.
API Maker · MongoDB of API Maker · Redis · PostgreSQL / MySQL · Sandboxes · Linux, Docker, the rest · Available
MongoDB
at rest
under load
PostgreSQL
at rest
under load
MySQL
at rest
under load
| Part | MongoDB at rest → under load | PostgreSQL at rest → under load | MySQL at rest → under load |
|---|--:|--:|--:|
| **API Maker** (process), in RAM | 84 → **111** | 88 → **105** | 76 → **88** |
| … and in swap | 0 → **16** | 0 → **0** | 2 → **50** |
| MongoDB of API Maker, in RAM | 217 → **231** | 215 → **215** | 73 → **81** |
| … and in swap | 0 → **54** | 0 → **97** | 161 → **161** |
| Redis, in RAM | 3 → **4** | 4 → **4** | 3 → **3** |
| Database under test, in RAM | MongoDB above | 68 → **113** | 323 → **327** |
| … and in swap | MongoDB above | 0 → **1** | 103 → **347** |
| Sandboxes (2 containers), in RAM | 50 → **204** | 50 → **200** | 63 → **173** |
| … and in swap | 0 → **0** | 0 → **0** | 0 → **4** |
| **Whole server**, RAM used | 686 → **807** | 716 → **770** | 764 → **775** |
| Swap used | 1 → **90** | 1 → **136** | 342 → **634** |
## CPU
On 1 vCPU, API Maker and the database share the same core : every request costs the work of both. During *get all, public*, the core was split this way (average of the 15 seconds, in vCPUs : 1.0 is the whole core ; a process counts its own kernel time) :
| | MongoDB | PostgreSQL | MySQL |
|---|--:|--:|--:|
| API Maker | 0.4 vCPU | 0.4 vCPU | 0.5 vCPU |
| The database | 0.5 vCPU | 0.4 vCPU | 0.4 vCPU |
| MongoDB of API Maker (when it is not the one tested) | – | 0.0 vCPU | 0.0 vCPU |
| Sandboxes (idle : no code runs in get all) | 0.0 vCPU | 0.0 vCPU | 0.0 vCPU |
| Whole server busy (of its 1 vCPU) | 100 % | 100 % | 100 % |
| … of which kernel time (network, disk), counted in the lines above too | 33 % | 35 % | 39 % |
Steal time (CPU the hypervisor gave to other servers) was 0 % on average, 1 % at most. The load generator, sampled the same way, was never more than 40 % busy over its 4 cores : it was never the limit.
## Get all
The schema API of a table answers all its rows : `GET /api/schema////
`. Every request reads the ten rows from the database, converts them with the schema of the table and sends them as JSON. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/schema-apis/auto-generated-schema-based-get-all-api.html).
### Get all : public
No token : the API is public. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
2,435
37,654 requests in 15 s
Latency p50
39ms
average 39.3 ms
Latency p99
46ms
max 224 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **2,511** · 2 : **2,359** req/s · spread 6.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.4 vCPU**, **97 MB** RSS · MongoDB **0.5 vCPU** · sandboxes **0.0 vCPU**, **50 MB** · whole server busy **100 %**, of which kernel (network, disk) **33 %** · memory used **690 MB** of 961 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
3,787
56,194 requests in 15 s
Latency p50
25ms
average 26.2 ms
Latency p99
51ms
max 61 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,747** · 2 : **3,826** req/s · spread 2.1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.4 vCPU**, **96 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.4 vCPU** · sandboxes **0.0 vCPU**, **50 MB** · whole server busy **100 %**, of which kernel (network, disk) **35 %** · memory used **737 MB** of 961 MB · steal **0 %** · swap **1511** pages moved
autocannon · PostgreSQL · get all, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
4,623
70,425 requests in 15 s
Latency p50
21ms
average 20.8 ms
Latency p99
27ms
max 44 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **4,696** · 2 : **4,550** req/s · spread 3.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.5 vCPU**, **83 MB** RSS (+ 12 MB in swap) · MongoDB **0.0 vCPU** · MySQL **0.4 vCPU** · sandboxes **0.0 vCPU**, **73 MB** · whole server busy **100 %**, of which kernel (network, disk) **39 %** · memory used **775 MB** of 962 MB · steal **0 %** · swap **40** pages moved
autocannon · MySQL · get all, public · round 1 of 2, the closer to the average
### Get all : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
2,439
37,858 requests in 15 s
Latency p50
39ms
average 39.1 ms
Latency p99
52ms
max 76 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **2,524** · 2 : **2,354** req/s · spread 7 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.4 vCPU**, **101 MB** RSS · MongoDB **0.4 vCPU** · sandboxes **0.0 vCPU**, **60 MB** · whole server busy **100 %**, of which kernel (network, disk) **31 %** · memory used **692 MB** of 961 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
3,560
52,112 requests in 15 s
Latency p50
28ms
average 28.3 ms
Latency p99
36ms
max 55 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,475** · 2 : **3,645** req/s · spread 4.8 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.5 vCPU**, **97 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.3 vCPU** · sandboxes **0.0 vCPU**, **52 MB** · whole server busy **100 %**, of which kernel (network, disk) **32 %** · memory used **735 MB** of 961 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
4,126
63,281 requests in 15 s
Latency p50
23ms
average 23.2 ms
Latency p99
31ms
max 51 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **4,220** · 2 : **4,031** req/s · spread 4.6 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.5 vCPU**, **84 MB** RSS (+ 12 MB in swap) · MongoDB **0.0 vCPU** · MySQL **0.3 vCPU** · sandboxes **0.0 vCPU**, **74 MB** · whole server busy **100 %**, of which kernel (network, disk) **37 %** · memory used **771 MB** of 962 MB · steal **0 %** · swap **188** pages moved
autocannon · MySQL · get all, both tokens · round 1 of 2, the closer to the average
## Get all with caching
The same request on a table whose API settings say `enableCaching: true`. The first answer is kept in Redis, under a key made of who asks and what is asked ; the next requests are answered from Redis until the answer expires or something writes the table. [About this API](https://docs.apimaker.dev/v4/docs/features/automatic-caching.html).
### Get all with caching : public
No token : the API is public. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
11,054
163,851 requests in 15 s
Latency p50
9ms
average 8.7 ms
Latency p99
13ms
max 64 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **10,924** · 2 : **11,185** req/s · spread 2.4 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.7 vCPU**, **99 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **60 MB** · Redis **0.1 vCPU** · whole server busy **100 %**, of which kernel (network, disk) **47 %** · memory used **689 MB** of 962 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all with caching, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
11,064
166,921 requests in 15 s
Latency p50
8ms
average 8.5 ms
Latency p99
13ms
max 47 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **11,129** · 2 : **11,000** req/s · spread 1.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.7 vCPU**, **96 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **52 MB** · Redis **0.1 vCPU** · whole server busy **100 %**, of which kernel (network, disk) **47 %** · memory used **731 MB** of 962 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all with caching, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
11,245
167,442 requests in 15 s
Latency p50
8ms
average 8.5 ms
Latency p99
13ms
max 57 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **11,326** · 2 : **11,164** req/s · spread 1.4 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **0.7 vCPU**, **48 MB** RSS (+ 50 MB in swap) · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **173 MB** · Redis **0.1 vCPU** · whole server busy **100 %**, of which kernel (network, disk) **46 %** · memory used **683 MB** of 962 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all with caching, public · round 2 of 2, the closer to the average
### Get all with caching : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
8,709
128,865 requests in 15 s
Latency p50
11ms
average 11.2 ms
Latency p99
17ms
max 46 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **8,591** · 2 : **8,828** req/s · spread 2.7 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.8 vCPU**, **98 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **60 MB** · Redis **0.1 vCPU** · whole server busy **100 %**, of which kernel (network, disk) **40 %** · memory used **680 MB** of 961 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all with caching, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
8,797
129,573 requests in 15 s
Latency p50
11ms
average 11.1 ms
Latency p99
17ms
max 48 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **8,955** · 2 : **8,639** req/s · spread 3.6 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **0.8 vCPU**, **96 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **200 MB** · Redis **0.1 vCPU** · whole server busy **100 %**, of which kernel (network, disk) **39 %** · memory used **763 MB** of 962 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all with caching, both tokens · round 2 of 2, the closer to the average
**MySQL**
Requests / second
8,870
131,305 requests in 15 s
Latency p50
11ms
average 10.9 ms
Latency p99
17ms
max 49 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **8,986** · 2 : **8,753** req/s · spread 2.6 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **0.8 vCPU**, **49 MB** RSS (+ 50 MB in swap) · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **173 MB** · Redis **0.1 vCPU** · whole server busy **100 %**, of which kernel (network, disk) **40 %** · memory used **682 MB** of 962 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all with caching, both tokens · round 2 of 2, the closer to the average
## Get all by stream
`GET …/
/stream` : the rows are sent while they are read from the database cursor, so a large table never sits whole in memory. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/schema-apis/auto-generated-schema-based-get-all-by-stream-api.html).
### Get all by stream : public
No token : the API is public. Each answer : 2,477 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
2,545
38,872 requests in 15 s
Latency p50
38ms
average 38.1 ms
Latency p99
46ms
max 78 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **2,498** · 2 : **2,592** req/s · spread 3.7 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **0.4 vCPU**, **90 MB** RSS (+ 16 MB in swap) · MongoDB **0.4 vCPU** · sandboxes **0.0 vCPU**, **194 MB** · whole server busy **100 %**, of which kernel (network, disk) **30 %** · memory used **751 MB** of 962 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all by stream, public · round 2 of 2, the closer to the average
**PostgreSQL**
Requests / second
3,989
61,363 requests in 15 s
Latency p50
24ms
average 23.9 ms
Latency p99
31ms
max 44 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **4,092** · 2 : **3,887** req/s · spread 5.1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.4 vCPU**, **96 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.4 vCPU** · sandboxes **0.0 vCPU**, **52 MB** · whole server busy **100 %**, of which kernel (network, disk) **37 %** · memory used **731 MB** of 961 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all by stream, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
4,213
65,583 requests in 15 s
Latency p50
22ms
average 22.4 ms
Latency p99
29ms
max 53 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **4,373** · 2 : **4,052** req/s · spread 7.6 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.5 vCPU**, **84 MB** RSS (+ 12 MB in swap) · MongoDB **0.0 vCPU** · MySQL **0.3 vCPU** · sandboxes **0.0 vCPU**, **74 MB** · whole server busy **100 %**, of which kernel (network, disk) **38 %** · memory used **769 MB** of 962 MB · steal **0 %** · swap **4** pages moved
autocannon · MySQL · get all by stream, public · round 1 of 2, the closer to the average
### Get all by stream : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,577 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
2,548
38,640 requests in 15 s
Latency p50
39ms
average 38.3 ms
Latency p99
54ms
max 80 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **2,577** · 2 : **2,519** req/s · spread 2.3 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.4 vCPU**, **101 MB** RSS · MongoDB **0.4 vCPU** · sandboxes **0.0 vCPU**, **61 MB** · whole server busy **100 %**, of which kernel (network, disk) **29 %** · memory used **690 MB** of 962 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all by stream, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
3,461
50,678 requests in 15 s
Latency p50
29ms
average 29.1 ms
Latency p99
37ms
max 52 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,379** · 2 : **3,542** req/s · spread 4.7 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.5 vCPU**, **97 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.3 vCPU** · sandboxes **0.0 vCPU**, **52 MB** · whole server busy **100 %**, of which kernel (network, disk) **34 %** · memory used **730 MB** of 962 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all by stream, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
3,662
55,776 requests in 15 s
Latency p50
26ms
average 26.4 ms
Latency p99
34ms
max 52 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,719** · 2 : **3,605** req/s · spread 3.1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.5 vCPU**, **84 MB** RSS (+ 12 MB in swap) · MongoDB **0.0 vCPU** · MySQL **0.3 vCPU** · sandboxes **0.0 vCPU**, **75 MB** · whole server busy **100 %**, of which kernel (network, disk) **35 %** · memory used **773 MB** of 962 MB · steal **0 %** · swap **20** pages moved
autocannon · MySQL · get all by stream, both tokens · round 1 of 2, the closer to the average
## Custom API calling get all
A custom API written in TypeScript, `return await g.sys.db.getAll({ instance, database, collection })`. This code is *lean* : it only reads what it is handed and asks `g.sys` for a read, so API Maker runs it in the server itself, with QuickJS, on the thread which answers the request, and the request never leaves the server. Code which needs more (a package, the time of the machine, `g.shared`, …) runs in the sandbox of the account : see the next API. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/custom-apis/user-created-custom-api.html).
**The custom API (public : customers_public ; both tokens : customers)**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
return await g.sys.db.getAll({ instance: 'mongodb', database: 'am_bench', collection: 'customers_public' });
}
module.exports = main;
```
### Custom API calling get all : public
No token : the API is public. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
1,909
28,756 requests in 15 s
Latency p50
53ms
average 51.6 ms
Latency p99
69ms
max 96 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **1,917** · 2 : **1,901** req/s · spread 0.9 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.6 vCPU**, **108 MB** RSS · MongoDB **0.3 vCPU** · sandboxes **0.0 vCPU**, **61 MB** · whole server busy **100 %**, of which kernel (network, disk) **23 %** · memory used **695 MB** of 962 MB · steal **0 %** · swap not touched
autocannon · MongoDB · custom api calling get all, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
2,178
32,318 requests in 15 s
Latency p50
46ms
average 45.9 ms
Latency p99
57ms
max 84 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **2,155** · 2 : **2,201** req/s · spread 2.1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.7 vCPU**, **104 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.2 vCPU** · sandboxes **0.0 vCPU**, **52 MB** · whole server busy **100 %**, of which kernel (network, disk) **23 %** · memory used **734 MB** of 961 MB · steal **0 %** · swap **3219** pages moved
autocannon · PostgreSQL · custom api calling get all, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
2,419
36,218 requests in 15 s
Latency p50
41ms
average 40.9 ms
Latency p99
51ms
max 68 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **2,415** · 2 : **2,423** req/s · spread 0.3 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.7 vCPU**, **88 MB** RSS (+ 20 MB in swap) · MongoDB **0.0 vCPU** · MySQL **0.2 vCPU** · sandboxes **0.0 vCPU**, **53 MB** · whole server busy **100 %**, of which kernel (network, disk) **25 %** · memory used **770 MB** of 962 MB · steal **0 %** · swap **2601** pages moved
autocannon · MySQL · custom api calling get all, public · round 1 of 2, the closer to the average
### Custom API calling get all : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
1,699
24,489 requests in 15 s
Latency p50
61ms
average 60.7 ms
Latency p99
125ms
max 157 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **1,633** · 2 : **1,766** req/s · spread 7.8 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.6 vCPU**, **111 MB** RSS · MongoDB **0.3 vCPU** · sandboxes **0.0 vCPU**, **61 MB** · whole server busy **100 %**, of which kernel (network, disk) **23 %** · memory used **699 MB** of 962 MB · steal **0 %** · swap not touched
autocannon · MongoDB · custom api calling get all, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
2,016
31,030 requests in 15 s
Latency p50
48ms
average 47.8 ms
Latency p99
57ms
max 76 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **1,964** · 2 : **2,069** req/s · spread 5.2 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **0.7 vCPU**, **99 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.2 vCPU** · sandboxes **0.0 vCPU**, **188 MB** · whole server busy **100 %**, of which kernel (network, disk) **22 %** · memory used **769 MB** of 961 MB · steal **0 %** · swap **23** pages moved
autocannon · PostgreSQL · custom api calling get all, both tokens · round 2 of 2, the closer to the average
**MySQL**
Requests / second
2,231
33,315 requests in 15 s
Latency p50
44ms
average 44.5 ms
Latency p99
53ms
max 68 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **2,222** · 2 : **2,240** req/s · spread 0.8 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.7 vCPU**, **85 MB** RSS (+ 20 MB in swap) · MongoDB **0.0 vCPU** · MySQL **0.2 vCPU** · sandboxes **0.0 vCPU**, **53 MB** · whole server busy **100 %**, of which kernel (network, disk) **24 %** · memory used **762 MB** of 962 MB · steal **0 %** · swap **1** pages moved
autocannon · MySQL · custom api calling get all, both tokens · round 1 of 2, the closer to the average
## Custom API in the sandbox
The same custom API, with one line more : it reads `Date.now()`, the time of the machine, which lean code may not. So this code runs in a sandbox of the account (a container with Node.js 24) : the request goes from API Maker to a runner of the sandbox and back, and the rows are read from inside the sandbox by the core of API Maker loaded there. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/custom-apis/user-created-custom-api.html).
**The custom API which runs in the sandbox**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
const started = Date.now(); // the time of the machine : this code runs in the sandbox of the account
return await g.sys.db.getAll({ instance: 'mongodb', database: 'am_bench', collection: 'customers_public' });
}
module.exports = main;
```
No token : the API is public. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
1,389
20,704 requests in 15 s
Latency p50
75ms
average 71.8 ms
Latency p99
97ms
max 126 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **1,380** · 2 : **1,397** req/s · spread 1.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.2 vCPU**, **104 MB** RSS · MongoDB **0.3 vCPU** · sandboxes **0.5 vCPU**, **204 MB** · whole server busy **100 %**, of which kernel (network, disk) **22 %** · memory used **807 MB** of 961 MB · steal **0 %** · swap **2180** pages moved
autocannon · MongoDB · custom api in the sandbox, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
1,871
27,550 requests in 15 s
Latency p50
52ms
average 53.9 ms
Latency p99
100ms
max 151 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **1,837** · 2 : **1,905** req/s · spread 3.6 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.2 vCPU**, **99 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.2 vCPU** · sandboxes **0.4 vCPU**, **179 MB** · whole server busy **100 %**, of which kernel (network, disk) **24 %** · memory used **765 MB** of 962 MB · steal **0 %** · swap **7252** pages moved
autocannon · PostgreSQL · custom api in the sandbox, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
2,170
33,456 requests in 15 s
Latency p50
43ms
average 44.3 ms
Latency p99
70ms
max 91 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **2,231** · 2 : **2,109** req/s · spread 5.6 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.3 vCPU**, **73 MB** RSS (+ 28 MB in swap) · MongoDB **0.0 vCPU** · MySQL **0.2 vCPU** · sandboxes **0.4 vCPU**, **155 MB** · whole server busy **100 %**, of which kernel (network, disk) **26 %** · memory used **752 MB** of 961 MB · steal **0 %** · swap **7405** pages moved
autocannon · MySQL · custom api in the sandbox, public · round 1 of 2, the closer to the average
## Get all with a pre hook
Get all, with both tokens, on a table whose get all API has a pre hook written in TypeScript : before the API, the hook runs (lean code : in the server, with QuickJS), reads the signed-in person from `x-am-user-authorization` and keeps the rows of their country (`g.req.query.find`), the row scoping most applications need. Every row of the dataset is in India, as the person is, so the answer is the same ten rows. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/hooks/preHook-api.html).
**The pre hook of SCHEMA_GET_ALL on customers_pre_hook**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
if (!g.req.isApiRequestFromUser) return;
const person = g.req.auth.authAMDB; // the person, from x-am-user-authorization
if (!person) throw [{ code: T.EStatusCode.UNAUTHORIZED, message: 'Sign in first.' }];
const find = g.req.query.find ? (typeof g.req.query.find === 'string' ? JSON.parse(g.req.query.find) : g.req.query.find) : {};
g.req.query.find = { $and: [find, { country: person.country }] };
}
module.exports = main;
```
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
1,984
29,638 requests in 15 s
Latency p50
52ms
average 50.1 ms
Latency p99
66ms
max 79 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **1,991** · 2 : **1,976** req/s · spread 0.8 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **0.5 vCPU**, **103 MB** RSS (+ 1 MB in swap) · MongoDB **0.4 vCPU** · sandboxes **0.0 vCPU**, **112 MB** · whole server busy **100 %**, of which kernel (network, disk) **25 %** · memory used **717 MB** of 962 MB · steal **0 %** · swap **1** pages moved
autocannon · MongoDB · get all with a pre hook, both tokens · round 2 of 2, the closer to the average
**PostgreSQL**
Requests / second
2,318
34,706 requests in 15 s
Latency p50
42ms
average 42.7 ms
Latency p99
53ms
max 68 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **2,314** · 2 : **2,321** req/s · spread 0.3 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.6 vCPU**, **99 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.3 vCPU** · sandboxes **0.0 vCPU**, **179 MB** · whole server busy **100 %**, of which kernel (network, disk) **25 %** · memory used **765 MB** of 962 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all with a pre hook, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
2,688
40,026 requests in 15 s
Latency p50
37ms
average 37.0 ms
Latency p99
47ms
max 67 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **2,669** · 2 : **2,707** req/s · spread 1.4 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.6 vCPU**, **74 MB** RSS (+ 28 MB in swap) · MongoDB **0.0 vCPU** · MySQL **0.2 vCPU** · sandboxes **0.0 vCPU**, **155 MB** · whole server busy **100 %**, of which kernel (network, disk) **25 %** · memory used **749 MB** of 961 MB · steal **0 %** · swap **550** pages moved
autocannon · MySQL · get all with a pre hook, both tokens · round 1 of 2, the closer to the average
## Get by id
One row by its primary key : `GET …/
/get-by-id/`. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/schema-apis/auto-generated-schema-based-get-by-id-api.html).
### Get by id : public
No token : the API is public. Each answer : 278 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
3,100
46,704 requests in 15 s
Latency p50
31ms
average 31.6 ms
Latency p99
37ms
max 55 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,114** · 2 : **3,085** req/s · spread 0.9 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.4 vCPU**, **101 MB** RSS (+ 1 MB in swap) · MongoDB **0.4 vCPU** · sandboxes **0.0 vCPU**, **201 MB** · whole server busy **100 %**, of which kernel (network, disk) **33 %** · memory used **797 MB** of 961 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get by id, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
4,105
61,466 requests in 15 s
Latency p50
24ms
average 23.9 ms
Latency p99
31ms
max 47 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **4,099** · 2 : **4,112** req/s · spread 0.3 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.4 vCPU**, **98 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.4 vCPU** · sandboxes **0.0 vCPU**, **179 MB** · whole server busy **100 %**, of which kernel (network, disk) **34 %** · memory used **765 MB** of 961 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get by id, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
5,090
76,966 requests in 15 s
Latency p50
19ms
average 19.0 ms
Latency p99
25ms
max 56 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **5,132** · 2 : **5,048** req/s · spread 1.6 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.5 vCPU**, **73 MB** RSS (+ 28 MB in swap) · MongoDB **0.0 vCPU** · MySQL **0.3 vCPU** · sandboxes **0.0 vCPU**, **155 MB** · whole server busy **100 %**, of which kernel (network, disk) **39 %** · memory used **740 MB** of 961 MB · steal **0 %** · swap **2** pages moved
autocannon · MySQL · get by id, public · round 1 of 2, the closer to the average
### Get by id : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 278 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
3,044
45,922 requests in 15 s
Latency p50
33ms
average 32.1 ms
Latency p99
44ms
max 64 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,062** · 2 : **3,025** req/s · spread 1.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.5 vCPU**, **101 MB** RSS (+ 1 MB in swap) · MongoDB **0.4 vCPU** · sandboxes **0.0 vCPU**, **112 MB** · whole server busy **100 %**, of which kernel (network, disk) **29 %** · memory used **747 MB** of 962 MB · steal **0 %** · swap **13** pages moved
autocannon · MongoDB · get by id, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
3,887
58,517 requests in 15 s
Latency p50
25ms
average 25.1 ms
Latency p99
32ms
max 54 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,871** · 2 : **3,902** req/s · spread 0.8 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **0.4 vCPU**, **100 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.4 vCPU** · sandboxes **0.0 vCPU**, **131 MB** · whole server busy **100 %**, of which kernel (network, disk) **33 %** · memory used **728 MB** of 961 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get by id, both tokens · round 2 of 2, the closer to the average
**MySQL**
Requests / second
4,526
67,876 requests in 15 s
Latency p50
21ms
average 21.6 ms
Latency p99
28ms
max 56 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **4,525** · 2 : **4,527** req/s · spread 0 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.5 vCPU**, **74 MB** RSS (+ 28 MB in swap) · MongoDB **0.0 vCPU** · MySQL **0.3 vCPU** · sandboxes **0.0 vCPU**, **155 MB** · whole server busy **100 %**, of which kernel (network, disk) **36 %** · memory used **740 MB** of 961 MB · steal **0 %** · swap not touched
autocannon · MySQL · get by id, both tokens · round 1 of 2, the closer to the average
## Get by id with caching
One row by its primary key, on a table with `enableCaching: true` : answered from Redis after the first request. [About this API](https://docs.apimaker.dev/v4/docs/features/automatic-caching.html).
### Get by id with caching : public
No token : the API is public. Each answer : 278 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
12,140
185,403 requests in 15 s
Latency p50
7ms
average 7.6 ms
Latency p99
12ms
max 44 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **11,918** · 2 : **12,361** req/s · spread 3.6 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **0.7 vCPU**, **99 MB** RSS (+ 1 MB in swap) · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **112 MB** · Redis **0.1 vCPU** · whole server busy **100 %**, of which kernel (network, disk) **43 %** · memory used **711 MB** of 962 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get by id with caching, public · round 2 of 2, the closer to the average
**PostgreSQL**
Requests / second
12,083
182,365 requests in 15 s
Latency p50
8ms
average 7.7 ms
Latency p99
12ms
max 57 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **12,159** · 2 : **12,008** req/s · spread 1.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.7 vCPU**, **99 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **132 MB** · Redis **0.1 vCPU** · whole server busy **100 %**, of which kernel (network, disk) **44 %** · memory used **712 MB** of 962 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get by id with caching, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
12,193
182,382 requests in 15 s
Latency p50
8ms
average 7.7 ms
Latency p99
12ms
max 42 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **12,226** · 2 : **12,159** req/s · spread 0.6 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **0.7 vCPU**, **50 MB** RSS (+ 48 MB in swap) · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **160 MB** · Redis **0.1 vCPU** · whole server busy **100 %**, of which kernel (network, disk) **45 %** · memory used **684 MB** of 961 MB · steal **0 %** · swap **7** pages moved
autocannon · MySQL · get by id with caching, public · round 2 of 2, the closer to the average
### Get by id with caching : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 278 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
9,481
141,083 requests in 15 s
Latency p50
10ms
average 10.1 ms
Latency p99
16ms
max 42 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **9,405** · 2 : **9,557** req/s · spread 1.6 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.8 vCPU**, **99 MB** RSS (+ 1 MB in swap) · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **112 MB** · Redis **0.1 vCPU** · whole server busy **100 %**, of which kernel (network, disk) **37 %** · memory used **718 MB** of 962 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get by id with caching, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
9,402
141,345 requests in 15 s
Latency p50
10ms
average 10.1 ms
Latency p99
16ms
max 46 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **9,424** · 2 : **9,380** req/s · spread 0.5 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.8 vCPU**, **99 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **132 MB** · Redis **0.1 vCPU** · whole server busy **100 %**, of which kernel (network, disk) **37 %** · memory used **713 MB** of 961 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get by id with caching, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
9,217
137,702 requests in 15 s
Latency p50
10ms
average 10.4 ms
Latency p99
16ms
max 45 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **9,254** · 2 : **9,181** req/s · spread 0.8 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **0.8 vCPU**, **50 MB** RSS (+ 48 MB in swap) · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **151 MB** · Redis **0.1 vCPU** · whole server busy **100 %**, of which kernel (network, disk) **38 %** · memory used **687 MB** of 961 MB · steal **0 %** · swap **1** pages moved
autocannon · MySQL · get by id with caching, both tokens · round 2 of 2, the closer to the average
## Insert one row
`POST …/
/save-single-or-multiple` with one row of 9 columns in the body : the schema checks and converts it, the database writes it, and the saved row is answered. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/schema-apis/auto-generated-schema-based-save-single-or-multiple-api.html).
No token : the API is public. Each answer : 277 bytes (MongoDB), status 201.
**MongoDB**
Requests / second
1,156
17,847 requests in 15 s
Latency p50
83ms
average 83.3 ms
Latency p99
110ms
max 271 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **1,190** · 2 : **1,122** req/s · spread 5.9 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.3 vCPU**, **102 MB** RSS (+ 1 MB in swap) · MongoDB **0.5 vCPU** · sandboxes **0.0 vCPU**, **110 MB** · whole server busy **100 %**, of which kernel (network, disk) **30 %** · memory used **705 MB** of 961 MB · steal **0 %** · swap **232** pages moved
autocannon · MongoDB · insert one row, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
1,818
27,416 requests in 15 s
Latency p50
54ms
average 54.1 ms
Latency p99
64ms
max 81 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **1,828** · 2 : **1,808** req/s · spread 1.1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.4 vCPU**, **100 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.5 vCPU** · sandboxes **0.0 vCPU**, **130 MB** · whole server busy **100 %**, of which kernel (network, disk) **35 %** · memory used **715 MB** of 962 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · insert one row, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
1,651
24,941 requests in 15 s
Latency p50
59ms
average 59.6 ms
Latency p99
71ms
max 86 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **1,640** · 2 : **1,663** req/s · spread 1.4 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **0.4 vCPU**, **52 MB** RSS (+ 48 MB in swap) · MongoDB **0.0 vCPU** · MySQL **0.4 vCPU** · sandboxes **0.0 vCPU**, **150 MB** · whole server busy **100 %**, of which kernel (network, disk) **44 %** · memory used **686 MB** of 961 MB · steal **0 %** · swap **3725** pages moved
autocannon · MySQL · insert one row, public · round 2 of 2, the closer to the average
## Custom API without a database
A public custom API whose code returns a small object and reads no database : what running code of the account costs, without a database. Lean code runs in the server itself, with QuickJS ; the same code with `Date.now()` in it runs in a sandbox of the account : the trip from API Maker to the runner in its container and back.
**In the server (lean code)**
**The custom API**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
return { message: 'Hello from API Maker', time: 1 };
}
module.exports = main;
```
Requests / second
8,096
120,920 requests in 15 s
Latency p50
12ms
average 12.0 ms
Latency p99
18ms
max 70 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **8,063** · 2 : **8,129** req/s · spread 0.8 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.0 vCPU**, **93 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **162 MB** · whole server busy **100 %**, of which kernel (network, disk) **25 %** · memory used **704 MB** of 962 MB · steal **0 %** · swap not touched
autocannon · custom API without a database, in the server (lean code) · round 1 of 2, the closer to the average
**In the sandbox**
**The custom API**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
return { message: 'Hello from the sandbox', time: Date.now() };
}
module.exports = main;
```
Requests / second
9,258
135,661 requests in 15 s
Latency p50
11ms
average 10.6 ms
Latency p99
17ms
max 54 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **9,045** · 2 : **9,470** req/s · spread 4.6 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.7 vCPU**, **96 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.3 vCPU**, **163 MB** · whole server busy **100 %**, of which kernel (network, disk) **26 %** · memory used **714 MB** of 962 MB · steal **0 %** · swap not touched
autocannon · custom API without a database, in the sandbox · round 1 of 2, the closer to the average
## More connections
*Get all, public* and *Get by id with caching, public* on MongoDB, one run of 15 seconds for each number of connections. More clients at once wait longer for their answer, and the server keeps answering them all.
### Get all, public, by connections
**Get all, public, MongoDB : requests per second by connections**
10 connectionsp50 3 ms · p99 7 ms · 2,634
50 connectionsp50 19 ms · p99 24 ms · 2,566
100 connectionsp50 39 ms · p99 45 ms · 2,510
250 connectionsp50 97 ms · p99 108 ms · 2,549
500 connectionsp50 208 ms · p99 226 ms · 2,373
1,000 connectionsp50 413 ms · p99 441 ms · 2,395
| Connections | Requests / second | p50 | p99 | Max | Errors | Server busy | API Maker RSS |
|--:|--:|--:|--:|--:|--:|--:|--:|
| 10 | **2,634** | 3 ms | 7 ms | 14 ms | 0 | 100 % | 91 MB |
| 50 | **2,566** | 19 ms | 24 ms | 33 ms | 0 | 100 % | 93 MB |
| 100 | **2,510** | 39 ms | 45 ms | 70 ms | 0 | 100 % | 96 MB |
| 250 | **2,549** | 97 ms | 108 ms | 398 ms | 0 | 100 % | 107 MB |
| 500 | **2,373** | 208 ms | 226 ms | 458 ms | 0 | 100 % | 117 MB |
| 1,000 | **2,395** | 413 ms | 441 ms | 616 ms | 0 | 100 % | 146 MB |
### Get by id with caching, public, by connections
**Get by id with caching, public, MongoDB : requests per second by connections**
10 connectionsp50 1 ms · p99 2 ms · 8,594
50 connectionsp50 4 ms · p99 7 ms · 11,240
100 connectionsp50 8 ms · p99 12 ms · 12,096
250 connectionsp50 16 ms · p99 23 ms · 15,248
500 connectionsp50 34 ms · p99 51 ms · 13,336
1,000 connectionsp50 86 ms · p99 105 ms · 11,399
| Connections | Requests / second | p50 | p99 | Max | Errors | Server busy | API Maker RSS |
|--:|--:|--:|--:|--:|--:|--:|--:|
| 10 | **8,594** | 1 ms | 2 ms | 9 ms | 0 | 99 % | 88 MB |
| 50 | **11,240** | 4 ms | 7 ms | 20 ms | 0 | 100 % | 83 MB |
| 100 | **12,096** | 8 ms | 12 ms | 76 ms | 0 | 100 % | 85 MB |
| 250 | **15,248** | 16 ms | 23 ms | 62 ms | 0 | 100 % | 91 MB |
| 500 | **13,336** | 34 ms | 51 ms | 165 ms | 0 | 100 % | 103 MB |
| 1,000 | **11,399** | 86 ms | 105 ms | 221 ms | 0 | 100 % | 126 MB |
## Questions
### How many requests per second can API Maker serve on 1 shared vCPU ?
On this 1 GB server, with the database on the same machine : 2,435 requests per second for a whole table of ten rows on MongoDB (PostgreSQL 3,787 · MySQL 4,623), 3,100 for one row by its id, and 12,140 when the answer is cached in Redis. A custom API in TypeScript which reads the table answers 1,909 requests per second when API Maker runs it itself (lean code), 1,389 when it runs in the sandbox of the account.
### How much memory does API Maker use ?
The API Maker process held 84 MB at rest and 111 MB at most under load on this server, in RAM. With the server short of memory, Linux moved up to 50 MB more of it to swap : memory API Maker holds but does not touch while it serves requests. The rest of the memory went to the databases (MongoDB, Redis, PostgreSQL or MySQL), the sandboxes which run the code of the account, and Linux itself.
### Do the two tokens slow the APIs down ?
API Maker checks both tokens (x-am-authorization and x-am-user-authorization) and the groups of the API user on every request. Get all with both tokens answered 2,439 requests per second on MongoDB (public : 2,435), 3,560 requests per second on PostgreSQL (public : 3,787), 4,126 requests per second on MySQL (public : 4,623). The checks show most where the database does no work : a cached get all answered 8,709 requests per second with both tokens against 11,054 public on MongoDB.
### What does a pre hook cost ?
A pre hook runs code of the account before the API ; a lean hook like this one runs in the server itself, with QuickJS. Get all with a row scoping pre hook answered 1,984 requests per second on MongoDB, against 2,439 for the same API without the hook. On 1 vCPU, the API, the hook and the database share the same core.
### Can I run these benchmarks myself ?
Yes : [How API Maker is benchmarked](https://docs.apimaker.dev/v4/docs/benchmarks/methodology.html) gives the dataset, the settings of every API and the exact autocannon commands.
---
# API Maker benchmark : 2 vCPU, 4 GB RAM (Linode shared CPU)
> API Maker on 2 shared vCPUs, 4 GB (Linode) : 4,692 req/s get all, 18,970 cached, on MongoDB, PostgreSQL and MySQL, with memory and autocannon output.
Source: https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html
Benchmark · Linode (Akamai Cloud) · Shared CPU · 12 October 2026
**2 vCPU, 4 GB RAM : 4,692 to 6,660 requests per second for a whole table.**
API Maker 4.0.0 on a Linode 4 GB (g6-standard-2) : 2 shared vCPUs and 4 GB of RAM at $24 a month, its databases on the same machine. Every API was loaded for 15 seconds by autocannon from a second server, two times, on MongoDB, PostgreSQL and MySQL, public and with two tokens, while the server sampled the memory and CPU of every part each second.
Get all · MongoDB
4,692req/s
PostgreSQL 5,577 · MySQL 6,660
Get by id, cached
18,970req/s
answered from Redis · PostgreSQL 19,622 · MySQL 19,858
Custom API · MongoDB
3,178req/s
TypeScript, lean : run in the server · in the sandbox 3,015
API Maker memory
101MB
at rest · 125 MB at most under load
## The server
| | |
|---|---|
| Server | Linode (Akamai Cloud), Linode 4 GB (g6-standard-2), shared cpu, $24 / month |
| CPU | AMD EPYC 7642 48-Core Processor, 2 shared vCPUs (KVM) KVM guest, 1 thread per core · L1d 128 KiB (2 instances) · L2 1 MiB (2 instances) · L3 32 MiB (2 instances) · BogoMIPS 4600.00 |
| Memory | 4 GB (3,915 MB usable), swap 4.3 GB (496 MB of Linode + 3.8 GB made by the installer) |
| Disk, region | 80 GB SSD, Mumbai, India (ap-west) |
| System | Ubuntu 24.04.4 LTS, Linux 6.8.0-134, Docker 29.9.0 |
| API Maker | 4.0.0 : release build of api_maker_be_rust 864bb64 (opt-level 3, fat LTO), installed by its installer (https://apimaker.dev/v4/install.sh), no reverse proxy |
| Settings | the defaults of the installer (lean code of the account runs in the server with QuickJS : sandbox.codeInServer), and the sandboxes kept running for the whole run (removeSandboxInactiveSinceMinutes 1440) |
| Databases | MongoDB 8.0.10 (the MongoDB of API Maker, a replica set of one member, in Docker) · Redis 7.0.5 (the Redis of API Maker, in Docker) · PostgreSQL 18.6 (official image postgres:18, max_connections 500) · MySQL 8.4.11 (official image mysql:8.4, max_connections 500) : all on the same server |
| Sandboxes | TypeScript on Node.js 24.21.0 (an image of 403 MB built by API Maker), 2 sandboxes of the account (sandboxCountForAdmin 2, the default), each opening up to 2 runners when it is busy (one per vCPU) |
| Load generator | Dedicated 16 GB (g6-dedicated-8) : AMD EPYC 7713 64-Core Processor, 8 dedicated vCPUs, Ubuntu 24.04.4 LTS, Node.js 24.21.0, autocannon 8.0.0 with 5 worker threads |
| Network | Private network of the same data centre, round trip 0.36 ms (ping) |
| Host | A strict anti-affinity placement group kept the three shared CPU servers (2, 4 and 8 vCPUs) on three different hosts. All seven servers were measured at the same time, each by a load generator of its own. |
| Date | 12 October 2026, 05:30 to 06:44 UTC |
Only what a database needs was running while it was measured : API Maker and its two sandboxes, its MongoDB and Redis (API Maker always needs them) and the database under test. The other benchmark databases were stopped, API Maker was restarted and the swap emptied back into memory before each database, when it fitted there. How every number was taken : [How API Maker is benchmarked](https://docs.apimaker.dev/v4/docs/benchmarks/methodology.html). Every server side by side : [All results](https://docs.apimaker.dev/v4/docs/benchmarks/summary.html).
## The data
Every table holds the ten rows of the [API Maker benchmark dataset](https://apimaker.dev/json/benchmark_dataset.json) : `https://apimaker.dev/json/benchmark_dataset.json`. Ten customers, ten columns each ; a *get all* answers all ten (2,418 bytes of JSON on MongoDB), a *get by id* one of them.
| `_id` | `customer_id` | `first_name` | `last_name` | `phone` | `last_update` | `pincode` | `shipping_id` | `dob` | `country` |
|---|---|---|---|---|---|---|---|---|---|
| 60ae2488c37cd955cc144161 | 2 | NICK | WAHLBERG | 1123456789 | 2006-02-15T04:34:00.330Z | 111111 | 2 | 2022-10-30T03:25:03.000Z | India |
| 60ae24c8c37cd955cc144162 | 1 | PENELOPE | GUINESS | 123456789 | 2006-02-15T04:34:00.330Z | 100050 | 1 | 2022-10-30T03:25:03.000Z | India |
| 60ae247ac37cd955cc144160 | 3 | ED | CHASE | 2123456789 | 2006-02-15T04:34:00.330Z | 222222 | 3 | 2022-10-30T03:25:03.000Z | India |
| 60ace1401efc56684403c68c | 4 | JENNIFER | DAVIS | 3123456789 | 2006-02-15T04:34:00.330Z | 100050 | 4 | 2022-10-30T03:25:03.000Z | India |
| 60accda51efc56684403c685 | 5 | JOHNNY | LOLLOBRIGIDA | 4123456789 | 2006-02-15T04:34:00.330Z | 485125 | 1 | 2022-10-30T03:25:03.000Z | India |
| 606b7d364bebce00196eade7 | 6 | JOHNNY | LOLLOBRIGIDA | 5123456789 | 2006-02-15T04:34:00.330Z | 123456 | 2 | 2022-10-30T03:25:03.000Z | India |
| 606b75961055000018fa9d98 | 7 | GRACE | MOSTEL | 6123456789 | 2006-02-15T04:34:00.330Z | 356589 | 3 | 2022-10-30T03:25:03.000Z | India |
| 6064dd02730026001956663e | 8 | MATTHEW | JOHANSSON | 7123456789 | 2006-02-15T04:34:00.330Z | 100050 | 4 | 2022-10-30T03:25:03.000Z | India |
| 6064dcb8730026001956663c | 9 | JOE | SWANK | 8123456789 | 2006-02-15T04:34:00.330Z | 251415 | 1 | 2022-10-30T03:25:03.000Z | India |
| 6064c4c02bafb90018955299 | 10 | CHRISTIAN | GABLE | 9123456789 | 2006-02-15T04:34:00.330Z | 100050 | | 2022-10-30T03:25:03.000Z | India |
## Results at a glance
Requests per second, the average of two rounds of 15 seconds with 100 connections. *Public* APIs need no token ; *both tokens* means every request carries `x-am-authorization` (the token of an API user, whose groups decide what it may call) and `x-am-user-authorization` (the token of a row of the `customers` table, made by a DB token generator), and API Maker checks both.
**Requests per second · 2 vCPU, 4 GB RAM, shared CPU** · MongoDB · PostgreSQL · MySQL
Get allpublic · 4,692 · 5,577 · 6,660
Get allboth tokens · 4,425 · 5,290 · 5,902
Get all with cachingpublic · 18,195 · 17,836 · 18,227
Get all with cachingboth tokens · 14,144 · 14,083 · 13,394
Get all by streampublic · 4,548 · 5,866 · 5,815
Get all by streamboth tokens · 4,297 · 5,189 · 5,317
Custom API calling get all QuickJS · public · 3,178 · 3,806 · 4,090
Custom API calling get all QuickJS · both tokens · 2,957 · 3,461 · 3,666
Custom API in the sandbox Sandbox · public · 3,015 · 3,423 · 3,834
Get all with a pre hook QuickJS · both tokens · 3,339 · 3,884 · 4,389
Get by idpublic · 5,397 · 6,325 · 7,155
Get by idboth tokens · 4,947 · 5,739 · 6,551
Get by id with cachingpublic · 18,970 · 19,622 · 19,858
Get by id with cachingboth tokens · 14,695 · 14,989 · 15,385
Insert one rowpublic · 2,352 · 3,021 · 2,371
| API | Access | MongoDB | PostgreSQL | MySQL |
|---|---|--:|--:|--:|
| [Get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-all) | Public | **4,692** p99 40 ms | **5,577** p99 22 ms | **6,660** p99 17 ms |
| [Get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-all) | Both tokens | **4,425** p99 38 ms | **5,290** p99 22 ms | **5,902** p99 20 ms |
| [Get all with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-all-with-caching) | Public | **18,195** p99 8 ms | **17,836** p99 8 ms | **18,227** p99 8 ms |
| [Get all with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-all-with-caching) | Both tokens | **14,144** p99 10 ms | **14,083** p99 12 ms | **13,394** p99 10 ms |
| [Get all by stream](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-all-by-stream) | Public | **4,548** p99 39 ms | **5,866** p99 20 ms | **5,815** p99 21 ms |
| [Get all by stream](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-all-by-stream) | Both tokens | **4,297** p99 39 ms | **5,189** p99 23 ms | **5,317** p99 22 ms |
| [Custom API calling get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#custom-api-calling-get-all) QuickJS | Public | **3,178** p99 50 ms | **3,806** p99 30 ms | **4,090** p99 28 ms |
| [Custom API calling get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#custom-api-calling-get-all) QuickJS | Both tokens | **2,957** p99 54 ms | **3,461** p99 32 ms | **3,666** p99 31 ms |
| [Custom API in the sandbox](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#custom-api-in-the-sandbox) Sandbox | Public | **3,015** p99 64 ms | **3,423** p99 51 ms | **3,834** p99 46 ms |
| [Get all with a pre hook](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-all-with-a-pre-hook) QuickJS | Both tokens | **3,339** p99 50 ms | **3,884** p99 31 ms | **4,389** p99 27 ms |
| [Get by id](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-by-id) | Public | **5,397** p99 33 ms | **6,325** p99 19 ms | **7,155** p99 16 ms |
| [Get by id](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-by-id) | Both tokens | **4,947** p99 35 ms | **5,739** p99 21 ms | **6,551** p99 19 ms |
| [Get by id with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-by-id-with-caching) | Public | **18,970** p99 8 ms | **19,622** p99 7 ms | **19,858** p99 7 ms |
| [Get by id with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#get-by-id-with-caching) | Both tokens | **14,695** p99 10 ms | **14,989** p99 10 ms | **15,385** p99 9 ms |
| [Insert one row](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#insert-one-row) | Public | **2,352** p99 83 ms | **3,021** p99 38 ms | **2,371** p99 49 ms |
| [Custom API without a database](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#custom-api-without-a-database) | Public | **14,731** p99 10 ms | | |
| [Custom API without a database, in the sandbox](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html#custom-api-without-a-database) | Public | **12,669** p99 12 ms | | |
(0 errors) Every one of the **13,338,901 requests** of these runs was answered with status 200 or 201 : no error, no timeout.
## Memory
What each part of the server held, in MB : at rest (the 60 seconds after API Maker and its sandboxes started, before any request) and under load. The bars show the second the whole server held the most memory while its database was loaded, out of the 3,915 MB of the server ; the table gives the most each part held on its own. API Maker is the resident memory of its process ; a container is counted the way `docker stats` counts it.
API Maker · MongoDB of API Maker · Redis · PostgreSQL / MySQL · Sandboxes · Linux, Docker, the rest · Available
MongoDB
at rest
under load
PostgreSQL
at rest
under load
MySQL
at rest
under load
| Part | MongoDB at rest → under load | PostgreSQL at rest → under load | MySQL at rest → under load |
|---|--:|--:|--:|
| **API Maker** (process), in RAM | 101 → **125** | 99 → **120** | 98 → **121** |
| … and in swap | 0 → **0** | 0 → **0** | 0 → **0** |
| MongoDB of API Maker, in RAM | 125 → **265** | 255 → **255** | 255 → **255** |
| … and in swap | 0 → **0** | 0 → **0** | 0 → **0** |
| Redis, in RAM | 3 → **4** | 3 → **3** | 3 → **3** |
| Database under test, in RAM | MongoDB above | 42 → **150** | 424 → **495** |
| … and in swap | MongoDB above | 0 → **0** | 0 → **0** |
| Sandboxes (2 containers), in RAM | 50 → **394** | 50 → **226** | 50 → **256** |
| … and in swap | 0 → **0** | 0 → **0** | 0 → **0** |
| **Whole server**, RAM used | 803 → **1321** | 1026 → **1297** | 1359 → **1658** |
| Swap used | 0 → **0** | 0 → **0** | 0 → **0** |
## CPU
On 2 vCPUs, API Maker, the database and the sandboxes share the same 2 vCPUs : every request costs the work of all of them. During *get all, public*, the CPU was split this way (average of the 15 seconds, in vCPUs : 2.0 is the whole server ; a process counts its own kernel time) :
| | MongoDB | PostgreSQL | MySQL |
|---|--:|--:|--:|
| API Maker | 0.8 vCPU | 1.0 vCPU | 1.0 vCPU |
| The database | 0.9 vCPU | 0.6 vCPU | 0.6 vCPU |
| MongoDB of API Maker (when it is not the one tested) | – | 0.0 vCPU | 0.0 vCPU |
| Sandboxes (idle : no code runs in get all) | 0.0 vCPU | 0.0 vCPU | 0.0 vCPU |
| Whole server busy (of its 2 vCPUs) | 100 % | 97 % | 97 % |
| … of which kernel time (network, disk), counted in the lines above too | 33 % | 37 % | 40 % |
Steal time (CPU the hypervisor gave to other servers) was 0 % on average, 1 % at most. The load generator, sampled the same way, was never more than 29 % busy over its 8 cores : it was never the limit.
## Get all
The schema API of a table answers all its rows : `GET /api/schema////
`. Every request reads the ten rows from the database, converts them with the schema of the table and sends them as JSON. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/schema-apis/auto-generated-schema-based-get-all-api.html).
### Get all : public
No token : the API is public. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
4,692
72,620 requests in 15 s
Latency p50
20ms
average 20.4 ms
Latency p99
40ms
max 973 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **4,842** · 2 : **4,543** req/s · spread 6.4 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.8 vCPU**, **114 MB** RSS · MongoDB **0.9 vCPU** · sandboxes **0.0 vCPU**, **50 MB** · whole server busy **100 %**, of which kernel (network, disk) **33 %** · memory used **854 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
5,577
81,663 requests in 15 s
Latency p50
18ms
average 17.9 ms
Latency p99
22ms
max 32 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **5,445** · 2 : **5,709** req/s · spread 4.7 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.0 vCPU**, **109 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.6 vCPU** · sandboxes **0.0 vCPU**, **50 MB** · whole server busy **97 %**, of which kernel (network, disk) **37 %** · memory used **1011 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
6,660
101,606 requests in 15 s
Latency p50
14ms
average 14.3 ms
Latency p99
17ms
max 30 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **6,774** · 2 : **6,545** req/s · spread 3.4 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.0 vCPU**, **108 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.6 vCPU** · sandboxes **0.0 vCPU**, **50 MB** · whole server busy **97 %**, of which kernel (network, disk) **40 %** · memory used **1372 MB** of 3915 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all, public · round 1 of 2, the closer to the average
### Get all : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
4,425
66,986 requests in 15 s
Latency p50
22ms
average 21.9 ms
Latency p99
38ms
max 82 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **4,466** · 2 : **4,384** req/s · spread 1.9 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.9 vCPU**, **115 MB** RSS · MongoDB **0.8 vCPU** · sandboxes **0.0 vCPU**, **50 MB** · whole server busy **100 %**, of which kernel (network, disk) **31 %** · memory used **873 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
5,290
79,428 requests in 15 s
Latency p50
18ms
average 18.4 ms
Latency p99
22ms
max 29 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **5,283** · 2 : **5,296** req/s · spread 0.2 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **1.1 vCPU**, **117 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.5 vCPU** · sandboxes **0.0 vCPU**, **226 MB** · whole server busy **98 %**, of which kernel (network, disk) **34 %** · memory used **1289 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all, both tokens · round 2 of 2, the closer to the average
**MySQL**
Requests / second
5,902
89,533 requests in 15 s
Latency p50
16ms
average 16.3 ms
Latency p99
20ms
max 30 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **5,835** · 2 : **5,970** req/s · spread 2.3 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **1.1 vCPU**, **117 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.5 vCPU** · sandboxes **0.0 vCPU**, **256 MB** · whole server busy **98 %**, of which kernel (network, disk) **37 %** · memory used **1639 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all, both tokens · round 2 of 2, the closer to the average
## Get all with caching
The same request on a table whose API settings say `enableCaching: true`. The first answer is kept in Redis, under a key made of who asks and what is asked ; the next requests are answered from Redis until the answer expires or something writes the table. [About this API](https://docs.apimaker.dev/v4/docs/features/automatic-caching.html).
### Get all with caching : public
No token : the API is public. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
18,195
275,330 requests in 15 s
Latency p50
5ms
average 5.0 ms
Latency p99
8ms
max 916 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **18,357** · 2 : **18,033** req/s · spread 1.8 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.7 vCPU**, **113 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **50 MB** · Redis **0.1 vCPU** · whole server busy **99 %**, of which kernel (network, disk) **38 %** · memory used **824 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all with caching, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
17,836
268,807 requests in 15 s
Latency p50
5ms
average 5.1 ms
Latency p99
8ms
max 21 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **17,923** · 2 : **17,750** req/s · spread 1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.7 vCPU**, **109 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **50 MB** · Redis **0.1 vCPU** · whole server busy **99 %**, of which kernel (network, disk) **37 %** · memory used **994 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all with caching, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
18,227
271,628 requests in 15 s
Latency p50
5ms
average 5.0 ms
Latency p99
8ms
max 37 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **18,345** · 2 : **18,109** req/s · spread 1.3 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **1.7 vCPU**, **116 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **256 MB** · Redis **0.1 vCPU** · whole server busy **99 %**, of which kernel (network, disk) **38 %** · memory used **1643 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all with caching, public · round 2 of 2, the closer to the average
### Get all with caching : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
14,144
211,670 requests in 15 s
Latency p50
7ms
average 6.6 ms
Latency p99
10ms
max 26 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **14,112** · 2 : **14,176** req/s · spread 0.5 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.7 vCPU**, **112 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **50 MB** · Redis **0.1 vCPU** · whole server busy **100 %**, of which kernel (network, disk) **30 %** · memory used **815 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all with caching, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
14,083
209,102 requests in 15 s
Latency p50
7ms
average 6.7 ms
Latency p99
12ms
max 25 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **13,940** · 2 : **14,225** req/s · spread 2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.7 vCPU**, **111 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **50 MB** · Redis **0.1 vCPU** · whole server busy **100 %**, of which kernel (network, disk) **31 %** · memory used **999 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all with caching, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
13,394
209,487 requests in 15 s
Latency p50
7ms
average 6.7 ms
Latency p99
10ms
max 25 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **12,821** · 2 : **13,967** req/s · spread 8.6 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **1.7 vCPU**, **116 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **256 MB** · Redis **0.1 vCPU** · whole server busy **100 %**, of which kernel (network, disk) **31 %** · memory used **1640 MB** of 3915 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all with caching, both tokens · round 2 of 2, the closer to the average
## Get all by stream
`GET …/
/stream` : the rows are sent while they are read from the database cursor, so a large table never sits whole in memory. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/schema-apis/auto-generated-schema-based-get-all-by-stream-api.html).
### Get all by stream : public
No token : the API is public. Each answer : 2,477 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
4,548
68,050 requests in 15 s
Latency p50
21ms
average 21.5 ms
Latency p99
39ms
max 104 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **4,538** · 2 : **4,559** req/s · spread 0.5 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.9 vCPU**, **117 MB** RSS · MongoDB **0.8 vCPU** · sandboxes **0.0 vCPU**, **50 MB** · whole server busy **100 %**, of which kernel (network, disk) **30 %** · memory used **840 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all by stream, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
5,866
87,861 requests in 15 s
Latency p50
17ms
average 16.6 ms
Latency p99
20ms
max 31 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **5,858** · 2 : **5,873** req/s · spread 0.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.9 vCPU**, **118 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.6 vCPU** · sandboxes **0.0 vCPU**, **50 MB** · whole server busy **97 %**, of which kernel (network, disk) **36 %** · memory used **1011 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all by stream, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
5,815
87,395 requests in 15 s
Latency p50
17ms
average 16.7 ms
Latency p99
21ms
max 29 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **5,827** · 2 : **5,803** req/s · spread 0.4 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.1 vCPU**, **110 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.5 vCPU** · sandboxes **0.0 vCPU**, **51 MB** · whole server busy **97 %**, of which kernel (network, disk) **37 %** · memory used **1385 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all by stream, public · round 1 of 2, the closer to the average
### Get all by stream : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,577 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
4,297
64,395 requests in 15 s
Latency p50
23ms
average 22.8 ms
Latency p99
39ms
max 83 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **4,294** · 2 : **4,300** req/s · spread 0.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.0 vCPU**, **118 MB** RSS · MongoDB **0.8 vCPU** · sandboxes **0.0 vCPU**, **50 MB** · whole server busy **100 %**, of which kernel (network, disk) **29 %** · memory used **844 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all by stream, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
5,189
76,903 requests in 15 s
Latency p50
19ms
average 19.0 ms
Latency p99
23ms
max 29 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **5,128** · 2 : **5,250** req/s · spread 2.4 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.0 vCPU**, **117 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.6 vCPU** · sandboxes **0.0 vCPU**, **50 MB** · whole server busy **98 %**, of which kernel (network, disk) **35 %** · memory used **1029 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all by stream, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
5,317
80,903 requests in 15 s
Latency p50
18ms
average 18.0 ms
Latency p99
22ms
max 29 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **5,240** · 2 : **5,394** req/s · spread 2.9 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **1.2 vCPU**, **117 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.5 vCPU** · sandboxes **0.0 vCPU**, **256 MB** · whole server busy **98 %**, of which kernel (network, disk) **35 %** · memory used **1647 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all by stream, both tokens · round 2 of 2, the closer to the average
## Custom API calling get all
A custom API written in TypeScript, `return await g.sys.db.getAll({ instance, database, collection })`. This code is *lean* : it only reads what it is handed and asks `g.sys` for a read, so API Maker runs it in the server itself, with QuickJS, on the thread which answers the request, and the request never leaves the server. Code which needs more (a package, the time of the machine, `g.shared`, …) runs in the sandbox of the account : see the next API. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/custom-apis/user-created-custom-api.html).
**The custom API (public : customers_public ; both tokens : customers)**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
return await g.sys.db.getAll({ instance: 'mongodb', database: 'am_bench', collection: 'customers_public' });
}
module.exports = main;
```
### Custom API calling get all : public
No token : the API is public. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
3,178
48,380 requests in 15 s
Latency p50
31ms
average 30.5 ms
Latency p99
50ms
max 72 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,226** · 2 : **3,129** req/s · spread 3 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.2 vCPU**, **122 MB** RSS · MongoDB **0.6 vCPU** · sandboxes **0.0 vCPU**, **50 MB** · whole server busy **100 %**, of which kernel (network, disk) **23 %** · memory used **857 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MongoDB · custom api calling get all, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
3,806
57,058 requests in 15 s
Latency p50
26ms
average 25.8 ms
Latency p99
30ms
max 43 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,804** · 2 : **3,809** req/s · spread 0.1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.3 vCPU**, **117 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.4 vCPU** · sandboxes **0.0 vCPU**, **50 MB** · whole server busy **100 %**, of which kernel (network, disk) **25 %** · memory used **1030 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · custom api calling get all, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
4,090
61,892 requests in 15 s
Latency p50
24ms
average 23.7 ms
Latency p99
28ms
max 36 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **4,127** · 2 : **4,052** req/s · spread 1.8 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.4 vCPU**, **116 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.3 vCPU** · sandboxes **0.0 vCPU**, **51 MB** · whole server busy **100 %**, of which kernel (network, disk) **27 %** · memory used **1392 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MySQL · custom api calling get all, public · round 1 of 2, the closer to the average
### Custom API calling get all : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
2,957
44,841 requests in 15 s
Latency p50
33ms
average 32.9 ms
Latency p99
54ms
max 89 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **2,990** · 2 : **2,924** req/s · spread 2.3 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.3 vCPU**, **123 MB** RSS · MongoDB **0.5 vCPU** · sandboxes **0.0 vCPU**, **51 MB** · whole server busy **100 %**, of which kernel (network, disk) **22 %** · memory used **872 MB** of 3915 MB · steal **0 %** · swap not touched
autocannon · MongoDB · custom api calling get all, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
3,461
52,752 requests in 15 s
Latency p50
28ms
average 27.9 ms
Latency p99
32ms
max 44 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,517** · 2 : **3,404** req/s · spread 3.3 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.4 vCPU**, **118 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.4 vCPU** · sandboxes **0.0 vCPU**, **51 MB** · whole server busy **100 %**, of which kernel (network, disk) **23 %** · memory used **1032 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · custom api calling get all, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
3,666
55,253 requests in 15 s
Latency p50
27ms
average 26.6 ms
Latency p99
31ms
max 41 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,648** · 2 : **3,684** req/s · spread 1 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **1.4 vCPU**, **119 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.3 vCPU** · sandboxes **0.0 vCPU**, **256 MB** · whole server busy **100 %**, of which kernel (network, disk) **24 %** · memory used **1635 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MySQL · custom api calling get all, both tokens · round 2 of 2, the closer to the average
## Custom API in the sandbox
The same custom API, with one line more : it reads `Date.now()`, the time of the machine, which lean code may not. So this code runs in a sandbox of the account (a container with Node.js 24) : the request goes from API Maker to a runner of the sandbox and back, and the rows are read from inside the sandbox by the core of API Maker loaded there. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/custom-apis/user-created-custom-api.html).
**The custom API which runs in the sandbox**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
const started = Date.now(); // the time of the machine : this code runs in the sandbox of the account
return await g.sys.db.getAll({ instance: 'mongodb', database: 'am_bench', collection: 'customers_public' });
}
module.exports = main;
```
No token : the API is public. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
3,015
46,302 requests in 15 s
Latency p50
31ms
average 31.8 ms
Latency p99
64ms
max 217 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,087** · 2 : **2,943** req/s · spread 4.8 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.5 vCPU**, **118 MB** RSS · MongoDB **0.6 vCPU** · sandboxes **0.9 vCPU**, **387 MB** · whole server busy **100 %**, of which kernel (network, disk) **22 %** · memory used **1229 MB** of 3915 MB · steal **0 %** · swap not touched
autocannon · MongoDB · custom api in the sandbox, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
3,423
51,323 requests in 15 s
Latency p50
28ms
average 28.7 ms
Latency p99
51ms
max 75 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,424** · 2 : **3,422** req/s · spread 0.1 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **0.5 vCPU**, **115 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.4 vCPU** · sandboxes **0.8 vCPU**, **219 MB** · whole server busy **100 %**, of which kernel (network, disk) **26 %** · memory used **1285 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · custom api in the sandbox, public · round 2 of 2, the closer to the average
**MySQL**
Requests / second
3,834
58,137 requests in 15 s
Latency p50
25ms
average 25.3 ms
Latency p99
46ms
max 80 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,876** · 2 : **3,792** req/s · spread 2.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.6 vCPU**, **112 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.3 vCPU** · sandboxes **0.8 vCPU**, **224 MB** · whole server busy **100 %**, of which kernel (network, disk) **28 %** · memory used **1589 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MySQL · custom api in the sandbox, public · round 1 of 2, the closer to the average
## Get all with a pre hook
Get all, with both tokens, on a table whose get all API has a pre hook written in TypeScript : before the API, the hook runs (lean code : in the server, with QuickJS), reads the signed-in person from `x-am-user-authorization` and keeps the rows of their country (`g.req.query.find`), the row scoping most applications need. Every row of the dataset is in India, as the person is, so the answer is the same ten rows. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/hooks/preHook-api.html).
**The pre hook of SCHEMA_GET_ALL on customers_pre_hook**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
if (!g.req.isApiRequestFromUser) return;
const person = g.req.auth.authAMDB; // the person, from x-am-user-authorization
if (!person) throw [{ code: T.EStatusCode.UNAUTHORIZED, message: 'Sign in first.' }];
const find = g.req.query.find ? (typeof g.req.query.find === 'string' ? JSON.parse(g.req.query.find) : g.req.query.find) : {};
g.req.query.find = { $and: [find, { country: person.country }] };
}
module.exports = main;
```
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
3,339
49,908 requests in 15 s
Latency p50
29ms
average 29.5 ms
Latency p99
50ms
max 107 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,328** · 2 : **3,350** req/s · spread 0.6 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.1 vCPU**, **121 MB** RSS · MongoDB **0.7 vCPU** · sandboxes **0.0 vCPU**, **393 MB** · whole server busy **100 %**, of which kernel (network, disk) **25 %** · memory used **1268 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all with a pre hook, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
3,884
58,349 requests in 15 s
Latency p50
25ms
average 25.2 ms
Latency p99
31ms
max 39 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,890** · 2 : **3,878** req/s · spread 0.3 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.2 vCPU**, **115 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.5 vCPU** · sandboxes **0.0 vCPU**, **214 MB** · whole server busy **99 %**, of which kernel (network, disk) **27 %** · memory used **1251 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all with a pre hook, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
4,389
65,180 requests in 15 s
Latency p50
22ms
average 22.5 ms
Latency p99
27ms
max 37 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **4,346** · 2 : **4,433** req/s · spread 2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.3 vCPU**, **114 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.4 vCPU** · sandboxes **0.0 vCPU**, **225 MB** · whole server busy **99 %**, of which kernel (network, disk) **28 %** · memory used **1603 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all with a pre hook, both tokens · round 1 of 2, the closer to the average
## Get by id
One row by its primary key : `GET …/
/get-by-id/`. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/schema-apis/auto-generated-schema-based-get-by-id-api.html).
### Get by id : public
No token : the API is public. Each answer : 278 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
5,397
80,537 requests in 15 s
Latency p50
18ms
average 18.1 ms
Latency p99
33ms
max 87 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **5,370** · 2 : **5,425** req/s · spread 1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.9 vCPU**, **120 MB** RSS · MongoDB **0.8 vCPU** · sandboxes **0.0 vCPU**, **392 MB** · whole server busy **100 %**, of which kernel (network, disk) **32 %** · memory used **1224 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get by id, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
6,325
95,917 requests in 15 s
Latency p50
15ms
average 15.1 ms
Latency p99
19ms
max 26 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **6,395** · 2 : **6,254** req/s · spread 2.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.9 vCPU**, **114 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.7 vCPU** · sandboxes **0.0 vCPU**, **213 MB** · whole server busy **97 %**, of which kernel (network, disk) **36 %** · memory used **1248 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get by id, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
7,155
108,530 requests in 15 s
Latency p50
13ms
average 13.3 ms
Latency p99
16ms
max 28 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **7,236** · 2 : **7,075** req/s · spread 2.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.0 vCPU**, **114 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.5 vCPU** · sandboxes **0.0 vCPU**, **225 MB** · whole server busy **97 %**, of which kernel (network, disk) **40 %** · memory used **1598 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MySQL · get by id, public · round 1 of 2, the closer to the average
### Get by id : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 278 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
4,947
73,552 requests in 15 s
Latency p50
20ms
average 19.9 ms
Latency p99
35ms
max 63 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **4,904** · 2 : **4,990** req/s · spread 1.7 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.0 vCPU**, **121 MB** RSS · MongoDB **0.7 vCPU** · sandboxes **0.0 vCPU**, **392 MB** · whole server busy **100 %**, of which kernel (network, disk) **31 %** · memory used **1234 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get by id, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
5,739
86,110 requests in 15 s
Latency p50
17ms
average 16.9 ms
Latency p99
21ms
max 33 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **5,742** · 2 : **5,736** req/s · spread 0.1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.0 vCPU**, **115 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.6 vCPU** · sandboxes **0.0 vCPU**, **213 MB** · whole server busy **97 %**, of which kernel (network, disk) **33 %** · memory used **1258 MB** of 3915 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get by id, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
6,551
96,599 requests in 15 s
Latency p50
15ms
average 15.0 ms
Latency p99
19ms
max 28 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **6,440** · 2 : **6,661** req/s · spread 3.4 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.1 vCPU**, **115 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.5 vCPU** · sandboxes **0.0 vCPU**, **225 MB** · whole server busy **97 %**, of which kernel (network, disk) **35 %** · memory used **1596 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MySQL · get by id, both tokens · round 1 of 2, the closer to the average
## Get by id with caching
One row by its primary key, on a table with `enableCaching: true` : answered from Redis after the first request. [About this API](https://docs.apimaker.dev/v4/docs/features/automatic-caching.html).
### Get by id with caching : public
No token : the API is public. Each answer : 278 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
18,970
279,999 requests in 15 s
Latency p50
5ms
average 4.9 ms
Latency p99
8ms
max 36 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **18,666** · 2 : **19,274** req/s · spread 3.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.7 vCPU**, **120 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **265 MB** · Redis **0.1 vCPU** · whole server busy **99 %**, of which kernel (network, disk) **30 %** · memory used **1082 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get by id with caching, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
19,622
293,227 requests in 15 s
Latency p50
5ms
average 4.6 ms
Latency p99
7ms
max 21 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **19,694** · 2 : **19,549** req/s · spread 0.7 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **1.7 vCPU**, **115 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **212 MB** · Redis **0.1 vCPU** · whole server busy **99 %**, of which kernel (network, disk) **32 %** · memory used **1263 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get by id with caching, public · round 2 of 2, the closer to the average
**MySQL**
Requests / second
19,858
299,686 requests in 15 s
Latency p50
4ms
average 4.5 ms
Latency p99
7ms
max 25 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **19,737** · 2 : **19,979** req/s · spread 1.2 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **1.7 vCPU**, **113 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **225 MB** · Redis **0.1 vCPU** · whole server busy **99 %**, of which kernel (network, disk) **33 %** · memory used **1606 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MySQL · get by id with caching, public · round 2 of 2, the closer to the average
### Get by id with caching : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 278 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
14,695
225,961 requests in 15 s
Latency p50
6ms
average 6.1 ms
Latency p99
10ms
max 45 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **15,064** · 2 : **14,326** req/s · spread 5 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.7 vCPU**, **118 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **265 MB** · Redis **0.1 vCPU** · whole server busy **100 %**, of which kernel (network, disk) **29 %** · memory used **1072 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get by id with caching, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
14,989
227,593 requests in 15 s
Latency p50
6ms
average 6.1 ms
Latency p99
10ms
max 22 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **15,173** · 2 : **14,806** req/s · spread 2.5 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.7 vCPU**, **114 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **213 MB** · Redis **0.1 vCPU** · whole server busy **100 %**, of which kernel (network, disk) **28 %** · memory used **1245 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get by id with caching, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
15,385
228,326 requests in 15 s
Latency p50
6ms
average 6.1 ms
Latency p99
9ms
max 24 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **15,223** · 2 : **15,548** req/s · spread 2.1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.7 vCPU**, **113 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **225 MB** · Redis **0.1 vCPU** · whole server busy **100 %**, of which kernel (network, disk) **29 %** · memory used **1587 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MySQL · get by id with caching, both tokens · round 1 of 2, the closer to the average
## Insert one row
`POST …/
/save-single-or-multiple` with one row of 9 columns in the body : the schema checks and converts it, the database writes it, and the saved row is answered. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/schema-apis/auto-generated-schema-based-save-single-or-multiple-api.html).
No token : the API is public. Each answer : 277 bytes (MongoDB), status 201.
**MongoDB**
Requests / second
2,352
36,270 requests in 15 s
Latency p50
38ms
average 40.8 ms
Latency p99
83ms
max 167 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **2,419** · 2 : **2,285** req/s · spread 5.7 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.6 vCPU**, **122 MB** RSS · MongoDB **1.1 vCPU** · sandboxes **0.0 vCPU**, **264 MB** · whole server busy **99 %**, of which kernel (network, disk) **31 %** · memory used **1130 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MongoDB · insert one row, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
3,021
45,251 requests in 15 s
Latency p50
33ms
average 32.6 ms
Latency p99
38ms
max 49 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,017** · 2 : **3,024** req/s · spread 0.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.7 vCPU**, **116 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.8 vCPU** · sandboxes **0.0 vCPU**, **213 MB** · whole server busy **95 %**, of which kernel (network, disk) **35 %** · memory used **1254 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · insert one row, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
2,371
36,182 requests in 15 s
Latency p50
41ms
average 40.9 ms
Latency p99
49ms
max 59 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **2,329** · 2 : **2,413** req/s · spread 3.5 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **0.6 vCPU**, **115 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.7 vCPU** · sandboxes **0.0 vCPU**, **225 MB** · whole server busy **91 %**, of which kernel (network, disk) **39 %** · memory used **1603 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MySQL · insert one row, public · round 2 of 2, the closer to the average
## Custom API without a database
A public custom API whose code returns a small object and reads no database : what running code of the account costs, without a database. Lean code runs in the server itself, with QuickJS ; the same code with `Date.now()` in it runs in a sandbox of the account : the trip from API Maker to the runner in its container and back.
**In the server (lean code)**
**The custom API**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
return { message: 'Hello from API Maker', time: 1 };
}
module.exports = main;
```
Requests / second
14,731
222,686 requests in 15 s
Latency p50
6ms
average 6.2 ms
Latency p99
10ms
max 20 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **14,847** · 2 : **14,615** req/s · spread 1.6 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.0 vCPU**, **115 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **392 MB** · whole server busy **100 %**, of which kernel (network, disk) **22 %** · memory used **1281 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · custom API without a database, in the server (lean code) · round 1 of 2, the closer to the average
**In the sandbox**
**The custom API**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
return { message: 'Hello from the sandbox', time: Date.now() };
}
module.exports = main;
```
Requests / second
12,669
190,003 requests in 15 s
Latency p50
7ms
average 7.4 ms
Latency p99
12ms
max 24 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **12,670** · 2 : **12,668** req/s · spread 0 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **1.4 vCPU**, **118 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.5 vCPU**, **392 MB** · whole server busy **99 %**, of which kernel (network, disk) **26 %** · memory used **1308 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · custom API without a database, in the sandbox · round 2 of 2, the closer to the average
## More connections
*Get all, public* and *Get by id with caching, public* on MongoDB, one run of 15 seconds for each number of connections. More clients at once wait longer for their answer, and the server keeps answering them all.
### Get all, public, by connections
**Get all, public, MongoDB : requests per second by connections**
10 connectionsp50 2 ms · p99 4 ms · 4,202
50 connectionsp50 10 ms · p99 20 ms · 4,614
100 connectionsp50 20 ms · p99 50 ms · 4,707
250 connectionsp50 57 ms · p99 75 ms · 4,329
500 connectionsp50 110 ms · p99 130 ms · 4,494
1,000 connectionsp50 221 ms · p99 245 ms · 4,488
| Connections | Requests / second | p50 | p99 | Max | Errors | Server busy | API Maker RSS |
|--:|--:|--:|--:|--:|--:|--:|--:|
| 10 | **4,202** | 2 ms | 4 ms | 10 ms | 0 | 96 % | 114 MB |
| 50 | **4,614** | 10 ms | 20 ms | 44 ms | 0 | 100 % | 117 MB |
| 100 | **4,707** | 20 ms | 50 ms | 113 ms | 0 | 100 % | 121 MB |
| 250 | **4,329** | 57 ms | 75 ms | 137 ms | 0 | 100 % | 134 MB |
| 500 | **4,494** | 110 ms | 130 ms | 226 ms | 0 | 100 % | 148 MB |
| 1,000 | **4,488** | 221 ms | 245 ms | 319 ms | 0 | 100 % | 182 MB |
### Get by id with caching, public, by connections
**Get by id with caching, public, MongoDB : requests per second by connections**
10 connectionsp50 0 ms · p99 1 ms · 10,987
50 connectionsp50 2 ms · p99 4 ms · 17,994
100 connectionsp50 5 ms · p99 7 ms · 19,413
250 connectionsp50 11 ms · p99 17 ms · 21,461
500 connectionsp50 24 ms · p99 30 ms · 20,182
1,000 connectionsp50 55 ms · p99 63 ms · 17,904
| Connections | Requests / second | p50 | p99 | Max | Errors | Server busy | API Maker RSS |
|--:|--:|--:|--:|--:|--:|--:|--:|
| 10 | **10,987** | 0 ms | 1 ms | 10 ms | 0 | 83 % | 120 MB |
| 50 | **17,994** | 2 ms | 4 ms | 19 ms | 0 | 98 % | 119 MB |
| 100 | **19,413** | 5 ms | 7 ms | 23 ms | 0 | 99 % | 121 MB |
| 250 | **21,461** | 11 ms | 17 ms | 44 ms | 0 | 100 % | 131 MB |
| 500 | **20,182** | 24 ms | 30 ms | 67 ms | 0 | 100 % | 146 MB |
| 1,000 | **17,904** | 55 ms | 63 ms | 143 ms | 0 | 100 % | 173 MB |
## Questions
### How many requests per second can API Maker serve on 2 shared vCPUs ?
On this 4 GB server, with the database on the same machine : 4,692 requests per second for a whole table of ten rows on MongoDB (PostgreSQL 5,577 · MySQL 6,660), 5,397 for one row by its id, and 18,970 when the answer is cached in Redis. A custom API in TypeScript which reads the table answers 3,178 requests per second when API Maker runs it itself (lean code), 3,015 when it runs in the sandbox of the account.
### How much memory does API Maker use ?
The API Maker process held 101 MB at rest and 125 MB at most under load on this server, in RAM. The rest of the memory went to the databases (MongoDB, Redis, PostgreSQL or MySQL), the sandboxes which run the code of the account, and Linux itself.
### Do the two tokens slow the APIs down ?
API Maker checks both tokens (x-am-authorization and x-am-user-authorization) and the groups of the API user on every request. Get all with both tokens answered 4,425 requests per second on MongoDB (public : 4,692), 5,290 requests per second on PostgreSQL (public : 5,577), 5,902 requests per second on MySQL (public : 6,660). The checks show most where the database does no work : a cached get all answered 14,144 requests per second with both tokens against 18,195 public on MongoDB.
### What does a pre hook cost ?
A pre hook runs code of the account before the API ; a lean hook like this one runs in the server itself, with QuickJS. Get all with a row scoping pre hook answered 3,339 requests per second on MongoDB, against 4,425 for the same API without the hook. On 2 vCPUs, the API, the hook and the database share the same 2 vCPUs.
### Can I run these benchmarks myself ?
Yes : [How API Maker is benchmarked](https://docs.apimaker.dev/v4/docs/benchmarks/methodology.html) gives the dataset, the settings of every API and the exact autocannon commands.
---
# API Maker benchmark : 4 vCPU, 8 GB RAM (Linode shared CPU)
> API Maker on 4 shared vCPUs, 8 GB (Linode) : 7,423 req/s get all, 26,444 cached, on MongoDB, PostgreSQL and MySQL, with memory and autocannon output.
Source: https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html
Benchmark · Linode (Akamai Cloud) · Shared CPU · 12 October 2026
**4 vCPU, 8 GB RAM : 7,423 to 9,375 requests per second for a whole table.**
API Maker 4.0.0 on a Linode 8 GB (g6-standard-4) : 4 shared vCPUs and 8 GB of RAM at $48 a month, its databases on the same machine. Every API was loaded for 15 seconds by autocannon from a second server, two times, on MongoDB, PostgreSQL and MySQL, public and with two tokens, while the server sampled the memory and CPU of every part each second.
Get all · MongoDB
7,423req/s
PostgreSQL 8,395 · MySQL 9,375
Get by id, cached
26,444req/s
answered from Redis · PostgreSQL 26,617 · MySQL 27,185
Custom API · MongoDB
5,178req/s
TypeScript, lean : run in the server · in the sandbox 4,649
API Maker memory
109MB
at rest · 142 MB at most under load
## The server
| | |
|---|---|
| Server | Linode (Akamai Cloud), Linode 8 GB (g6-standard-4), shared cpu, $48 / month |
| CPU | AMD EPYC 7642 48-Core Processor, 4 shared vCPUs (KVM) KVM guest, 1 thread per core · L1d 256 KiB (4 instances) · L2 2 MiB (4 instances) · L3 64 MiB (4 instances) · BogoMIPS 4599.99 |
| Memory | 8 GB (7,941 MB usable), swap 8.3 GB (496 MB of Linode + 7.8 GB made by the installer) |
| Disk, region | 160 GB SSD, Mumbai, India (ap-west) |
| System | Ubuntu 24.04.4 LTS, Linux 6.8.0-134, Docker 29.9.0 |
| API Maker | 4.0.0 : release build of api_maker_be_rust 864bb64 (opt-level 3, fat LTO), installed by its installer (https://apimaker.dev/v4/install.sh), no reverse proxy |
| Settings | the defaults of the installer (lean code of the account runs in the server with QuickJS : sandbox.codeInServer), and the sandboxes kept running for the whole run (removeSandboxInactiveSinceMinutes 1440) |
| Databases | MongoDB 8.0.10 (the MongoDB of API Maker, a replica set of one member, in Docker) · Redis 7.0.5 (the Redis of API Maker, in Docker) · PostgreSQL 18.6 (official image postgres:18, max_connections 500) · MySQL 8.4.11 (official image mysql:8.4, max_connections 500) : all on the same server |
| Sandboxes | TypeScript on Node.js 24.21.0 (an image of 403 MB built by API Maker), 2 sandboxes of the account (sandboxCountForAdmin 2, the default), each opening up to 4 runners when it is busy (one per vCPU) |
| Load generator | Dedicated 32 GB (g6-dedicated-16) : AMD EPYC 7713 64-Core Processor, 16 dedicated vCPUs, Ubuntu 24.04.4 LTS, Node.js 24.21.0, autocannon 8.0.0 with 10 worker threads |
| Network | Private network of the same data centre, round trip 0.42 ms (ping) |
| Host | A strict anti-affinity placement group kept the three shared CPU servers (2, 4 and 8 vCPUs) on three different hosts. All seven servers were measured at the same time, each by a load generator of its own. |
| Date | 12 October 2026, 05:30 to 06:44 UTC |
Only what a database needs was running while it was measured : API Maker and its two sandboxes, its MongoDB and Redis (API Maker always needs them) and the database under test. The other benchmark databases were stopped, API Maker was restarted and the swap emptied back into memory before each database, when it fitted there. How every number was taken : [How API Maker is benchmarked](https://docs.apimaker.dev/v4/docs/benchmarks/methodology.html). Every server side by side : [All results](https://docs.apimaker.dev/v4/docs/benchmarks/summary.html).
## The data
Every table holds the ten rows of the [API Maker benchmark dataset](https://apimaker.dev/json/benchmark_dataset.json) : `https://apimaker.dev/json/benchmark_dataset.json`. Ten customers, ten columns each ; a *get all* answers all ten (2,418 bytes of JSON on MongoDB), a *get by id* one of them.
| `_id` | `customer_id` | `first_name` | `last_name` | `phone` | `last_update` | `pincode` | `shipping_id` | `dob` | `country` |
|---|---|---|---|---|---|---|---|---|---|
| 60ae2488c37cd955cc144161 | 2 | NICK | WAHLBERG | 1123456789 | 2006-02-15T04:34:00.330Z | 111111 | 2 | 2022-10-30T03:25:03.000Z | India |
| 60ae24c8c37cd955cc144162 | 1 | PENELOPE | GUINESS | 123456789 | 2006-02-15T04:34:00.330Z | 100050 | 1 | 2022-10-30T03:25:03.000Z | India |
| 60ae247ac37cd955cc144160 | 3 | ED | CHASE | 2123456789 | 2006-02-15T04:34:00.330Z | 222222 | 3 | 2022-10-30T03:25:03.000Z | India |
| 60ace1401efc56684403c68c | 4 | JENNIFER | DAVIS | 3123456789 | 2006-02-15T04:34:00.330Z | 100050 | 4 | 2022-10-30T03:25:03.000Z | India |
| 60accda51efc56684403c685 | 5 | JOHNNY | LOLLOBRIGIDA | 4123456789 | 2006-02-15T04:34:00.330Z | 485125 | 1 | 2022-10-30T03:25:03.000Z | India |
| 606b7d364bebce00196eade7 | 6 | JOHNNY | LOLLOBRIGIDA | 5123456789 | 2006-02-15T04:34:00.330Z | 123456 | 2 | 2022-10-30T03:25:03.000Z | India |
| 606b75961055000018fa9d98 | 7 | GRACE | MOSTEL | 6123456789 | 2006-02-15T04:34:00.330Z | 356589 | 3 | 2022-10-30T03:25:03.000Z | India |
| 6064dd02730026001956663e | 8 | MATTHEW | JOHANSSON | 7123456789 | 2006-02-15T04:34:00.330Z | 100050 | 4 | 2022-10-30T03:25:03.000Z | India |
| 6064dcb8730026001956663c | 9 | JOE | SWANK | 8123456789 | 2006-02-15T04:34:00.330Z | 251415 | 1 | 2022-10-30T03:25:03.000Z | India |
| 6064c4c02bafb90018955299 | 10 | CHRISTIAN | GABLE | 9123456789 | 2006-02-15T04:34:00.330Z | 100050 | | 2022-10-30T03:25:03.000Z | India |
## Results at a glance
Requests per second, the average of two rounds of 15 seconds with 100 connections. *Public* APIs need no token ; *both tokens* means every request carries `x-am-authorization` (the token of an API user, whose groups decide what it may call) and `x-am-user-authorization` (the token of a row of the `customers` table, made by a DB token generator), and API Maker checks both.
**Requests per second · 4 vCPU, 8 GB RAM, shared CPU** · MongoDB · PostgreSQL · MySQL
Get allpublic · 7,423 · 8,395 · 9,375
Get allboth tokens · 7,021 · 7,680 · 8,338
Get all with cachingpublic · 26,115 · 26,420 · 25,630
Get all with cachingboth tokens · 20,550 · 20,113 · 20,763
Get all by streampublic · 6,724 · 8,226 · 8,355
Get all by streamboth tokens · 6,737 · 7,486 · 7,469
Custom API calling get all QuickJS · public · 5,178 · 5,658 · 6,016
Custom API calling get all QuickJS · both tokens · 4,910 · 5,158 · 5,536
Custom API in the sandbox Sandbox · public · 4,649 · 5,126 · 5,486
Get all with a pre hook QuickJS · both tokens · 5,327 · 6,151 · 6,768
Get by idpublic · 8,076 · 9,446 · 9,893
Get by idboth tokens · 7,513 · 8,233 · 8,892
Get by id with cachingpublic · 26,444 · 26,617 · 27,185
Get by id with cachingboth tokens · 20,887 · 21,238 · 22,684
Insert one rowpublic · 3,198 · 3,969 · 3,181
| API | Access | MongoDB | PostgreSQL | MySQL |
|---|---|--:|--:|--:|
| [Get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-all) | Public | **7,423** p99 28 ms | **8,395** p99 14 ms | **9,375** p99 12 ms |
| [Get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-all) | Both tokens | **7,021** p99 28 ms | **7,680** p99 15 ms | **8,338** p99 17 ms |
| [Get all with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-all-with-caching) | Public | **26,115** p99 5 ms | **26,420** p99 5 ms | **25,630** p99 6 ms |
| [Get all with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-all-with-caching) | Both tokens | **20,550** p99 7 ms | **20,113** p99 8 ms | **20,763** p99 7 ms |
| [Get all by stream](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-all-by-stream) | Public | **6,724** p99 33 ms | **8,226** p99 14 ms | **8,355** p99 14 ms |
| [Get all by stream](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-all-by-stream) | Both tokens | **6,737** p99 29 ms | **7,486** p99 15 ms | **7,469** p99 15 ms |
| [Custom API calling get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#custom-api-calling-get-all) QuickJS | Public | **5,178** p99 34 ms | **5,658** p99 20 ms | **6,016** p99 19 ms |
| [Custom API calling get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#custom-api-calling-get-all) QuickJS | Both tokens | **4,910** p99 34 ms | **5,158** p99 22 ms | **5,536** p99 20 ms |
| [Custom API in the sandbox](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#custom-api-in-the-sandbox) Sandbox | Public | **4,649** p99 42 ms | **5,126** p99 35 ms | **5,486** p99 33 ms |
| [Get all with a pre hook](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-all-with-a-pre-hook) QuickJS | Both tokens | **5,327** p99 34 ms | **6,151** p99 18 ms | **6,768** p99 17 ms |
| [Get by id](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-by-id) | Public | **8,076** p99 26 ms | **9,446** p99 12 ms | **9,893** p99 11 ms |
| [Get by id](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-by-id) | Both tokens | **7,513** p99 23 ms | **8,233** p99 17 ms | **8,892** p99 13 ms |
| [Get by id with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-by-id-with-caching) | Public | **26,444** p99 5 ms | **26,617** p99 5 ms | **27,185** p99 5 ms |
| [Get by id with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#get-by-id-with-caching) | Both tokens | **20,887** p99 7 ms | **21,238** p99 7 ms | **22,684** p99 6 ms |
| [Insert one row](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#insert-one-row) | Public | **3,198** p99 63 ms | **3,969** p99 28 ms | **3,181** p99 35 ms |
| [Custom API without a database](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#custom-api-without-a-database) | Public | **26,046** p99 6 ms | | |
| [Custom API without a database, in the sandbox](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html#custom-api-without-a-database) | Public | **17,702** p99 10 ms | | |
(0 errors) Every one of the **19,370,117 requests** of these runs was answered with status 200 or 201 : no error, no timeout.
## Memory
What each part of the server held, in MB : at rest (the 60 seconds after API Maker and its sandboxes started, before any request) and under load. The bars show the second the whole server held the most memory while its database was loaded, out of the 7,941 MB of the server ; the table gives the most each part held on its own. API Maker is the resident memory of its process ; a container is counted the way `docker stats` counts it.
API Maker · MongoDB of API Maker · Redis · PostgreSQL / MySQL · Sandboxes · Linux, Docker, the rest · Available
MongoDB
at rest
under load
PostgreSQL
at rest
under load
MySQL
at rest
under load
| Part | MongoDB at rest → under load | PostgreSQL at rest → under load | MySQL at rest → under load |
|---|--:|--:|--:|
| **API Maker** (process), in RAM | 109 → **135** | 103 → **135** | 107 → **142** |
| … and in swap | 0 → **0** | 0 → **0** | 0 → **0** |
| MongoDB of API Maker, in RAM | 125 → **290** | 276 → **276** | 275 → **276** |
| … and in swap | 0 → **0** | 0 → **0** | 0 → **0** |
| Redis, in RAM | 3 → **4** | 3 → **4** | 3 → **4** |
| Database under test, in RAM | MongoDB above | 38 → **211** | 421 → **507** |
| … and in swap | MongoDB above | 0 → **0** | 0 → **0** |
| Sandboxes (2 containers), in RAM | 55 → **602** | 55 → **545** | 55 → **520** |
| … and in swap | 0 → **0** | 0 → **0** | 0 → **0** |
| **Whole server**, RAM used | 872 → **1593** | 1081 → **1761** | 1462 → **2048** |
| Swap used | 0 → **0** | 0 → **0** | 0 → **0** |
## CPU
On 4 vCPUs, API Maker, the database and the sandboxes share the same 4 vCPUs : every request costs the work of all of them. During *get all, public*, the CPU was split this way (average of the 15 seconds, in vCPUs : 4.0 is the whole server ; a process counts its own kernel time) :
| | MongoDB | PostgreSQL | MySQL |
|---|--:|--:|--:|
| API Maker | 1.6 vCPU | 1.9 vCPU | 2.0 vCPU |
| The database | 1.8 vCPU | 1.0 vCPU | 0.9 vCPU |
| MongoDB of API Maker (when it is not the one tested) | – | 0.0 vCPU | 0.0 vCPU |
| Sandboxes (idle : no code runs in get all) | 0.0 vCPU | 0.0 vCPU | 0.0 vCPU |
| Whole server busy (of its 4 vCPUs) | 99 % | 90 % | 91 % |
| … of which kernel time (network, disk), counted in the lines above too | 31 % | 35 % | 36 % |
Steal time (CPU the hypervisor gave to other servers) was 0 % on average, 0 % at most. The load generator, sampled the same way, was never more than 21 % busy over its 16 cores : it was never the limit.
## Get all
The schema API of a table answers all its rows : `GET /api/schema////
`. Every request reads the ten rows from the database, converts them with the schema of the table and sends them as JSON. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/schema-apis/auto-generated-schema-based-get-all-api.html).
### Get all : public
No token : the API is public. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
7,423
119,615 requests in 15 s
Latency p50
11ms
average 12.0 ms
Latency p99
28ms
max 68 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **7,974** · 2 : **6,873** req/s · spread 14.8 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.6 vCPU**, **123 MB** RSS · MongoDB **1.8 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **99 %**, of which kernel (network, disk) **31 %** · memory used **902 MB** of 7942 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
8,395
127,345 requests in 15 s
Latency p50
11ms
average 11.3 ms
Latency p99
14ms
max 20 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **8,489** · 2 : **8,300** req/s · spread 2.3 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.9 vCPU**, **115 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.0 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **90 %**, of which kernel (network, disk) **35 %** · memory used **1093 MB** of 7942 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
9,375
140,877 requests in 15 s
Latency p50
10ms
average 10.2 ms
Latency p99
12ms
max 23 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **9,393** · 2 : **9,358** req/s · spread 0.4 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.0 vCPU**, **117 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.9 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **91 %**, of which kernel (network, disk) **36 %** · memory used **1472 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all, public · round 1 of 2, the closer to the average
### Get all : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
7,021
102,801 requests in 15 s
Latency p50
14ms
average 14.1 ms
Latency p99
28ms
max 66 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **7,187** · 2 : **6,854** req/s · spread 4.7 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **1.9 vCPU**, **131 MB** RSS · MongoDB **1.5 vCPU** · sandboxes **0.0 vCPU**, **582 MB** · whole server busy **99 %**, of which kernel (network, disk) **29 %** · memory used **1576 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all, both tokens · round 2 of 2, the closer to the average
**PostgreSQL**
Requests / second
7,680
117,913 requests in 15 s
Latency p50
12ms
average 12.2 ms
Latency p99
15ms
max 24 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **7,862** · 2 : **7,498** req/s · spread 4.7 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.1 vCPU**, **117 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.9 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **91 %**, of which kernel (network, disk) **33 %** · memory used **1097 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
8,338
122,715 requests in 15 s
Latency p50
12ms
average 11.7 ms
Latency p99
17ms
max 25 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **8,181** · 2 : **8,494** req/s · spread 3.8 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.2 vCPU**, **121 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.8 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **93 %**, of which kernel (network, disk) **34 %** · memory used **1480 MB** of 7942 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all, both tokens · round 1 of 2, the closer to the average
## Get all with caching
The same request on a table whose API settings say `enableCaching: true`. The first answer is kept in Redis, under a key made of who asks and what is asked ; the next requests are answered from Redis until the answer expires or something writes the table. [About this API](https://docs.apimaker.dev/v4/docs/features/automatic-caching.html).
### Get all with caching : public
No token : the API is public. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
26,115
399,054 requests in 15 s
Latency p50
3ms
average 3.3 ms
Latency p99
5ms
max 17 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **26,609** · 2 : **25,621** req/s · spread 3.8 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.4 vCPU**, **123 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · Redis **0.2 vCPU** · whole server busy **96 %**, of which kernel (network, disk) **31 %** · memory used **905 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all with caching, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
26,420
415,119 requests in 15 s
Latency p50
3ms
average 3.1 ms
Latency p99
5ms
max 14 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **27,674** · 2 : **25,166** req/s · spread 9.5 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.3 vCPU**, **116 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · Redis **0.2 vCPU** · whole server busy **95 %**, of which kernel (network, disk) **32 %** · memory used **1087 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all with caching, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
25,630
382,667 requests in 15 s
Latency p50
3ms
average 3.4 ms
Latency p99
6ms
max 19 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **25,749** · 2 : **25,511** req/s · spread 0.9 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **3.4 vCPU**, **129 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **518 MB** · Redis **0.2 vCPU** · whole server busy **95 %**, of which kernel (network, disk) **29 %** · memory used **2038 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all with caching, public · round 2 of 2, the closer to the average
### Get all with caching : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
20,550
304,157 requests in 15 s
Latency p50
4ms
average 4.4 ms
Latency p99
7ms
max 20 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **20,277** · 2 : **20,823** req/s · spread 2.7 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.5 vCPU**, **121 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · Redis **0.1 vCPU** · whole server busy **98 %**, of which kernel (network, disk) **27 %** · memory used **897 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all with caching, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
20,113
305,142 requests in 15 s
Latency p50
4ms
average 4.4 ms
Latency p99
8ms
max 18 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **20,341** · 2 : **19,885** req/s · spread 2.3 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.5 vCPU**, **116 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · Redis **0.1 vCPU** · whole server busy **97 %**, of which kernel (network, disk) **26 %** · memory used **1087 MB** of 7942 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all with caching, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
20,763
322,649 requests in 15 s
Latency p50
4ms
average 4.2 ms
Latency p99
7ms
max 17 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **21,511** · 2 : **20,016** req/s · spread 7.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.5 vCPU**, **119 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · Redis **0.2 vCPU** · whole server busy **97 %**, of which kernel (network, disk) **26 %** · memory used **1468 MB** of 7942 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all with caching, both tokens · round 1 of 2, the closer to the average
## Get all by stream
`GET …/
/stream` : the rows are sent while they are read from the database cursor, so a large table never sits whole in memory. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/schema-apis/auto-generated-schema-based-get-all-by-stream-api.html).
### Get all by stream : public
No token : the API is public. Each answer : 2,477 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
6,724
99,530 requests in 15 s
Latency p50
14ms
average 14.6 ms
Latency p99
33ms
max 76 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **6,636** · 2 : **6,812** req/s · spread 2.6 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.8 vCPU**, **128 MB** RSS · MongoDB **1.7 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **99 %**, of which kernel (network, disk) **29 %** · memory used **918 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all by stream, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
8,226
124,693 requests in 15 s
Latency p50
12ms
average 11.5 ms
Latency p99
14ms
max 24 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **8,313** · 2 : **8,138** req/s · spread 2.1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.0 vCPU**, **130 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.0 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **91 %**, of which kernel (network, disk) **34 %** · memory used **1102 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all by stream, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
8,355
120,464 requests in 15 s
Latency p50
12ms
average 11.9 ms
Latency p99
14ms
max 23 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **8,678** · 2 : **8,032** req/s · spread 7.7 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **2.2 vCPU**, **137 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.7 vCPU** · sandboxes **0.0 vCPU**, **518 MB** · whole server busy **91 %**, of which kernel (network, disk) **32 %** · memory used **2048 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all by stream, public · round 2 of 2, the closer to the average
### Get all by stream : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,577 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
6,737
99,542 requests in 15 s
Latency p50
14ms
average 14.6 ms
Latency p99
29ms
max 64 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **6,838** · 2 : **6,637** req/s · spread 3 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **2.0 vCPU**, **135 MB** RSS · MongoDB **1.5 vCPU** · sandboxes **0.0 vCPU**, **582 MB** · whole server busy **99 %**, of which kernel (network, disk) **26 %** · memory used **1593 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all by stream, both tokens · round 2 of 2, the closer to the average
**PostgreSQL**
Requests / second
7,486
113,375 requests in 15 s
Latency p50
13ms
average 12.7 ms
Latency p99
15ms
max 24 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **7,559** · 2 : **7,412** req/s · spread 2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.2 vCPU**, **129 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.9 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **93 %**, of which kernel (network, disk) **31 %** · memory used **1103 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all by stream, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
7,469
113,289 requests in 15 s
Latency p50
13ms
average 12.7 ms
Latency p99
15ms
max 24 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **7,553** · 2 : **7,386** req/s · spread 2.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.4 vCPU**, **134 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.7 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **94 %**, of which kernel (network, disk) **32 %** · memory used **1482 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all by stream, both tokens · round 1 of 2, the closer to the average
## Custom API calling get all
A custom API written in TypeScript, `return await g.sys.db.getAll({ instance, database, collection })`. This code is *lean* : it only reads what it is handed and asks `g.sys` for a read, so API Maker runs it in the server itself, with QuickJS, on the thread which answers the request, and the request never leaves the server. Code which needs more (a package, the time of the machine, `g.shared`, …) runs in the sandbox of the account : see the next API. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/custom-apis/user-created-custom-api.html).
**The custom API (public : customers_public ; both tokens : customers)**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
return await g.sys.db.getAll({ instance: 'mongodb', database: 'am_bench', collection: 'customers_public' });
}
module.exports = main;
```
### Custom API calling get all : public
No token : the API is public. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
5,178
75,384 requests in 15 s
Latency p50
19ms
average 19.4 ms
Latency p99
34ms
max 54 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **5,330** · 2 : **5,026** req/s · spread 5.9 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **2.3 vCPU**, **132 MB** RSS · MongoDB **1.2 vCPU** · sandboxes **0.0 vCPU**, **582 MB** · whole server busy **99 %**, of which kernel (network, disk) **23 %** · memory used **1571 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MongoDB · custom api calling get all, public · round 2 of 2, the closer to the average
**PostgreSQL**
Requests / second
5,658
85,337 requests in 15 s
Latency p50
17ms
average 17.1 ms
Latency p99
20ms
max 29 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **5,690** · 2 : **5,626** req/s · spread 1.1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.7 vCPU**, **122 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.7 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **97 %**, of which kernel (network, disk) **25 %** · memory used **1099 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · custom api calling get all, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
6,016
90,945 requests in 15 s
Latency p50
16ms
average 16.0 ms
Latency p99
19ms
max 27 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **6,063** · 2 : **5,968** req/s · spread 1.6 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.7 vCPU**, **127 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.6 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **97 %**, of which kernel (network, disk) **26 %** · memory used **1478 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MySQL · custom api calling get all, public · round 1 of 2, the closer to the average
### Custom API calling get all : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
4,910
74,827 requests in 15 s
Latency p50
19ms
average 19.5 ms
Latency p99
34ms
max 50 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **4,989** · 2 : **4,831** req/s · spread 3.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.5 vCPU**, **130 MB** RSS · MongoDB **1.1 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **99 %**, of which kernel (network, disk) **21 %** · memory used **946 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MongoDB · custom api calling get all, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
5,158
77,441 requests in 15 s
Latency p50
19ms
average 18.9 ms
Latency p99
22ms
max 30 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **5,163** · 2 : **5,153** req/s · spread 0.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.8 vCPU**, **123 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.6 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **96 %**, of which kernel (network, disk) **23 %** · memory used **1100 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · custom api calling get all, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
5,536
83,494 requests in 15 s
Latency p50
17ms
average 17.5 ms
Latency p99
20ms
max 26 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **5,504** · 2 : **5,567** req/s · spread 1.1 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **2.9 vCPU**, **131 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.6 vCPU** · sandboxes **0.0 vCPU**, **518 MB** · whole server busy **98 %**, of which kernel (network, disk) **24 %** · memory used **2025 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MySQL · custom api calling get all, both tokens · round 2 of 2, the closer to the average
## Custom API in the sandbox
The same custom API, with one line more : it reads `Date.now()`, the time of the machine, which lean code may not. So this code runs in a sandbox of the account (a container with Node.js 24) : the request goes from API Maker to a runner of the sandbox and back, and the rows are read from inside the sandbox by the core of API Maker loaded there. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/custom-apis/user-created-custom-api.html).
**The custom API which runs in the sandbox**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
const started = Date.now(); // the time of the machine : this code runs in the sandbox of the account
return await g.sys.db.getAll({ instance: 'mongodb', database: 'am_bench', collection: 'customers_public' });
}
module.exports = main;
```
No token : the API is public. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
4,649
69,667 requests in 15 s
Latency p50
20ms
average 21.0 ms
Latency p99
42ms
max 112 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **4,645** · 2 : **4,653** req/s · spread 0.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.0 vCPU**, **125 MB** RSS · MongoDB **1.1 vCPU** · sandboxes **1.8 vCPU**, **577 MB** · whole server busy **100 %**, of which kernel (network, disk) **21 %** · memory used **1465 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MongoDB · custom api in the sandbox, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
5,126
77,048 requests in 15 s
Latency p50
19ms
average 19.0 ms
Latency p99
35ms
max 52 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **5,137** · 2 : **5,115** req/s · spread 0.4 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.1 vCPU**, **120 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.7 vCPU** · sandboxes **1.7 vCPU**, **538 MB** · whole server busy **99 %**, of which kernel (network, disk) **25 %** · memory used **1730 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · custom api in the sandbox, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
5,486
82,434 requests in 15 s
Latency p50
17ms
average 17.7 ms
Latency p99
33ms
max 53 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **5,496** · 2 : **5,475** req/s · spread 0.4 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.2 vCPU**, **125 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.6 vCPU** · sandboxes **1.7 vCPU**, **503 MB** · whole server busy **99 %**, of which kernel (network, disk) **27 %** · memory used **1991 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MySQL · custom api in the sandbox, public · round 1 of 2, the closer to the average
## Get all with a pre hook
Get all, with both tokens, on a table whose get all API has a pre hook written in TypeScript : before the API, the hook runs (lean code : in the server, with QuickJS), reads the signed-in person from `x-am-user-authorization` and keeps the rows of their country (`g.req.query.find`), the row scoping most applications need. Every row of the dataset is in India, as the person is, so the answer is the same ten rows. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/hooks/preHook-api.html).
**The pre hook of SCHEMA_GET_ALL on customers_pre_hook**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
if (!g.req.isApiRequestFromUser) return;
const person = g.req.auth.authAMDB; // the person, from x-am-user-authorization
if (!person) throw [{ code: T.EStatusCode.UNAUTHORIZED, message: 'Sign in first.' }];
const find = g.req.query.find ? (typeof g.req.query.find === 'string' ? JSON.parse(g.req.query.find) : g.req.query.find) : {};
g.req.query.find = { $and: [find, { country: person.country }] };
}
module.exports = main;
```
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
5,327
80,031 requests in 15 s
Latency p50
18ms
average 18.2 ms
Latency p99
34ms
max 66 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **5,336** · 2 : **5,318** req/s · spread 0.3 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.1 vCPU**, **128 MB** RSS · MongoDB **1.4 vCPU** · sandboxes **0.0 vCPU**, **601 MB** · whole server busy **99 %**, of which kernel (network, disk) **24 %** · memory used **1507 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all with a pre hook, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
6,151
93,295 requests in 15 s
Latency p50
16ms
average 15.6 ms
Latency p99
18ms
max 25 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **6,220** · 2 : **6,082** req/s · spread 2.3 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.4 vCPU**, **121 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.8 vCPU** · sandboxes **0.0 vCPU**, **545 MB** · whole server busy **95 %**, of which kernel (network, disk) **27 %** · memory used **1737 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all with a pre hook, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
6,768
104,649 requests in 15 s
Latency p50
14ms
average 13.8 ms
Latency p99
17ms
max 29 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **6,977** · 2 : **6,559** req/s · spread 6.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.5 vCPU**, **126 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.7 vCPU** · sandboxes **0.0 vCPU**, **503 MB** · whole server busy **95 %**, of which kernel (network, disk) **27 %** · memory used **1985 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all with a pre hook, both tokens · round 1 of 2, the closer to the average
## Get by id
One row by its primary key : `GET …/
/get-by-id/`. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/schema-apis/auto-generated-schema-based-get-by-id-api.html).
### Get by id : public
No token : the API is public. Each answer : 278 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
8,076
120,738 requests in 15 s
Latency p50
11ms
average 11.9 ms
Latency p99
26ms
max 79 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **8,104** · 2 : **8,049** req/s · spread 0.7 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **1.8 vCPU**, **131 MB** RSS · MongoDB **1.6 vCPU** · sandboxes **0.0 vCPU**, **477 MB** · whole server busy **99 %**, of which kernel (network, disk) **30 %** · memory used **1456 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get by id, public · round 2 of 2, the closer to the average
**PostgreSQL**
Requests / second
9,446
145,024 requests in 15 s
Latency p50
10ms
average 9.8 ms
Latency p99
12ms
max 22 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **9,669** · 2 : **9,222** req/s · spread 4.7 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.8 vCPU**, **122 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.1 vCPU** · sandboxes **0.0 vCPU**, **545 MB** · whole server busy **90 %**, of which kernel (network, disk) **35 %** · memory used **1728 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get by id, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
9,893
153,601 requests in 15 s
Latency p50
9ms
average 9.3 ms
Latency p99
11ms
max 20 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **10,240** · 2 : **9,545** req/s · spread 7 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.0 vCPU**, **127 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.9 vCPU** · sandboxes **0.0 vCPU**, **502 MB** · whole server busy **90 %**, of which kernel (network, disk) **35 %** · memory used **1982 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MySQL · get by id, public · round 1 of 2, the closer to the average
### Get by id : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 278 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
7,513
114,593 requests in 15 s
Latency p50
12ms
average 12.6 ms
Latency p99
23ms
max 46 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **7,640** · 2 : **7,386** req/s · spread 3.4 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.1 vCPU**, **130 MB** RSS · MongoDB **1.3 vCPU** · sandboxes **0.0 vCPU**, **477 MB** · whole server busy **99 %**, of which kernel (network, disk) **28 %** · memory used **1378 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get by id, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
8,233
123,892 requests in 15 s
Latency p50
11ms
average 11.6 ms
Latency p99
17ms
max 25 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **8,260** · 2 : **8,206** req/s · spread 0.7 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.9 vCPU**, **122 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.0 vCPU** · sandboxes **0.0 vCPU**, **445 MB** · whole server busy **92 %**, of which kernel (network, disk) **33 %** · memory used **1643 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get by id, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
8,892
137,132 requests in 15 s
Latency p50
10ms
average 10.4 ms
Latency p99
13ms
max 24 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **9,142** · 2 : **8,641** req/s · spread 5.6 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.2 vCPU**, **127 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.8 vCPU** · sandboxes **0.0 vCPU**, **502 MB** · whole server busy **92 %**, of which kernel (network, disk) **33 %** · memory used **1982 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MySQL · get by id, both tokens · round 1 of 2, the closer to the average
## Get by id with caching
One row by its primary key, on a table with `enableCaching: true` : answered from Redis after the first request. [About this API](https://docs.apimaker.dev/v4/docs/features/automatic-caching.html).
### Get by id with caching : public
No token : the API is public. Each answer : 278 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
26,444
400,693 requests in 15 s
Latency p50
3ms
average 3.2 ms
Latency p99
5ms
max 15 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **26,714** · 2 : **26,174** req/s · spread 2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.4 vCPU**, **126 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **477 MB** · Redis **0.2 vCPU** · whole server busy **95 %**, of which kernel (network, disk) **26 %** · memory used **1377 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get by id with caching, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
26,617
399,693 requests in 15 s
Latency p50
3ms
average 3.3 ms
Latency p99
5ms
max 15 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **26,651** · 2 : **26,582** req/s · spread 0.3 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.4 vCPU**, **121 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **445 MB** · Redis **0.2 vCPU** · whole server busy **95 %**, of which kernel (network, disk) **28 %** · memory used **1642 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get by id with caching, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
27,185
416,448 requests in 15 s
Latency p50
3ms
average 3.1 ms
Latency p99
5ms
max 17 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **27,764** · 2 : **26,606** req/s · spread 4.3 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.4 vCPU**, **125 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **502 MB** · Redis **0.2 vCPU** · whole server busy **95 %**, of which kernel (network, disk) **26 %** · memory used **1984 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MySQL · get by id with caching, public · round 1 of 2, the closer to the average
### Get by id with caching : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 278 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
20,887
313,831 requests in 15 s
Latency p50
4ms
average 4.3 ms
Latency p99
7ms
max 18 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **20,852** · 2 : **20,922** req/s · spread 0.3 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **3.5 vCPU**, **127 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **477 MB** · Redis **0.1 vCPU** · whole server busy **97 %**, of which kernel (network, disk) **22 %** · memory used **1484 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get by id with caching, both tokens · round 2 of 2, the closer to the average
**PostgreSQL**
Requests / second
21,238
316,378 requests in 15 s
Latency p50
4ms
average 4.2 ms
Latency p99
7ms
max 17 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **21,093** · 2 : **21,383** req/s · spread 1.4 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.5 vCPU**, **120 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **445 MB** · Redis **0.1 vCPU** · whole server busy **97 %**, of which kernel (network, disk) **23 %** · memory used **1644 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get by id with caching, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
22,684
345,677 requests in 15 s
Latency p50
4ms
average 3.8 ms
Latency p99
6ms
max 15 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **23,046** · 2 : **22,322** req/s · spread 3.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.5 vCPU**, **126 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **502 MB** · Redis **0.1 vCPU** · whole server busy **97 %**, of which kernel (network, disk) **23 %** · memory used **1984 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MySQL · get by id with caching, both tokens · round 1 of 2, the closer to the average
## Insert one row
`POST …/
/save-single-or-multiple` with one row of 9 columns in the body : the schema checks and converts it, the database writes it, and the saved row is answered. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/schema-apis/auto-generated-schema-based-save-single-or-multiple-api.html).
No token : the API is public. Each answer : 277 bytes (MongoDB), status 201.
**MongoDB**
Requests / second
3,198
47,640 requests in 15 s
Latency p50
30ms
average 31.0 ms
Latency p99
63ms
max 143 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,177** · 2 : **3,219** req/s · spread 1.3 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.3 vCPU**, **130 MB** RSS · MongoDB **2.1 vCPU** · sandboxes **0.0 vCPU**, **476 MB** · whole server busy **96 %**, of which kernel (network, disk) **28 %** · memory used **1412 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MongoDB · insert one row, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
3,969
60,055 requests in 15 s
Latency p50
24ms
average 24.5 ms
Latency p99
28ms
max 34 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **4,004** · 2 : **3,935** req/s · spread 1.8 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.5 vCPU**, **123 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.4 vCPU** · sandboxes **0.0 vCPU**, **444 MB** · whole server busy **91 %**, of which kernel (network, disk) **32 %** · memory used **1646 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · insert one row, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
3,181
47,899 requests in 15 s
Latency p50
31ms
average 30.8 ms
Latency p99
35ms
max 40 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,194** · 2 : **3,168** req/s · spread 0.8 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.3 vCPU**, **128 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.2 vCPU** · sandboxes **0.0 vCPU**, **502 MB** · whole server busy **84 %**, of which kernel (network, disk) **33 %** · memory used **1989 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MySQL · insert one row, public · round 1 of 2, the closer to the average
## Custom API without a database
A public custom API whose code returns a small object and reads no database : what running code of the account costs, without a database. Lean code runs in the server itself, with QuickJS ; the same code with `Date.now()` in it runs in a sandbox of the account : the trip from API Maker to the runner in its container and back.
**In the server (lean code)**
**The custom API**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
return { message: 'Hello from API Maker', time: 1 };
}
module.exports = main;
```
Requests / second
26,046
394,004 requests in 15 s
Latency p50
3ms
average 3.3 ms
Latency p99
6ms
max 16 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **26,268** · 2 : **25,824** req/s · spread 1.7 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.9 vCPU**, **123 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **601 MB** · whole server busy **99 %**, of which kernel (network, disk) **23 %** · memory used **1578 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · custom API without a database, in the server (lean code) · round 1 of 2, the closer to the average
**In the sandbox**
**The custom API**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
return { message: 'Hello from the sandbox', time: Date.now() };
}
module.exports = main;
```
Requests / second
17,702
265,205 requests in 15 s
Latency p50
5ms
average 5.2 ms
Latency p99
10ms
max 17 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **17,723** · 2 : **17,681** req/s · spread 0.2 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **3.0 vCPU**, **125 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.9 vCPU**, **600 MB** · whole server busy **98 %**, of which kernel (network, disk) **21 %** · memory used **1594 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · custom API without a database, in the sandbox · round 2 of 2, the closer to the average
## More connections
*Get all, public* and *Get by id with caching, public* on MongoDB, one run of 15 seconds for each number of connections. More clients at once wait longer for their answer, and the server keeps answering them all.
### Get all, public, by connections
**Get all, public, MongoDB : requests per second by connections**
10 connectionsp50 1 ms · p99 3 ms · 5,580
50 connectionsp50 6 ms · p99 16 ms · 6,813
100 connectionsp50 14 ms · p99 34 ms · 6,814
250 connectionsp50 35 ms · p99 56 ms · 6,952
500 connectionsp50 76 ms · p99 95 ms · 6,538
1,000 connectionsp50 152 ms · p99 174 ms · 6,525
| Connections | Requests / second | p50 | p99 | Max | Errors | Server busy | API Maker RSS |
|--:|--:|--:|--:|--:|--:|--:|--:|
| 10 | **5,580** | 1 ms | 3 ms | 8 ms | 0 | 87 % | 123 MB |
| 50 | **6,813** | 6 ms | 16 ms | 34 ms | 0 | 98 % | 126 MB |
| 100 | **6,814** | 14 ms | 34 ms | 84 ms | 0 | 99 % | 131 MB |
| 250 | **6,952** | 35 ms | 56 ms | 96 ms | 0 | 99 % | 144 MB |
| 500 | **6,538** | 76 ms | 95 ms | 141 ms | 0 | 99 % | 157 MB |
| 1,000 | **6,525** | 152 ms | 174 ms | 224 ms | 0 | 99 % | 196 MB |
### Get by id with caching, public, by connections
**Get by id with caching, public, MongoDB : requests per second by connections**
10 connectionsp50 0 ms · p99 1 ms · 11,584
50 connectionsp50 1 ms · p99 3 ms · 24,945
100 connectionsp50 3 ms · p99 5 ms · 28,147
250 connectionsp50 8 ms · p99 12 ms · 30,600
500 connectionsp50 16 ms · p99 22 ms · 29,908
1,000 connectionsp50 36 ms · p99 46 ms · 27,033
| Connections | Requests / second | p50 | p99 | Max | Errors | Server busy | API Maker RSS |
|--:|--:|--:|--:|--:|--:|--:|--:|
| 10 | **11,584** | 0 ms | 1 ms | 6 ms | 0 | 68 % | 131 MB |
| 50 | **24,945** | 1 ms | 3 ms | 10 ms | 0 | 91 % | 131 MB |
| 100 | **28,147** | 3 ms | 5 ms | 15 ms | 0 | 95 % | 134 MB |
| 250 | **30,600** | 8 ms | 12 ms | 31 ms | 0 | 97 % | 143 MB |
| 500 | **29,908** | 16 ms | 22 ms | 49 ms | 0 | 97 % | 157 MB |
| 1,000 | **27,033** | 36 ms | 46 ms | 101 ms | 0 | 97 % | 184 MB |
## Questions
### How many requests per second can API Maker serve on 4 shared vCPUs ?
On this 8 GB server, with the database on the same machine : 7,423 requests per second for a whole table of ten rows on MongoDB (PostgreSQL 8,395 · MySQL 9,375), 8,076 for one row by its id, and 26,444 when the answer is cached in Redis. A custom API in TypeScript which reads the table answers 5,178 requests per second when API Maker runs it itself (lean code), 4,649 when it runs in the sandbox of the account.
### How much memory does API Maker use ?
The API Maker process held 109 MB at rest and 142 MB at most under load on this server, in RAM. The rest of the memory went to the databases (MongoDB, Redis, PostgreSQL or MySQL), the sandboxes which run the code of the account, and Linux itself.
### Do the two tokens slow the APIs down ?
API Maker checks both tokens (x-am-authorization and x-am-user-authorization) and the groups of the API user on every request. Get all with both tokens answered 7,021 requests per second on MongoDB (public : 7,423), 7,680 requests per second on PostgreSQL (public : 8,395), 8,338 requests per second on MySQL (public : 9,375). The checks show most where the database does no work : a cached get all answered 20,550 requests per second with both tokens against 26,115 public on MongoDB.
### What does a pre hook cost ?
A pre hook runs code of the account before the API ; a lean hook like this one runs in the server itself, with QuickJS. Get all with a row scoping pre hook answered 5,327 requests per second on MongoDB, against 7,021 for the same API without the hook. On 4 vCPUs, the API, the hook and the database share the same 4 vCPUs.
### Can I run these benchmarks myself ?
Yes : [How API Maker is benchmarked](https://docs.apimaker.dev/v4/docs/benchmarks/methodology.html) gives the dataset, the settings of every API and the exact autocannon commands.
---
# API Maker benchmark : 8 vCPU, 32 GB RAM (Linode shared CPU)
> API Maker on 8 shared vCPUs, 32 GB (Linode) : 11,002 req/s get all, 44,564 cached, on MongoDB, PostgreSQL and MySQL, with memory and autocannon output.
Source: https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html
Benchmark · Linode (Akamai Cloud) · Shared CPU · 12 October 2026
**8 vCPU, 32 GB RAM : 11,002 to 13,816 requests per second for a whole table.**
API Maker 4.0.0 on a Linode 32 GB (g6-standard-8) : 8 shared vCPUs and 32 GB of RAM at $192 a month, its databases on the same machine. Every API was loaded for 15 seconds by autocannon from a second server, two times, on MongoDB, PostgreSQL and MySQL, public and with two tokens, while the server sampled the memory and CPU of every part each second.
Get all · MongoDB
11,002req/s
PostgreSQL 13,054 · MySQL 13,816
Get by id, cached
44,564req/s
answered from Redis · PostgreSQL 43,050 · MySQL 43,160
Custom API · MongoDB
8,062req/s
TypeScript, lean : run in the server · in the sandbox 7,636
API Maker memory
112MB
at rest · 154 MB at most under load
## The server
| | |
|---|---|
| Server | Linode (Akamai Cloud), Linode 32 GB (g6-standard-8), shared cpu, $192 / month |
| CPU | AMD EPYC 7642 48-Core Processor, 8 shared vCPUs (KVM) KVM guest, 1 thread per core · L1d 512 KiB (8 instances) · L2 4 MiB (8 instances) · L3 128 MiB (8 instances) · BogoMIPS 4600.00 |
| Memory | 32 GB (32,095 MB usable), swap 8.5 GB (496 MB of Linode + 8 GB made by the installer) |
| Disk, region | 640 GB SSD, Mumbai, India (ap-west) |
| System | Ubuntu 24.04.4 LTS, Linux 6.8.0-134, Docker 29.9.0 |
| API Maker | 4.0.0 : release build of api_maker_be_rust 864bb64 (opt-level 3, fat LTO), installed by its installer (https://apimaker.dev/v4/install.sh), no reverse proxy |
| Settings | the defaults of the installer (lean code of the account runs in the server with QuickJS : sandbox.codeInServer), and the sandboxes kept running for the whole run (removeSandboxInactiveSinceMinutes 1440) |
| Databases | MongoDB 8.0.10 (the MongoDB of API Maker, a replica set of one member, in Docker) · Redis 7.0.5 (the Redis of API Maker, in Docker) · PostgreSQL 18.6 (official image postgres:18, max_connections 500) · MySQL 8.4.11 (official image mysql:8.4, max_connections 500) : all on the same server |
| Sandboxes | TypeScript on Node.js 24.21.0 (an image of 403 MB built by API Maker), 2 sandboxes of the account (sandboxCountForAdmin 2, the default), each opening up to 8 runners when it is busy (one per vCPU) |
| Load generator | Dedicated 64 GB (g6-dedicated-32) : AMD EPYC 7642 48-Core Processor, 32 dedicated vCPUs, Ubuntu 24.04.4 LTS, Node.js 24.21.0, autocannon 8.0.0 with 20 worker threads |
| Network | Private network of the same data centre, round trip 0.37 ms (ping) |
| Host | A strict anti-affinity placement group kept the three shared CPU servers (2, 4 and 8 vCPUs) on three different hosts. All seven servers were measured at the same time, each by a load generator of its own. |
| Date | 12 October 2026, 05:30 to 06:44 UTC |
Only what a database needs was running while it was measured : API Maker and its two sandboxes, its MongoDB and Redis (API Maker always needs them) and the database under test. The other benchmark databases were stopped, API Maker was restarted and the swap emptied back into memory before each database, when it fitted there. How every number was taken : [How API Maker is benchmarked](https://docs.apimaker.dev/v4/docs/benchmarks/methodology.html). Every server side by side : [All results](https://docs.apimaker.dev/v4/docs/benchmarks/summary.html).
## The data
Every table holds the ten rows of the [API Maker benchmark dataset](https://apimaker.dev/json/benchmark_dataset.json) : `https://apimaker.dev/json/benchmark_dataset.json`. Ten customers, ten columns each ; a *get all* answers all ten (2,418 bytes of JSON on MongoDB), a *get by id* one of them.
| `_id` | `customer_id` | `first_name` | `last_name` | `phone` | `last_update` | `pincode` | `shipping_id` | `dob` | `country` |
|---|---|---|---|---|---|---|---|---|---|
| 60ae2488c37cd955cc144161 | 2 | NICK | WAHLBERG | 1123456789 | 2006-02-15T04:34:00.330Z | 111111 | 2 | 2022-10-30T03:25:03.000Z | India |
| 60ae24c8c37cd955cc144162 | 1 | PENELOPE | GUINESS | 123456789 | 2006-02-15T04:34:00.330Z | 100050 | 1 | 2022-10-30T03:25:03.000Z | India |
| 60ae247ac37cd955cc144160 | 3 | ED | CHASE | 2123456789 | 2006-02-15T04:34:00.330Z | 222222 | 3 | 2022-10-30T03:25:03.000Z | India |
| 60ace1401efc56684403c68c | 4 | JENNIFER | DAVIS | 3123456789 | 2006-02-15T04:34:00.330Z | 100050 | 4 | 2022-10-30T03:25:03.000Z | India |
| 60accda51efc56684403c685 | 5 | JOHNNY | LOLLOBRIGIDA | 4123456789 | 2006-02-15T04:34:00.330Z | 485125 | 1 | 2022-10-30T03:25:03.000Z | India |
| 606b7d364bebce00196eade7 | 6 | JOHNNY | LOLLOBRIGIDA | 5123456789 | 2006-02-15T04:34:00.330Z | 123456 | 2 | 2022-10-30T03:25:03.000Z | India |
| 606b75961055000018fa9d98 | 7 | GRACE | MOSTEL | 6123456789 | 2006-02-15T04:34:00.330Z | 356589 | 3 | 2022-10-30T03:25:03.000Z | India |
| 6064dd02730026001956663e | 8 | MATTHEW | JOHANSSON | 7123456789 | 2006-02-15T04:34:00.330Z | 100050 | 4 | 2022-10-30T03:25:03.000Z | India |
| 6064dcb8730026001956663c | 9 | JOE | SWANK | 8123456789 | 2006-02-15T04:34:00.330Z | 251415 | 1 | 2022-10-30T03:25:03.000Z | India |
| 6064c4c02bafb90018955299 | 10 | CHRISTIAN | GABLE | 9123456789 | 2006-02-15T04:34:00.330Z | 100050 | | 2022-10-30T03:25:03.000Z | India |
## Results at a glance
Requests per second, the average of two rounds of 15 seconds with 100 connections. *Public* APIs need no token ; *both tokens* means every request carries `x-am-authorization` (the token of an API user, whose groups decide what it may call) and `x-am-user-authorization` (the token of a row of the `customers` table, made by a DB token generator), and API Maker checks both.
**Requests per second · 8 vCPU, 32 GB RAM, shared CPU** · MongoDB · PostgreSQL · MySQL
Get allpublic · 11,002 · 13,054 · 13,816
Get allboth tokens · 11,882 · 12,013 · 12,645
Get all with cachingpublic · 41,093 · 39,947 · 40,335
Get all with cachingboth tokens · 34,364 · 32,966 · 33,000
Get all by streampublic · 10,646 · 12,914 · 12,489
Get all by streamboth tokens · 11,025 · 12,049 · 11,587
Custom API calling get all QuickJS · public · 8,062 · 9,350 · 9,698
Custom API calling get all QuickJS · both tokens · 8,393 · 8,433 · 8,962
Custom API in the sandbox Sandbox · public · 7,636 · 8,682 · 9,181
Get all with a pre hook QuickJS · both tokens · 8,512 · 9,668 · 10,192
Get by idpublic · 12,297 · 13,656 · 14,402
Get by idboth tokens · 12,654 · 12,548 · 13,222
Get by id with cachingpublic · 44,564 · 43,050 · 43,160
Get by id with cachingboth tokens · 36,219 · 34,322 · 34,667
Insert one rowpublic · 4,620 · 5,754 · 3,532
| API | Access | MongoDB | PostgreSQL | MySQL |
|---|---|--:|--:|--:|
| [Get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all) | Public | **11,002** p99 20 ms | **13,054** p99 9 ms | **13,816** p99 8 ms |
| [Get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all) | Both tokens | **11,882** p99 17 ms | **12,013** p99 10 ms | **12,645** p99 10 ms |
| [Get all with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all-with-caching) | Public | **41,093** p99 3 ms | **39,947** p99 3 ms | **40,335** p99 3 ms |
| [Get all with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all-with-caching) | Both tokens | **34,364** p99 4 ms | **32,966** p99 4 ms | **33,000** p99 4 ms |
| [Get all by stream](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all-by-stream) | Public | **10,646** p99 21 ms | **12,914** p99 9 ms | **12,489** p99 10 ms |
| [Get all by stream](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all-by-stream) | Both tokens | **11,025** p99 18 ms | **12,049** p99 10 ms | **11,587** p99 10 ms |
| [Custom API calling get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#custom-api-calling-get-all) QuickJS | Public | **8,062** p99 23 ms | **9,350** p99 13 ms | **9,698** p99 12 ms |
| [Custom API calling get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#custom-api-calling-get-all) QuickJS | Both tokens | **8,393** p99 21 ms | **8,433** p99 14 ms | **8,962** p99 14 ms |
| [Custom API in the sandbox](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#custom-api-in-the-sandbox) Sandbox | Public | **7,636** p99 28 ms | **8,682** p99 20 ms | **9,181** p99 19 ms |
| [Get all with a pre hook](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all-with-a-pre-hook) QuickJS | Both tokens | **8,512** p99 24 ms | **9,668** p99 12 ms | **10,192** p99 13 ms |
| [Get by id](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-by-id) | Public | **12,297** p99 18 ms | **13,656** p99 8 ms | **14,402** p99 8 ms |
| [Get by id](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-by-id) | Both tokens | **12,654** p99 15 ms | **12,548** p99 10 ms | **13,222** p99 9 ms |
| [Get by id with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-by-id-with-caching) | Public | **44,564** p99 3 ms | **43,050** p99 3 ms | **43,160** p99 3 ms |
| [Get by id with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-by-id-with-caching) | Both tokens | **36,219** p99 4 ms | **34,322** p99 4 ms | **34,667** p99 4 ms |
| [Insert one row](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#insert-one-row) | Public | **4,620** p99 38 ms | **5,754** p99 19 ms | **3,532** p99 35 ms |
| [Custom API without a database](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#custom-api-without-a-database) | Public | **47,967** p99 3 ms | | |
| [Custom API without a database, in the sandbox](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#custom-api-without-a-database) | Public | **27,302** p99 8 ms | | |
(0 errors) Every one of the **30,678,581 requests** of these runs was answered with status 200 or 201 : no error, no timeout.
## Memory
What each part of the server held, in MB : at rest (the 60 seconds after API Maker and its sandboxes started, before any request) and under load. The bars show the second the whole server held the most memory while its database was loaded, out of the 32,095 MB of the server ; the table gives the most each part held on its own. API Maker is the resident memory of its process ; a container is counted the way `docker stats` counts it.
API Maker · MongoDB of API Maker · Redis · PostgreSQL / MySQL · Sandboxes · Linux, Docker, the rest · Available
MongoDB
at rest
under load
PostgreSQL
at rest
under load
MySQL
at rest
under load
| Part | MongoDB at rest → under load | PostgreSQL at rest → under load | MySQL at rest → under load |
|---|--:|--:|--:|
| **API Maker** (process), in RAM | 112 → **154** | 108 → **151** | 110 → **152** |
| … and in swap | 0 → **0** | 0 → **0** | 0 → **0** |
| MongoDB of API Maker, in RAM | 127 → **352** | 334 → **336** | 334 → **336** |
| … and in swap | 0 → **0** | 0 → **0** | 0 → **0** |
| Redis, in RAM | 3 → **4** | 3 → **4** | 3 → **4** |
| Database under test, in RAM | MongoDB above | 39 → **300** | 421 → **516** |
| … and in swap | MongoDB above | 0 → **0** | 0 → **0** |
| Sandboxes (2 containers), in RAM | 55 → **849** | 55 → **894** | 55 → **875** |
| … and in swap | 0 → **0** | 0 → **0** | 0 → **0** |
| **Whole server**, RAM used | 1102 → **2162** | 1341 → **2508** | 1741 → **2710** |
| Swap used | 0 → **0** | 0 → **0** | 0 → **0** |
## CPU
On 8 vCPUs, API Maker, the database and the sandboxes share the same 8 vCPUs : every request costs the work of all of them. During *get all, public*, the CPU was split this way (average of the 15 seconds, in vCPUs : 8.0 is the whole server ; a process counts its own kernel time) :
| | MongoDB | PostgreSQL | MySQL |
|---|--:|--:|--:|
| API Maker | 2.8 vCPU | 3.3 vCPU | 3.4 vCPU |
| The database | 4.1 vCPU | 1.6 vCPU | 1.5 vCPU |
| MongoDB of API Maker (when it is not the one tested) | – | 0.0 vCPU | 0.0 vCPU |
| Sandboxes (idle : no code runs in get all) | 0.0 vCPU | 0.0 vCPU | 0.0 vCPU |
| Whole server busy (of its 8 vCPUs) | 98 % | 78 % | 78 % |
| … of which kernel time (network, disk), counted in the lines above too | 33 % | 29 % | 30 % |
Steal time (CPU the hypervisor gave to other servers) was 0 % on average, 0 % at most. The load generator, sampled the same way, was never more than 12 % busy over its 32 cores : it was never the limit.
## Get all
The schema API of a table answers all its rows : `GET /api/schema////
`. Every request reads the ten rows from the database, converts them with the schema of the table and sends them as JSON. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/schema-apis/auto-generated-schema-based-get-all-api.html).
### Get all : public
No token : the API is public. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
11,002
173,721 requests in 15 s
Latency p50
8ms
average 8.1 ms
Latency p99
20ms
max 51 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **11,582** · 2 : **10,423** req/s · spread 10.5 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.8 vCPU**, **132 MB** RSS · MongoDB **4.1 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **98 %**, of which kernel (network, disk) **33 %** · memory used **1108 MB** of 32095 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
13,054
201,063 requests in 15 s
Latency p50
7ms
average 7.0 ms
Latency p99
9ms
max 13 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **13,405** · 2 : **12,703** req/s · spread 5.4 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.3 vCPU**, **124 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.6 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **78 %**, of which kernel (network, disk) **29 %** · memory used **1379 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
13,816
215,068 requests in 15 s
Latency p50
6ms
average 6.5 ms
Latency p99
8ms
max 13 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **14,339** · 2 : **13,294** req/s · spread 7.6 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.4 vCPU**, **125 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.5 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **78 %**, of which kernel (network, disk) **30 %** · memory used **1760 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all, public · round 1 of 2, the closer to the average
### Get all : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
11,882
187,751 requests in 15 s
Latency p50
7ms
average 7.5 ms
Latency p99
17ms
max 43 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **12,518** · 2 : **11,246** req/s · spread 10.7 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.6 vCPU**, **132 MB** RSS · MongoDB **3.1 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **96 %**, of which kernel (network, disk) **29 %** · memory used **1127 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
12,013
178,911 requests in 15 s
Latency p50
8ms
average 7.9 ms
Latency p99
10ms
max 16 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **12,098** · 2 : **11,928** req/s · spread 1.4 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **3.8 vCPU**, **137 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.4 vCPU** · sandboxes **0.0 vCPU**, **890 MB** · whole server busy **80 %**, of which kernel (network, disk) **27 %** · memory used **2444 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all, both tokens · round 2 of 2, the closer to the average
**MySQL**
Requests / second
12,645
187,770 requests in 15 s
Latency p50
7ms
average 7.5 ms
Latency p99
10ms
max 14 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **12,773** · 2 : **12,518** req/s · spread 2 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **3.9 vCPU**, **137 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.3 vCPU** · sandboxes **0.0 vCPU**, **874 MB** · whole server busy **82 %**, of which kernel (network, disk) **28 %** · memory used **2649 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all, both tokens · round 2 of 2, the closer to the average
## Get all with caching
The same request on a table whose API settings say `enableCaching: true`. The first answer is kept in Redis, under a key made of who asks and what is asked ; the next requests are answered from Redis until the answer expires or something writes the table. [About this API](https://docs.apimaker.dev/v4/docs/features/automatic-caching.html).
### Get all with caching : public
No token : the API is public. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
41,093
634,592 requests in 15 s
Latency p50
2ms
average 1.9 ms
Latency p99
3ms
max 9 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **42,307** · 2 : **39,880** req/s · spread 5.9 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **6.2 vCPU**, **129 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · Redis **0.2 vCPU** · whole server busy **85 %**, of which kernel (network, disk) **27 %** · memory used **1108 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all with caching, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
39,947
601,568 requests in 15 s
Latency p50
2ms
average 2.0 ms
Latency p99
3ms
max 9 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **40,101** · 2 : **39,792** req/s · spread 0.8 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **6.2 vCPU**, **125 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · Redis **0.2 vCPU** · whole server busy **86 %**, of which kernel (network, disk) **26 %** · memory used **1349 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all with caching, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
40,335
605,248 requests in 15 s
Latency p50
2ms
average 2.0 ms
Latency p99
3ms
max 12 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **40,351** · 2 : **40,319** req/s · spread 0.1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **6.2 vCPU**, **126 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **57 MB** · Redis **0.2 vCPU** · whole server busy **86 %**, of which kernel (network, disk) **26 %** · memory used **1731 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all with caching, public · round 1 of 2, the closer to the average
### Get all with caching : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
34,364
511,751 requests in 15 s
Latency p50
2ms
average 2.4 ms
Latency p99
4ms
max 15 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **34,113** · 2 : **34,614** req/s · spread 1.5 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **6.6 vCPU**, **128 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · Redis **0.2 vCPU** · whole server busy **89 %**, of which kernel (network, disk) **23 %** · memory used **1110 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all with caching, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
32,966
491,200 requests in 15 s
Latency p50
3ms
average 2.5 ms
Latency p99
4ms
max 10 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **32,746** · 2 : **33,186** req/s · spread 1.3 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **6.6 vCPU**, **125 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · Redis **0.2 vCPU** · whole server busy **89 %**, of which kernel (network, disk) **22 %** · memory used **1350 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all with caching, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
33,000
494,611 requests in 15 s
Latency p50
3ms
average 2.5 ms
Latency p99
4ms
max 11 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **32,973** · 2 : **33,027** req/s · spread 0.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **6.6 vCPU**, **125 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **57 MB** · Redis **0.2 vCPU** · whole server busy **89 %**, of which kernel (network, disk) **22 %** · memory used **1743 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all with caching, both tokens · round 1 of 2, the closer to the average
## Get all by stream
`GET …/
/stream` : the rows are sent while they are read from the database cursor, so a large table never sits whole in memory. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/schema-apis/auto-generated-schema-based-get-all-by-stream-api.html).
### Get all by stream : public
No token : the API is public. Each answer : 2,477 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
10,646
160,081 requests in 15 s
Latency p50
8ms
average 8.9 ms
Latency p99
21ms
max 44 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **10,673** · 2 : **10,620** req/s · spread 0.5 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.1 vCPU**, **145 MB** RSS · MongoDB **3.8 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **98 %**, of which kernel (network, disk) **30 %** · memory used **1128 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all by stream, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
12,914
191,785 requests in 15 s
Latency p50
7ms
average 7.3 ms
Latency p99
9ms
max 14 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **13,042** · 2 : **12,785** req/s · spread 2 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **3.5 vCPU**, **143 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.5 vCPU** · sandboxes **0.0 vCPU**, **890 MB** · whole server busy **79 %**, of which kernel (network, disk) **28 %** · memory used **2483 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all by stream, public · round 2 of 2, the closer to the average
**MySQL**
Requests / second
12,489
185,952 requests in 15 s
Latency p50
8ms
average 7.6 ms
Latency p99
10ms
max 15 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **12,580** · 2 : **12,398** req/s · spread 1.5 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **3.9 vCPU**, **151 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.2 vCPU** · sandboxes **0.0 vCPU**, **874 MB** · whole server busy **81 %**, of which kernel (network, disk) **27 %** · memory used **2710 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all by stream, public · round 2 of 2, the closer to the average
### Get all by stream : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,577 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
11,025
162,260 requests in 15 s
Latency p50
8ms
average 8.7 ms
Latency p99
18ms
max 41 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **11,232** · 2 : **10,818** req/s · spread 3.8 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **3.9 vCPU**, **150 MB** RSS · MongoDB **2.8 vCPU** · sandboxes **0.0 vCPU**, **848 MB** · whole server busy **96 %**, of which kernel (network, disk) **26 %** · memory used **2162 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all by stream, both tokens · round 2 of 2, the closer to the average
**PostgreSQL**
Requests / second
12,049
180,215 requests in 15 s
Latency p50
8ms
average 7.8 ms
Latency p99
10ms
max 15 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **12,082** · 2 : **12,015** req/s · spread 0.6 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **3.8 vCPU**, **142 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.4 vCPU** · sandboxes **0.0 vCPU**, **890 MB** · whole server busy **80 %**, of which kernel (network, disk) **27 %** · memory used **2508 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all by stream, both tokens · round 2 of 2, the closer to the average
**MySQL**
Requests / second
11,587
174,277 requests in 15 s
Latency p50
8ms
average 8.1 ms
Latency p99
10ms
max 17 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **11,619** · 2 : **11,556** req/s · spread 0.5 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **4.2 vCPU**, **142 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.2 vCPU** · sandboxes **0.0 vCPU**, **57 MB** · whole server busy **82 %**, of which kernel (network, disk) **26 %** · memory used **1779 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all by stream, both tokens · round 1 of 2, the closer to the average
## Custom API calling get all
A custom API written in TypeScript, `return await g.sys.db.getAll({ instance, database, collection })`. This code is *lean* : it only reads what it is handed and asks `g.sys` for a read, so API Maker runs it in the server itself, with QuickJS, on the thread which answers the request, and the request never leaves the server. Code which needs more (a package, the time of the machine, `g.shared`, …) runs in the sandbox of the account : see the next API. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/custom-apis/user-created-custom-api.html).
**The custom API (public : customers_public ; both tokens : customers)**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
return await g.sys.db.getAll({ instance: 'mongodb', database: 'am_bench', collection: 'customers_public' });
}
module.exports = main;
```
### Custom API calling get all : public
No token : the API is public. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
8,062
120,926 requests in 15 s
Latency p50
12ms
average 11.9 ms
Latency p99
23ms
max 39 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **8,062** · 2 : **8,062** req/s · spread 0 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **4.1 vCPU**, **141 MB** RSS · MongoDB **2.9 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **97 %**, of which kernel (network, disk) **25 %** · memory used **1171 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · MongoDB · custom api calling get all, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
9,350
138,597 requests in 15 s
Latency p50
10ms
average 10.3 ms
Latency p99
13ms
max 17 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **9,240** · 2 : **9,460** req/s · spread 2.4 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **4.9 vCPU**, **139 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.2 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **88 %**, of which kernel (network, disk) **22 %** · memory used **1389 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · custom api calling get all, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
9,698
145,990 requests in 15 s
Latency p50
10ms
average 9.8 ms
Latency p99
12ms
max 17 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **9,734** · 2 : **9,662** req/s · spread 0.7 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **4.9 vCPU**, **137 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.0 vCPU** · sandboxes **0.0 vCPU**, **57 MB** · whole server busy **86 %**, of which kernel (network, disk) **22 %** · memory used **1780 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · MySQL · custom api calling get all, public · round 1 of 2, the closer to the average
### Custom API calling get all : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
8,393
127,441 requests in 15 s
Latency p50
11ms
average 11.3 ms
Latency p99
21ms
max 34 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **8,496** · 2 : **8,290** req/s · spread 2.5 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **4.8 vCPU**, **142 MB** RSS · MongoDB **2.1 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **96 %**, of which kernel (network, disk) **21 %** · memory used **1177 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · MongoDB · custom api calling get all, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
8,433
126,032 requests in 15 s
Latency p50
11ms
average 11.4 ms
Latency p99
14ms
max 20 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **8,464** · 2 : **8,402** req/s · spread 0.7 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **5.0 vCPU**, **139 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.0 vCPU** · sandboxes **0.0 vCPU**, **890 MB** · whole server busy **88 %**, of which kernel (network, disk) **21 %** · memory used **2499 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · custom api calling get all, both tokens · round 2 of 2, the closer to the average
**MySQL**
Requests / second
8,962
133,707 requests in 15 s
Latency p50
11ms
average 10.7 ms
Latency p99
14ms
max 20 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **8,914** · 2 : **9,010** req/s · spread 1.1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **5.1 vCPU**, **137 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.0 vCPU** · sandboxes **0.0 vCPU**, **57 MB** · whole server busy **88 %**, of which kernel (network, disk) **21 %** · memory used **1783 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · MySQL · custom api calling get all, both tokens · round 1 of 2, the closer to the average
## Custom API in the sandbox
The same custom API, with one line more : it reads `Date.now()`, the time of the machine, which lean code may not. So this code runs in a sandbox of the account (a container with Node.js 24) : the request goes from API Maker to a runner of the sandbox and back, and the rows are read from inside the sandbox by the core of API Maker loaded there. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/custom-apis/user-created-custom-api.html).
**The custom API which runs in the sandbox**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
const started = Date.now(); // the time of the machine : this code runs in the sandbox of the account
return await g.sys.db.getAll({ instance: 'mongodb', database: 'am_bench', collection: 'customers_public' });
}
module.exports = main;
```
No token : the API is public. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
7,636
113,499 requests in 15 s
Latency p50
12ms
average 12.7 ms
Latency p99
28ms
max 64 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **7,567** · 2 : **7,705** req/s · spread 1.8 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.9 vCPU**, **136 MB** RSS · MongoDB **2.3 vCPU** · sandboxes **3.7 vCPU**, **826 MB** · whole server busy **99 %**, of which kernel (network, disk) **21 %** · memory used **1994 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · MongoDB · custom api in the sandbox, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
8,682
130,504 requests in 15 s
Latency p50
11ms
average 11.0 ms
Latency p99
20ms
max 32 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **8,702** · 2 : **8,662** req/s · spread 0.5 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.3 vCPU**, **133 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.1 vCPU** · sandboxes **3.6 vCPU**, **888 MB** · whole server busy **97 %**, of which kernel (network, disk) **26 %** · memory used **2459 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · custom api in the sandbox, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
9,181
137,527 requests in 15 s
Latency p50
10ms
average 10.4 ms
Latency p99
19ms
max 32 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **9,169** · 2 : **9,194** req/s · spread 0.3 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.4 vCPU**, **133 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.0 vCPU** · sandboxes **3.5 vCPU**, **858 MB** · whole server busy **96 %**, of which kernel (network, disk) **27 %** · memory used **2650 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · MySQL · custom api in the sandbox, public · round 1 of 2, the closer to the average
## Get all with a pre hook
Get all, with both tokens, on a table whose get all API has a pre hook written in TypeScript : before the API, the hook runs (lean code : in the server, with QuickJS), reads the signed-in person from `x-am-user-authorization` and keeps the rows of their country (`g.req.query.find`), the row scoping most applications need. Every row of the dataset is in India, as the person is, so the answer is the same ten rows. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/hooks/preHook-api.html).
**The pre hook of SCHEMA_GET_ALL on customers_pre_hook**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
if (!g.req.isApiRequestFromUser) return;
const person = g.req.auth.authAMDB; // the person, from x-am-user-authorization
if (!person) throw [{ code: T.EStatusCode.UNAUTHORIZED, message: 'Sign in first.' }];
const find = g.req.query.find ? (typeof g.req.query.find === 'string' ? JSON.parse(g.req.query.find) : g.req.query.find) : {};
g.req.query.find = { $and: [find, { country: person.country }] };
}
module.exports = main;
```
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
8,512
129,576 requests in 15 s
Latency p50
11ms
average 11.1 ms
Latency p99
24ms
max 55 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **8,639** · 2 : **8,384** req/s · spread 3 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.8 vCPU**, **140 MB** RSS · MongoDB **3.2 vCPU** · sandboxes **0.0 vCPU**, **831 MB** · whole server busy **97 %**, of which kernel (network, disk) **25 %** · memory used **2008 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all with a pre hook, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
9,668
145,230 requests in 15 s
Latency p50
10ms
average 9.8 ms
Latency p99
12ms
max 21 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **9,682** · 2 : **9,654** req/s · spread 0.3 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **4.4 vCPU**, **138 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.4 vCPU** · sandboxes **0.0 vCPU**, **893 MB** · whole server busy **84 %**, of which kernel (network, disk) **23 %** · memory used **2464 MB** of 32095 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all with a pre hook, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
10,192
153,085 requests in 15 s
Latency p50
9ms
average 9.3 ms
Latency p99
13ms
max 22 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **10,208** · 2 : **10,177** req/s · spread 0.3 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **4.4 vCPU**, **136 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.2 vCPU** · sandboxes **0.0 vCPU**, **858 MB** · whole server busy **84 %**, of which kernel (network, disk) **24 %** · memory used **2669 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all with a pre hook, both tokens · round 1 of 2, the closer to the average
## Get by id
One row by its primary key : `GET …/
/get-by-id/`. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/schema-apis/auto-generated-schema-based-get-by-id-api.html).
### Get by id : public
No token : the API is public. Each answer : 278 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
12,297
181,380 requests in 15 s
Latency p50
7ms
average 7.8 ms
Latency p99
18ms
max 48 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **12,502** · 2 : **12,093** req/s · spread 3.3 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **3.1 vCPU**, **142 MB** RSS · MongoDB **3.6 vCPU** · sandboxes **0.0 vCPU**, **832 MB** · whole server busy **97 %**, of which kernel (network, disk) **32 %** · memory used **2108 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get by id, public · round 2 of 2, the closer to the average
**PostgreSQL**
Requests / second
13,656
204,840 requests in 15 s
Latency p50
7ms
average 6.8 ms
Latency p99
8ms
max 13 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **13,657** · 2 : **13,655** req/s · spread 0 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.1 vCPU**, **138 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.7 vCPU** · sandboxes **0.0 vCPU**, **893 MB** · whole server busy **77 %**, of which kernel (network, disk) **28 %** · memory used **2456 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get by id, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
14,402
214,485 requests in 15 s
Latency p50
6ms
average 6.5 ms
Latency p99
8ms
max 13 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **14,299** · 2 : **14,506** req/s · spread 1.4 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.4 vCPU**, **135 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.4 vCPU** · sandboxes **0.0 vCPU**, **858 MB** · whole server busy **77 %**, of which kernel (network, disk) **29 %** · memory used **2670 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · MySQL · get by id, public · round 1 of 2, the closer to the average
### Get by id : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 278 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
12,654
189,329 requests in 15 s
Latency p50
7ms
average 7.4 ms
Latency p99
15ms
max 29 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **12,622** · 2 : **12,686** req/s · spread 0.5 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.9 vCPU**, **141 MB** RSS · MongoDB **2.6 vCPU** · sandboxes **0.0 vCPU**, **830 MB** · whole server busy **94 %**, of which kernel (network, disk) **27 %** · memory used **1969 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get by id, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
12,548
189,333 requests in 15 s
Latency p50
7ms
average 7.4 ms
Latency p99
10ms
max 17 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **12,623** · 2 : **12,472** req/s · spread 1.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.4 vCPU**, **138 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.6 vCPU** · sandboxes **0.0 vCPU**, **893 MB** · whole server busy **79 %**, of which kernel (network, disk) **26 %** · memory used **2459 MB** of 32095 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get by id, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
13,222
201,103 requests in 15 s
Latency p50
7ms
average 7.0 ms
Latency p99
9ms
max 15 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **13,037** · 2 : **13,408** req/s · spread 2.8 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **3.8 vCPU**, **137 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.3 vCPU** · sandboxes **0.0 vCPU**, **860 MB** · whole server busy **80 %**, of which kernel (network, disk) **27 %** · memory used **2677 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · MySQL · get by id, both tokens · round 2 of 2, the closer to the average
## Get by id with caching
One row by its primary key, on a table with `enableCaching: true` : answered from Redis after the first request. [About this API](https://docs.apimaker.dev/v4/docs/features/automatic-caching.html).
### Get by id with caching : public
No token : the API is public. Each answer : 278 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
44,564
679,518 requests in 15 s
Latency p50
2ms
average 1.7 ms
Latency p99
3ms
max 10 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **45,302** · 2 : **43,826** req/s · spread 3.3 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **6.3 vCPU**, **137 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **830 MB** · Redis **0.2 vCPU** · whole server busy **86 %**, of which kernel (network, disk) **23 %** · memory used **1967 MB** of 32095 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get by id with caching, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
43,050
656,296 requests in 15 s
Latency p50
2ms
average 1.8 ms
Latency p99
3ms
max 9 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **43,752** · 2 : **42,348** req/s · spread 3.3 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **6.2 vCPU**, **134 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **824 MB** · Redis **0.2 vCPU** · whole server busy **85 %**, of which kernel (network, disk) **23 %** · memory used **2415 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get by id with caching, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
43,160
644,159 requests in 15 s
Latency p50
2ms
average 1.8 ms
Latency p99
3ms
max 10 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **42,947** · 2 : **43,372** req/s · spread 1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **6.3 vCPU**, **134 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **858 MB** · Redis **0.2 vCPU** · whole server busy **85 %**, of which kernel (network, disk) **23 %** · memory used **2667 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · MySQL · get by id with caching, public · round 1 of 2, the closer to the average
### Get by id with caching : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 278 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
36,219
531,520 requests in 15 s
Latency p50
2ms
average 2.3 ms
Latency p99
4ms
max 10 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **37,002** · 2 : **35,436** req/s · spread 4.3 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **6.6 vCPU**, **138 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **832 MB** · Redis **0.2 vCPU** · whole server busy **89 %**, of which kernel (network, disk) **20 %** · memory used **2141 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get by id with caching, both tokens · round 2 of 2, the closer to the average
**PostgreSQL**
Requests / second
34,322
506,698 requests in 15 s
Latency p50
2ms
average 2.5 ms
Latency p99
4ms
max 14 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **33,780** · 2 : **34,864** req/s · spread 3.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **6.6 vCPU**, **134 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **824 MB** · Redis **0.2 vCPU** · whole server busy **89 %**, of which kernel (network, disk) **18 %** · memory used **2393 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get by id with caching, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
34,667
515,725 requests in 15 s
Latency p50
2ms
average 2.4 ms
Latency p99
4ms
max 10 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **34,382** · 2 : **34,952** req/s · spread 1.6 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **6.6 vCPU**, **134 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **858 MB** · Redis **0.2 vCPU** · whole server busy **89 %**, of which kernel (network, disk) **20 %** · memory used **2652 MB** of 32095 MB · steal **0 %** · swap not touched
autocannon · MySQL · get by id with caching, both tokens · round 1 of 2, the closer to the average
## Insert one row
`POST …/
/save-single-or-multiple` with one row of 9 columns in the body : the schema checks and converts it, the database writes it, and the saved row is answered. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/schema-apis/auto-generated-schema-based-save-single-or-multiple-api.html).
No token : the API is public. Each answer : 277 bytes (MongoDB), status 201.
**MongoDB**
Requests / second
4,620
67,532 requests in 15 s
Latency p50
21ms
average 21.7 ms
Latency p99
38ms
max 62 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **4,737** · 2 : **4,503** req/s · spread 5.1 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **2.1 vCPU**, **143 MB** RSS · MongoDB **4.2 vCPU** · sandboxes **0.0 vCPU**, **830 MB** · whole server busy **91 %**, of which kernel (network, disk) **27 %** · memory used **2124 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · MongoDB · insert one row, public · round 2 of 2, the closer to the average
**PostgreSQL**
Requests / second
5,754
86,194 requests in 15 s
Latency p50
17ms
average 16.9 ms
Latency p99
19ms
max 35 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **5,747** · 2 : **5,761** req/s · spread 0.3 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.3 vCPU**, **138 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **2.1 vCPU** · sandboxes **0.0 vCPU**, **823 MB** · whole server busy **72 %**, of which kernel (network, disk) **24 %** · memory used **2408 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · insert one row, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
3,532
53,217 requests in 15 s
Latency p50
28ms
average 27.7 ms
Latency p99
35ms
max 42 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,515** · 2 : **3,548** req/s · spread 1 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **1.6 vCPU**, **139 MB** RSS · MongoDB **0.0 vCPU** · MySQL **3.2 vCPU** · sandboxes **0.0 vCPU**, **858 MB** · whole server busy **77 %**, of which kernel (network, disk) **21 %** · memory used **2653 MB** of 32095 MB · steal **0 %** · swap not touched
autocannon · MySQL · insert one row, public · round 2 of 2, the closer to the average
## Custom API without a database
A public custom API whose code returns a small object and reads no database : what running code of the account costs, without a database. Lean code runs in the server itself, with QuickJS ; the same code with `Date.now()` in it runs in a sandbox of the account : the trip from API Maker to the runner in its container and back.
**In the server (lean code)**
**The custom API**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
return { message: 'Hello from API Maker', time: 1 };
}
module.exports = main;
```
Requests / second
47,967
708,272 requests in 15 s
Latency p50
2ms
average 1.6 ms
Latency p99
3ms
max 10 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **47,218** · 2 : **48,716** req/s · spread 3.1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **7.7 vCPU**, **134 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **850 MB** · whole server busy **98 %**, of which kernel (network, disk) **22 %** · memory used **2123 MB** of 32095 MB · steal **0 %** · swap not touched
autocannon · custom API without a database, in the server (lean code) · round 1 of 2, the closer to the average
**In the sandbox**
**The custom API**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
return { message: 'Hello from the sandbox', time: Date.now() };
}
module.exports = main;
```
Requests / second
27,302
417,159 requests in 15 s
Latency p50
3ms
average 3.1 ms
Latency p99
8ms
max 15 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **26,793** · 2 : **27,811** req/s · spread 3.7 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **5.3 vCPU**, **136 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **2.1 vCPU**, **850 MB** · whole server busy **94 %**, of which kernel (network, disk) **23 %** · memory used **2121 MB** of 32096 MB · steal **0 %** · swap not touched
autocannon · custom API without a database, in the sandbox · round 2 of 2, the closer to the average
## More connections
*Get all, public* and *Get by id with caching, public* on MongoDB, one run of 15 seconds for each number of connections. More clients at once wait longer for their answer, and the server keeps answering them all.
### Get all, public, by connections
**Get all, public, MongoDB : requests per second by connections**
10 connectionsp50 1 ms · p99 2 ms · 7,548
50 connectionsp50 4 ms · p99 10 ms · 10,582
100 connectionsp50 8 ms · p99 21 ms · 10,818
250 connectionsp50 22 ms · p99 36 ms · 10,841
500 connectionsp50 47 ms · p99 61 ms · 10,378
1,000 connectionsp50 97 ms · p99 111 ms · 10,268
| Connections | Requests / second | p50 | p99 | Max | Errors | Server busy | API Maker RSS |
|--:|--:|--:|--:|--:|--:|--:|--:|
| 10 | **7,548** | 1 ms | 2 ms | 7 ms | 0 | 73 % | 134 MB |
| 50 | **10,582** | 4 ms | 10 ms | 21 ms | 0 | 95 % | 137 MB |
| 100 | **10,818** | 8 ms | 21 ms | 61 ms | 0 | 98 % | 142 MB |
| 250 | **10,841** | 22 ms | 36 ms | 72 ms | 0 | 98 % | 155 MB |
| 500 | **10,378** | 47 ms | 61 ms | 90 ms | 0 | 98 % | 170 MB |
| 1,000 | **10,268** | 97 ms | 111 ms | 139 ms | 0 | 98 % | 203 MB |
### Get by id with caching, public, by connections
**Get by id with caching, public, MongoDB : requests per second by connections**
10 connectionsp50 0 ms · p99 0 ms · 16,350
50 connectionsp50 1 ms · p99 2 ms · 38,344
100 connectionsp50 2 ms · p99 3 ms · 42,203
250 connectionsp50 5 ms · p99 9 ms · 44,362
500 connectionsp50 11 ms · p99 15 ms · 43,359
1,000 connectionsp50 22 ms · p99 26 ms · 45,183
| Connections | Requests / second | p50 | p99 | Max | Errors | Server busy | API Maker RSS |
|--:|--:|--:|--:|--:|--:|--:|--:|
| 10 | **16,350** | 0 ms | 0 ms | 4 ms | 0 | 55 % | 139 MB |
| 50 | **38,344** | 1 ms | 2 ms | 6 ms | 0 | 85 % | 139 MB |
| 100 | **42,203** | 2 ms | 3 ms | 10 ms | 0 | 85 % | 143 MB |
| 250 | **44,362** | 5 ms | 9 ms | 27 ms | 0 | 87 % | 155 MB |
| 500 | **43,359** | 11 ms | 15 ms | 34 ms | 0 | 87 % | 164 MB |
| 1,000 | **45,183** | 22 ms | 26 ms | 52 ms | 0 | 87 % | 193 MB |
## Questions
### How many requests per second can API Maker serve on 8 shared vCPUs ?
On this 32 GB server, with the database on the same machine : 11,002 requests per second for a whole table of ten rows on MongoDB (PostgreSQL 13,054 · MySQL 13,816), 12,297 for one row by its id, and 44,564 when the answer is cached in Redis. A custom API in TypeScript which reads the table answers 8,062 requests per second when API Maker runs it itself (lean code), 7,636 when it runs in the sandbox of the account.
### How much memory does API Maker use ?
The API Maker process held 112 MB at rest and 154 MB at most under load on this server, in RAM. The rest of the memory went to the databases (MongoDB, Redis, PostgreSQL or MySQL), the sandboxes which run the code of the account, and Linux itself.
### Do the two tokens slow the APIs down ?
API Maker checks both tokens (x-am-authorization and x-am-user-authorization) and the groups of the API user on every request. Get all with both tokens answered 11,882 requests per second on MongoDB (public : 11,002), 12,013 requests per second on PostgreSQL (public : 13,054), 12,645 requests per second on MySQL (public : 13,816). The checks show most where the database does no work : a cached get all answered 34,364 requests per second with both tokens against 41,093 public on MongoDB.
### What does a pre hook cost ?
A pre hook runs code of the account before the API ; a lean hook like this one runs in the server itself, with QuickJS. Get all with a row scoping pre hook answered 8,512 requests per second on MongoDB, against 11,882 for the same API without the hook. On 8 vCPUs, the API, the hook and the database share the same 8 vCPUs.
### Can I run these benchmarks myself ?
Yes : [How API Maker is benchmarked](https://docs.apimaker.dev/v4/docs/benchmarks/methodology.html) gives the dataset, the settings of every API and the exact autocannon commands.
---
# API Maker benchmark : 2 vCPU, 4 GB RAM (Linode dedicated CPU)
> API Maker on 2 dedicated vCPUs, 4 GB (Linode) : 3,712 req/s get all, 16,455 cached, on MongoDB, PostgreSQL and MySQL, with memory and autocannon output.
Source: https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html
Benchmark · Linode (Akamai Cloud) · Dedicated CPU · 12 October 2026
**2 vCPU, 4 GB RAM : 3,712 to 5,418 requests per second for a whole table.**
API Maker 4.0.0 on a Linode Dedicated 4 GB (g6-dedicated-2) : 2 dedicated vCPUs and 4 GB of RAM at $36 a month, its databases on the same machine. Every API was loaded for 15 seconds by autocannon from a second server, two times, on MongoDB, PostgreSQL and MySQL, public and with two tokens, while the server sampled the memory and CPU of every part each second.
Get all · MongoDB
3,712req/s
PostgreSQL 4,782 · MySQL 5,418
Get by id, cached
16,455req/s
answered from Redis · PostgreSQL 16,517 · MySQL 16,379
Custom API · MongoDB
2,591req/s
TypeScript, lean : run in the server · in the sandbox 2,269
API Maker memory
99MB
at rest · 127 MB at most under load
## The server
| | |
|---|---|
| Server | Linode (Akamai Cloud), Dedicated 4 GB (g6-dedicated-2), dedicated cpu, $36 / month |
| CPU | AMD EPYC 7642 48-Core Processor, 2 dedicated vCPUs (KVM) KVM guest, 1 thread per core · L1d 128 KiB (2 instances) · L2 1 MiB (2 instances) · L3 32 MiB (2 instances) · BogoMIPS 4599.99 |
| Memory | 4 GB (3,915 MB usable), swap 4.3 GB (496 MB of Linode + 3.8 GB made by the installer) |
| Disk, region | 80 GB SSD, Mumbai, India (ap-west) |
| System | Ubuntu 24.04.4 LTS, Linux 6.8.0-134, Docker 29.9.0 |
| API Maker | 4.0.0 : release build of api_maker_be_rust 864bb64 (opt-level 3, fat LTO), installed by its installer (https://apimaker.dev/v4/install.sh), no reverse proxy |
| Settings | the defaults of the installer (lean code of the account runs in the server with QuickJS : sandbox.codeInServer), and the sandboxes kept running for the whole run (removeSandboxInactiveSinceMinutes 1440) |
| Databases | MongoDB 8.0.10 (the MongoDB of API Maker, a replica set of one member, in Docker) · Redis 7.0.5 (the Redis of API Maker, in Docker) · PostgreSQL 18.6 (official image postgres:18, max_connections 500) · MySQL 8.4.11 (official image mysql:8.4, max_connections 500) : all on the same server |
| Sandboxes | TypeScript on Node.js 24.21.0 (an image of 403 MB built by API Maker), 2 sandboxes of the account (sandboxCountForAdmin 2, the default), each opening up to 2 runners when it is busy (one per vCPU) |
| Load generator | Dedicated 16 GB (g6-dedicated-8) : AMD EPYC 7642 48-Core Processor, 8 dedicated vCPUs, Ubuntu 24.04.4 LTS, Node.js 24.21.0, autocannon 8.0.0 with 5 worker threads |
| Network | Private network of the same data centre, round trip 0.33 ms (ping) |
| Host | A strict anti-affinity placement group kept the three dedicated CPU servers (2, 4 and 8 vCPUs) on three different hosts. All seven servers were measured at the same time, each by a load generator of its own. |
| Date | 12 October 2026, 05:30 to 06:44 UTC |
Only what a database needs was running while it was measured : API Maker and its two sandboxes, its MongoDB and Redis (API Maker always needs them) and the database under test. The other benchmark databases were stopped, API Maker was restarted and the swap emptied back into memory before each database, when it fitted there. How every number was taken : [How API Maker is benchmarked](https://docs.apimaker.dev/v4/docs/benchmarks/methodology.html). Every server side by side : [All results](https://docs.apimaker.dev/v4/docs/benchmarks/summary.html).
## The data
Every table holds the ten rows of the [API Maker benchmark dataset](https://apimaker.dev/json/benchmark_dataset.json) : `https://apimaker.dev/json/benchmark_dataset.json`. Ten customers, ten columns each ; a *get all* answers all ten (2,418 bytes of JSON on MongoDB), a *get by id* one of them.
| `_id` | `customer_id` | `first_name` | `last_name` | `phone` | `last_update` | `pincode` | `shipping_id` | `dob` | `country` |
|---|---|---|---|---|---|---|---|---|---|
| 60ae2488c37cd955cc144161 | 2 | NICK | WAHLBERG | 1123456789 | 2006-02-15T04:34:00.330Z | 111111 | 2 | 2022-10-30T03:25:03.000Z | India |
| 60ae24c8c37cd955cc144162 | 1 | PENELOPE | GUINESS | 123456789 | 2006-02-15T04:34:00.330Z | 100050 | 1 | 2022-10-30T03:25:03.000Z | India |
| 60ae247ac37cd955cc144160 | 3 | ED | CHASE | 2123456789 | 2006-02-15T04:34:00.330Z | 222222 | 3 | 2022-10-30T03:25:03.000Z | India |
| 60ace1401efc56684403c68c | 4 | JENNIFER | DAVIS | 3123456789 | 2006-02-15T04:34:00.330Z | 100050 | 4 | 2022-10-30T03:25:03.000Z | India |
| 60accda51efc56684403c685 | 5 | JOHNNY | LOLLOBRIGIDA | 4123456789 | 2006-02-15T04:34:00.330Z | 485125 | 1 | 2022-10-30T03:25:03.000Z | India |
| 606b7d364bebce00196eade7 | 6 | JOHNNY | LOLLOBRIGIDA | 5123456789 | 2006-02-15T04:34:00.330Z | 123456 | 2 | 2022-10-30T03:25:03.000Z | India |
| 606b75961055000018fa9d98 | 7 | GRACE | MOSTEL | 6123456789 | 2006-02-15T04:34:00.330Z | 356589 | 3 | 2022-10-30T03:25:03.000Z | India |
| 6064dd02730026001956663e | 8 | MATTHEW | JOHANSSON | 7123456789 | 2006-02-15T04:34:00.330Z | 100050 | 4 | 2022-10-30T03:25:03.000Z | India |
| 6064dcb8730026001956663c | 9 | JOE | SWANK | 8123456789 | 2006-02-15T04:34:00.330Z | 251415 | 1 | 2022-10-30T03:25:03.000Z | India |
| 6064c4c02bafb90018955299 | 10 | CHRISTIAN | GABLE | 9123456789 | 2006-02-15T04:34:00.330Z | 100050 | | 2022-10-30T03:25:03.000Z | India |
## Results at a glance
Requests per second, the average of two rounds of 15 seconds with 100 connections. *Public* APIs need no token ; *both tokens* means every request carries `x-am-authorization` (the token of an API user, whose groups decide what it may call) and `x-am-user-authorization` (the token of a row of the `customers` table, made by a DB token generator), and API Maker checks both.
**Requests per second · 2 vCPU, 4 GB RAM, dedicated CPU** · MongoDB · PostgreSQL · MySQL
Get allpublic · 3,712 · 4,782 · 5,418
Get allboth tokens · 3,564 · 4,384 · 4,939
Get all with cachingpublic · 15,152 · 14,883 · 15,123
Get all with cachingboth tokens · 11,750 · 11,615 · 11,626
Get all by streampublic · 3,661 · 4,837 · 5,034
Get all by streamboth tokens · 3,462 · 4,427 · 4,518
Custom API calling get all QuickJS · public · 2,591 · 3,059 · 3,357
Custom API calling get all QuickJS · both tokens · 2,420 · 2,801 · 3,058
Custom API in the sandbox Sandbox · public · 2,269 · 2,389 · 2,714
Get all with a pre hook QuickJS · both tokens · 2,713 · 3,246 · 3,524
Get by idpublic · 4,323 · 5,090 · 5,874
Get by idboth tokens · 4,044 · 4,626 · 5,304
Get by id with cachingpublic · 16,455 · 16,517 · 16,379
Get by id with cachingboth tokens · 12,553 · 12,500 · 12,515
Insert one rowpublic · 1,735 · 2,335 · 2,081
| API | Access | MongoDB | PostgreSQL | MySQL |
|---|---|--:|--:|--:|
| [Get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-all) | Public | **3,712** p99 68 ms | **4,782** p99 24 ms | **5,418** p99 22 ms |
| [Get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-all) | Both tokens | **3,564** p99 48 ms | **4,384** p99 27 ms | **4,939** p99 24 ms |
| [Get all with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-all-with-caching) | Public | **15,152** p99 10 ms | **14,883** p99 10 ms | **15,123** p99 9 ms |
| [Get all with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-all-with-caching) | Both tokens | **11,750** p99 12 ms | **11,615** p99 12 ms | **11,626** p99 13 ms |
| [Get all by stream](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-all-by-stream) | Public | **3,661** p99 50 ms | **4,837** p99 25 ms | **5,034** p99 23 ms |
| [Get all by stream](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-all-by-stream) | Both tokens | **3,462** p99 48 ms | **4,427** p99 26 ms | **4,518** p99 26 ms |
| [Custom API calling get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#custom-api-calling-get-all) QuickJS | Public | **2,591** p99 62 ms | **3,059** p99 37 ms | **3,357** p99 35 ms |
| [Custom API calling get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#custom-api-calling-get-all) QuickJS | Both tokens | **2,420** p99 67 ms | **2,801** p99 41 ms | **3,058** p99 38 ms |
| [Custom API in the sandbox](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#custom-api-in-the-sandbox) Sandbox | Public | **2,269** p99 77 ms | **2,389** p99 72 ms | **2,714** p99 64 ms |
| [Get all with a pre hook](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-all-with-a-pre-hook) QuickJS | Both tokens | **2,713** p99 61 ms | **3,246** p99 36 ms | **3,524** p99 59 ms |
| [Get by id](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-by-id) | Public | **4,323** p99 42 ms | **5,090** p99 22 ms | **5,874** p99 20 ms |
| [Get by id](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-by-id) | Both tokens | **4,044** p99 41 ms | **4,626** p99 40 ms | **5,304** p99 22 ms |
| [Get by id with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-by-id-with-caching) | Public | **16,455** p99 9 ms | **16,517** p99 9 ms | **16,379** p99 9 ms |
| [Get by id with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#get-by-id-with-caching) | Both tokens | **12,553** p99 12 ms | **12,500** p99 12 ms | **12,515** p99 12 ms |
| [Insert one row](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#insert-one-row) | Public | **1,735** p99 99 ms | **2,335** p99 49 ms | **2,081** p99 54 ms |
| [Custom API without a database](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#custom-api-without-a-database) | Public | **10,790** p99 13 ms | | |
| [Custom API without a database, in the sandbox](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html#custom-api-without-a-database) | Public | **9,953** p99 16 ms | | |
(0 errors) Every one of the **10,989,400 requests** of these runs was answered with status 200 or 201 : no error, no timeout.
## Memory
What each part of the server held, in MB : at rest (the 60 seconds after API Maker and its sandboxes started, before any request) and under load. The bars show the second the whole server held the most memory while its database was loaded, out of the 3,915 MB of the server ; the table gives the most each part held on its own. API Maker is the resident memory of its process ; a container is counted the way `docker stats` counts it.
API Maker · MongoDB of API Maker · Redis · PostgreSQL / MySQL · Sandboxes · Linux, Docker, the rest · Available
MongoDB
at rest
under load
PostgreSQL
at rest
under load
MySQL
at rest
under load
| Part | MongoDB at rest → under load | PostgreSQL at rest → under load | MySQL at rest → under load |
|---|--:|--:|--:|
| **API Maker** (process), in RAM | 99 → **127** | 99 → **120** | 98 → **124** |
| … and in swap | 0 → **0** | 0 → **0** | 0 → **0** |
| MongoDB of API Maker, in RAM | 125 → **234** | 224 → **224** | 224 → **224** |
| … and in swap | 0 → **0** | 0 → **0** | 0 → **0** |
| Redis, in RAM | 3 → **3** | 3 → **3** | 3 → **3** |
| Database under test, in RAM | MongoDB above | 41 → **140** | 422 → **492** |
| … and in swap | MongoDB above | 0 → **0** | 0 → **0** |
| Sandboxes (2 containers), in RAM | 50 → **323** | 50 → **239** | 50 → **238** |
| … and in swap | 0 → **0** | 0 → **0** | 0 → **0** |
| **Whole server**, RAM used | 773 → **1222** | 1000 → **1279** | 1339 → **1600** |
| Swap used | 0 → **0** | 0 → **0** | 0 → **0** |
## CPU
On 2 vCPUs, API Maker, the database and the sandboxes share the same 2 vCPUs : every request costs the work of all of them. During *get all, public*, the CPU was split this way (average of the 15 seconds, in vCPUs : 2.0 is the whole server ; a process counts its own kernel time) :
| | MongoDB | PostgreSQL | MySQL |
|---|--:|--:|--:|
| API Maker | 0.8 vCPU | 0.9 vCPU | 1.0 vCPU |
| The database | 0.8 vCPU | 0.7 vCPU | 0.6 vCPU |
| MongoDB of API Maker (when it is not the one tested) | – | 0.0 vCPU | 0.0 vCPU |
| Sandboxes (idle : no code runs in get all) | 0.0 vCPU | 0.0 vCPU | 0.0 vCPU |
| Whole server busy (of its 2 vCPUs) | 100 % | 98 % | 97 % |
| … of which kernel time (network, disk), counted in the lines above too | 35 % | 38 % | 41 % |
Steal time (CPU the hypervisor gave to other servers) was 0 % on average, 1 % at most. The load generator, sampled the same way, was never more than 17 % busy over its 8 cores : it was never the limit.
## Get all
The schema API of a table answers all its rows : `GET /api/schema////
`. Every request reads the ten rows from the database, converts them with the schema of the table and sends them as JSON. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/schema-apis/auto-generated-schema-based-get-all-api.html).
### Get all : public
No token : the API is public. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
3,712
54,188 requests in 15 s
Latency p50
26ms
average 27.2 ms
Latency p99
68ms
max 218 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,812** · 2 : **3,613** req/s · spread 5.3 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **0.8 vCPU**, **123 MB** RSS · MongoDB **0.8 vCPU** · sandboxes **0.0 vCPU**, **316 MB** · whole server busy **100 %**, of which kernel (network, disk) **35 %** · memory used **1204 MB** of 3915 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all, public · round 2 of 2, the closer to the average
**PostgreSQL**
Requests / second
4,782
71,844 requests in 15 s
Latency p50
20ms
average 20.4 ms
Latency p99
24ms
max 30 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **4,790** · 2 : **4,773** req/s · spread 0.3 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.9 vCPU**, **107 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.7 vCPU** · sandboxes **0.0 vCPU**, **50 MB** · whole server busy **98 %**, of which kernel (network, disk) **38 %** · memory used **979 MB** of 3915 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
5,418
80,980 requests in 15 s
Latency p50
18ms
average 18.0 ms
Latency p99
22ms
max 28 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **5,438** · 2 : **5,399** req/s · spread 0.7 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **1.0 vCPU**, **117 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.6 vCPU** · sandboxes **0.0 vCPU**, **238 MB** · whole server busy **97 %**, of which kernel (network, disk) **41 %** · memory used **1599 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all, public · round 2 of 2, the closer to the average
### Get all : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
3,564
53,764 requests in 15 s
Latency p50
27ms
average 27.4 ms
Latency p99
48ms
max 133 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,585** · 2 : **3,544** req/s · spread 1.1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.9 vCPU**, **114 MB** RSS · MongoDB **0.8 vCPU** · sandboxes **0.0 vCPU**, **51 MB** · whole server busy **100 %**, of which kernel (network, disk) **34 %** · memory used **830 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
4,384
65,174 requests in 15 s
Latency p50
22ms
average 22.5 ms
Latency p99
27ms
max 36 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **4,423** · 2 : **4,346** req/s · spread 1.8 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **1.0 vCPU**, **115 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.6 vCPU** · sandboxes **0.0 vCPU**, **238 MB** · whole server busy **98 %**, of which kernel (network, disk) **35 %** · memory used **1266 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all, both tokens · round 2 of 2, the closer to the average
**MySQL**
Requests / second
4,939
74,517 requests in 15 s
Latency p50
20ms
average 19.6 ms
Latency p99
24ms
max 32 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **4,968** · 2 : **4,910** req/s · spread 1.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.0 vCPU**, **110 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.6 vCPU** · sandboxes **0.0 vCPU**, **51 MB** · whole server busy **98 %**, of which kernel (network, disk) **39 %** · memory used **1358 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all, both tokens · round 1 of 2, the closer to the average
## Get all with caching
The same request on a table whose API settings say `enableCaching: true`. The first answer is kept in Redis, under a key made of who asks and what is asked ; the next requests are answered from Redis until the answer expires or something writes the table. [About this API](https://docs.apimaker.dev/v4/docs/features/automatic-caching.html).
### Get all with caching : public
No token : the API is public. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
15,152
227,064 requests in 15 s
Latency p50
6ms
average 6.1 ms
Latency p99
10ms
max 19 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **15,140** · 2 : **15,165** req/s · spread 0.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.6 vCPU**, **114 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **51 MB** · Redis **0.1 vCPU** · whole server busy **100 %**, of which kernel (network, disk) **45 %** · memory used **827 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all with caching, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
14,883
225,090 requests in 15 s
Latency p50
6ms
average 6.2 ms
Latency p99
10ms
max 20 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **15,007** · 2 : **14,759** req/s · spread 1.7 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.6 vCPU**, **108 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **51 MB** · Redis **0.1 vCPU** · whole server busy **99 %**, of which kernel (network, disk) **45 %** · memory used **968 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all with caching, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
15,123
230,004 requests in 15 s
Latency p50
6ms
average 6.0 ms
Latency p99
9ms
max 19 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **15,335** · 2 : **14,911** req/s · spread 2.8 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.6 vCPU**, **111 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **51 MB** · Redis **0.1 vCPU** · whole server busy **100 %**, of which kernel (network, disk) **45 %** · memory used **1342 MB** of 3915 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all with caching, public · round 1 of 2, the closer to the average
### Get all with caching : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
11,750
177,173 requests in 15 s
Latency p50
8ms
average 8.0 ms
Latency p99
12ms
max 26 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **11,812** · 2 : **11,689** req/s · spread 1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.7 vCPU**, **113 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **51 MB** · Redis **0.1 vCPU** · whole server busy **100 %**, of which kernel (network, disk) **37 %** · memory used **817 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all with caching, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
11,615
176,511 requests in 15 s
Latency p50
8ms
average 8.0 ms
Latency p99
12ms
max 23 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **11,768** · 2 : **11,462** req/s · spread 2.6 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.7 vCPU**, **108 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **51 MB** · Redis **0.1 vCPU** · whole server busy **100 %**, of which kernel (network, disk) **38 %** · memory used **967 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all with caching, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
11,626
171,499 requests in 15 s
Latency p50
8ms
average 8.3 ms
Latency p99
13ms
max 21 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **11,817** · 2 : **11,434** req/s · spread 3.3 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **1.7 vCPU**, **117 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **238 MB** · Redis **0.1 vCPU** · whole server busy **100 %**, of which kernel (network, disk) **38 %** · memory used **1593 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all with caching, both tokens · round 2 of 2, the closer to the average
## Get all by stream
`GET …/
/stream` : the rows are sent while they are read from the database cursor, so a large table never sits whole in memory. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/schema-apis/auto-generated-schema-based-get-all-by-stream-api.html).
### Get all by stream : public
No token : the API is public. Each answer : 2,477 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
3,661
54,760 requests in 15 s
Latency p50
26ms
average 26.9 ms
Latency p99
50ms
max 209 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,670** · 2 : **3,651** req/s · spread 0.5 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **0.9 vCPU**, **122 MB** RSS · MongoDB **0.8 vCPU** · sandboxes **0.0 vCPU**, **316 MB** · whole server busy **100 %**, of which kernel (network, disk) **31 %** · memory used **1209 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all by stream, public · round 2 of 2, the closer to the average
**PostgreSQL**
Requests / second
4,837
72,185 requests in 15 s
Latency p50
20ms
average 20.3 ms
Latency p99
25ms
max 31 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **4,861** · 2 : **4,813** req/s · spread 1 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **0.9 vCPU**, **118 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.7 vCPU** · sandboxes **0.0 vCPU**, **238 MB** · whole server busy **98 %**, of which kernel (network, disk) **38 %** · memory used **1278 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all by stream, public · round 2 of 2, the closer to the average
**MySQL**
Requests / second
5,034
76,176 requests in 15 s
Latency p50
19ms
average 19.2 ms
Latency p99
23ms
max 30 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **5,079** · 2 : **4,988** req/s · spread 1.8 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.0 vCPU**, **118 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.6 vCPU** · sandboxes **0.0 vCPU**, **51 MB** · whole server busy **98 %**, of which kernel (network, disk) **40 %** · memory used **1346 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all by stream, public · round 1 of 2, the closer to the average
### Get all by stream : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,577 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
3,462
51,150 requests in 15 s
Latency p50
29ms
average 28.8 ms
Latency p99
48ms
max 75 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,514** · 2 : **3,411** req/s · spread 3 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **1.0 vCPU**, **122 MB** RSS · MongoDB **0.7 vCPU** · sandboxes **0.0 vCPU**, **316 MB** · whole server busy **100 %**, of which kernel (network, disk) **30 %** · memory used **1210 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all by stream, both tokens · round 2 of 2, the closer to the average
**PostgreSQL**
Requests / second
4,427
66,706 requests in 15 s
Latency p50
22ms
average 22.0 ms
Latency p99
26ms
max 36 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **4,448** · 2 : **4,407** req/s · spread 0.9 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.0 vCPU**, **113 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.6 vCPU** · sandboxes **0.0 vCPU**, **51 MB** · whole server busy **98 %**, of which kernel (network, disk) **37 %** · memory used **974 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all by stream, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
4,518
68,274 requests in 15 s
Latency p50
21ms
average 21.5 ms
Latency p99
26ms
max 33 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **4,552** · 2 : **4,484** req/s · spread 1.5 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.1 vCPU**, **119 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.5 vCPU** · sandboxes **0.0 vCPU**, **51 MB** · whole server busy **98 %**, of which kernel (network, disk) **37 %** · memory used **1348 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all by stream, both tokens · round 1 of 2, the closer to the average
## Custom API calling get all
A custom API written in TypeScript, `return await g.sys.db.getAll({ instance, database, collection })`. This code is *lean* : it only reads what it is handed and asks `g.sys` for a read, so API Maker runs it in the server itself, with QuickJS, on the thread which answers the request, and the request never leaves the server. Code which needs more (a package, the time of the machine, `g.shared`, …) runs in the sandbox of the account : see the next API. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/custom-apis/user-created-custom-api.html).
**The custom API (public : customers_public ; both tokens : customers)**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
return await g.sys.db.getAll({ instance: 'mongodb', database: 'am_bench', collection: 'customers_public' });
}
module.exports = main;
```
### Custom API calling get all : public
No token : the API is public. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
2,591
39,207 requests in 15 s
Latency p50
38ms
average 37.7 ms
Latency p99
62ms
max 86 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **2,614** · 2 : **2,569** req/s · spread 1.8 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.2 vCPU**, **124 MB** RSS · MongoDB **0.6 vCPU** · sandboxes **0.0 vCPU**, **51 MB** · whole server busy **100 %**, of which kernel (network, disk) **25 %** · memory used **885 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MongoDB · custom api calling get all, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
3,059
46,099 requests in 15 s
Latency p50
32ms
average 32.0 ms
Latency p99
37ms
max 46 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,074** · 2 : **3,044** req/s · spread 1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.3 vCPU**, **118 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.4 vCPU** · sandboxes **0.0 vCPU**, **51 MB** · whole server busy **100 %**, of which kernel (network, disk) **25 %** · memory used **986 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · custom api calling get all, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
3,357
49,816 requests in 15 s
Latency p50
30ms
average 29.6 ms
Latency p99
35ms
max 45 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,393** · 2 : **3,321** req/s · spread 2.1 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **1.3 vCPU**, **120 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.4 vCPU** · sandboxes **0.0 vCPU**, **238 MB** · whole server busy **100 %**, of which kernel (network, disk) **27 %** · memory used **1588 MB** of 3915 MB · steal **0 %** · swap not touched
autocannon · MySQL · custom api calling get all, public · round 2 of 2, the closer to the average
### Custom API calling get all : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
2,420
36,267 requests in 15 s
Latency p50
41ms
average 40.8 ms
Latency p99
67ms
max 89 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **2,418** · 2 : **2,422** req/s · spread 0.1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.3 vCPU**, **124 MB** RSS · MongoDB **0.5 vCPU** · sandboxes **0.0 vCPU**, **51 MB** · whole server busy **100 %**, of which kernel (network, disk) **25 %** · memory used **879 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MongoDB · custom api calling get all, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
2,801
42,514 requests in 15 s
Latency p50
35ms
average 34.8 ms
Latency p99
41ms
max 50 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **2,835** · 2 : **2,768** req/s · spread 2.4 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.3 vCPU**, **118 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.4 vCPU** · sandboxes **0.0 vCPU**, **51 MB** · whole server busy **100 %**, of which kernel (network, disk) **24 %** · memory used **988 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · custom api calling get all, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
3,058
46,537 requests in 15 s
Latency p50
32ms
average 31.7 ms
Latency p99
38ms
max 57 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,103** · 2 : **3,014** req/s · spread 2.9 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.4 vCPU**, **119 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.4 vCPU** · sandboxes **0.0 vCPU**, **51 MB** · whole server busy **100 %**, of which kernel (network, disk) **25 %** · memory used **1350 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MySQL · custom api calling get all, both tokens · round 1 of 2, the closer to the average
## Custom API in the sandbox
The same custom API, with one line more : it reads `Date.now()`, the time of the machine, which lean code may not. So this code runs in a sandbox of the account (a container with Node.js 24) : the request goes from API Maker to a runner of the sandbox and back, and the rows are read from inside the sandbox by the core of API Maker loaded there. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/custom-apis/user-created-custom-api.html).
**The custom API which runs in the sandbox**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
const started = Date.now(); // the time of the machine : this code runs in the sandbox of the account
return await g.sys.db.getAll({ instance: 'mongodb', database: 'am_bench', collection: 'customers_public' });
}
module.exports = main;
```
No token : the API is public. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
2,269
34,163 requests in 15 s
Latency p50
42ms
average 43.4 ms
Latency p99
77ms
max 128 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **2,261** · 2 : **2,278** req/s · spread 0.8 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **0.5 vCPU**, **121 MB** RSS · MongoDB **0.5 vCPU** · sandboxes **0.9 vCPU**, **300 MB** · whole server busy **100 %**, of which kernel (network, disk) **22 %** · memory used **1189 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MongoDB · custom api in the sandbox, public · round 2 of 2, the closer to the average
**PostgreSQL**
Requests / second
2,389
35,955 requests in 15 s
Latency p50
40ms
average 41.2 ms
Latency p99
72ms
max 97 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **2,398** · 2 : **2,381** req/s · spread 0.7 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.5 vCPU**, **112 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.4 vCPU** · sandboxes **0.8 vCPU**, **218 MB** · whole server busy **100 %**, of which kernel (network, disk) **26 %** · memory used **1223 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · custom api in the sandbox, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
2,714
40,795 requests in 15 s
Latency p50
35ms
average 36.3 ms
Latency p99
64ms
max 87 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **2,708** · 2 : **2,720** req/s · spread 0.4 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **0.6 vCPU**, **116 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.3 vCPU** · sandboxes **0.9 vCPU**, **226 MB** · whole server busy **100 %**, of which kernel (network, disk) **28 %** · memory used **1582 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MySQL · custom api in the sandbox, public · round 2 of 2, the closer to the average
## Get all with a pre hook
Get all, with both tokens, on a table whose get all API has a pre hook written in TypeScript : before the API, the hook runs (lean code : in the server, with QuickJS), reads the signed-in person from `x-am-user-authorization` and keeps the rows of their country (`g.req.query.find`), the row scoping most applications need. Every row of the dataset is in India, as the person is, so the answer is the same ten rows. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/hooks/preHook-api.html).
**The pre hook of SCHEMA_GET_ALL on customers_pre_hook**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
if (!g.req.isApiRequestFromUser) return;
const person = g.req.auth.authAMDB; // the person, from x-am-user-authorization
if (!person) throw [{ code: T.EStatusCode.UNAUTHORIZED, message: 'Sign in first.' }];
const find = g.req.query.find ? (typeof g.req.query.find === 'string' ? JSON.parse(g.req.query.find) : g.req.query.find) : {};
g.req.query.find = { $and: [find, { country: person.country }] };
}
module.exports = main;
```
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
2,713
40,651 requests in 15 s
Latency p50
36ms
average 36.4 ms
Latency p99
61ms
max 101 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **2,711** · 2 : **2,716** req/s · spread 0.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.1 vCPU**, **122 MB** RSS · MongoDB **0.7 vCPU** · sandboxes **0.0 vCPU**, **323 MB** · whole server busy **100 %**, of which kernel (network, disk) **27 %** · memory used **1185 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all with a pre hook, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
3,246
48,540 requests in 15 s
Latency p50
30ms
average 30.4 ms
Latency p99
36ms
max 49 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,256** · 2 : **3,237** req/s · spread 0.6 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **1.2 vCPU**, **114 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.5 vCPU** · sandboxes **0.0 vCPU**, **217 MB** · whole server busy **100 %**, of which kernel (network, disk) **26 %** · memory used **1239 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all with a pre hook, both tokens · round 2 of 2, the closer to the average
**MySQL**
Requests / second
3,524
52,154 requests in 15 s
Latency p50
27ms
average 28.3 ms
Latency p99
59ms
max 73 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,478** · 2 : **3,569** req/s · spread 2.6 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.2 vCPU**, **117 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.4 vCPU** · sandboxes **0.0 vCPU**, **216 MB** · whole server busy **100 %**, of which kernel (network, disk) **29 %** · memory used **1573 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all with a pre hook, both tokens · round 1 of 2, the closer to the average
## Get by id
One row by its primary key : `GET …/
/get-by-id/`. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/schema-apis/auto-generated-schema-based-get-by-id-api.html).
### Get by id : public
No token : the API is public. Each answer : 278 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
4,323
65,098 requests in 15 s
Latency p50
22ms
average 22.5 ms
Latency p99
42ms
max 109 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **4,340** · 2 : **4,306** req/s · spread 0.8 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.9 vCPU**, **122 MB** RSS · MongoDB **0.8 vCPU** · sandboxes **0.0 vCPU**, **322 MB** · whole server busy **100 %**, of which kernel (network, disk) **34 %** · memory used **1167 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get by id, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
5,090
78,172 requests in 15 s
Latency p50
19ms
average 18.7 ms
Latency p99
22ms
max 30 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **5,212** · 2 : **4,968** req/s · spread 4.8 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.8 vCPU**, **113 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.8 vCPU** · sandboxes **0.0 vCPU**, **218 MB** · whole server busy **98 %**, of which kernel (network, disk) **37 %** · memory used **1222 MB** of 3915 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get by id, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
5,874
88,481 requests in 15 s
Latency p50
16ms
average 16.4 ms
Latency p99
20ms
max 28 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **5,849** · 2 : **5,899** req/s · spread 0.9 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **1.0 vCPU**, **117 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.6 vCPU** · sandboxes **0.0 vCPU**, **216 MB** · whole server busy **98 %**, of which kernel (network, disk) **41 %** · memory used **1576 MB** of 3915 MB · steal **0 %** · swap not touched
autocannon · MySQL · get by id, public · round 2 of 2, the closer to the average
### Get by id : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 278 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
4,044
60,933 requests in 15 s
Latency p50
24ms
average 24.1 ms
Latency p99
41ms
max 85 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **4,025** · 2 : **4,063** req/s · spread 0.9 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **1.0 vCPU**, **123 MB** RSS · MongoDB **0.7 vCPU** · sandboxes **0.0 vCPU**, **213 MB** · whole server busy **100 %**, of which kernel (network, disk) **32 %** · memory used **1116 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get by id, both tokens · round 2 of 2, the closer to the average
**PostgreSQL**
Requests / second
4,626
69,317 requests in 15 s
Latency p50
20ms
average 21.1 ms
Latency p99
40ms
max 59 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **4,622** · 2 : **4,631** req/s · spread 0.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.9 vCPU**, **114 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.7 vCPU** · sandboxes **0.0 vCPU**, **218 MB** · whole server busy **98 %**, of which kernel (network, disk) **34 %** · memory used **1231 MB** of 3915 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get by id, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
5,304
79,346 requests in 15 s
Latency p50
18ms
average 18.4 ms
Latency p99
22ms
max 31 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **5,290** · 2 : **5,318** req/s · spread 0.5 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.0 vCPU**, **116 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.6 vCPU** · sandboxes **0.0 vCPU**, **216 MB** · whole server busy **98 %**, of which kernel (network, disk) **36 %** · memory used **1561 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MySQL · get by id, both tokens · round 1 of 2, the closer to the average
## Get by id with caching
One row by its primary key, on a table with `enableCaching: true` : answered from Redis after the first request. [About this API](https://docs.apimaker.dev/v4/docs/features/automatic-caching.html).
### Get by id with caching : public
No token : the API is public. Each answer : 278 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
16,455
245,386 requests in 15 s
Latency p50
6ms
average 5.6 ms
Latency p99
9ms
max 20 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **16,358** · 2 : **16,552** req/s · spread 1.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.6 vCPU**, **120 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **215 MB** · Redis **0.1 vCPU** · whole server busy **99 %**, of which kernel (network, disk) **41 %** · memory used **1074 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get by id with caching, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
16,517
249,145 requests in 15 s
Latency p50
5ms
average 5.5 ms
Latency p99
9ms
max 19 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **16,610** · 2 : **16,423** req/s · spread 1.1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.6 vCPU**, **113 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **218 MB** · Redis **0.1 vCPU** · whole server busy **99 %**, of which kernel (network, disk) **41 %** · memory used **1243 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get by id with caching, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
16,379
250,574 requests in 15 s
Latency p50
5ms
average 5.5 ms
Latency p99
9ms
max 21 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **16,705** · 2 : **16,053** req/s · spread 4 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.6 vCPU**, **116 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **216 MB** · Redis **0.1 vCPU** · whole server busy **100 %**, of which kernel (network, disk) **41 %** · memory used **1564 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MySQL · get by id with caching, public · round 1 of 2, the closer to the average
### Get by id with caching : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 278 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
12,553
186,441 requests in 15 s
Latency p50
8ms
average 7.5 ms
Latency p99
12ms
max 24 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **12,430** · 2 : **12,675** req/s · spread 2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.7 vCPU**, **118 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **215 MB** · Redis **0.1 vCPU** · whole server busy **100 %**, of which kernel (network, disk) **34 %** · memory used **1042 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get by id with caching, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
12,500
189,138 requests in 15 s
Latency p50
7ms
average 7.4 ms
Latency p99
12ms
max 24 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **12,610** · 2 : **12,390** req/s · spread 1.8 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.7 vCPU**, **113 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **218 MB** · Redis **0.1 vCPU** · whole server busy **100 %**, of which kernel (network, disk) **34 %** · memory used **1246 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get by id with caching, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
12,515
189,084 requests in 15 s
Latency p50
7ms
average 7.4 ms
Latency p99
12ms
max 23 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **12,606** · 2 : **12,423** req/s · spread 1.5 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.7 vCPU**, **116 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **216 MB** · Redis **0.1 vCPU** · whole server busy **100 %**, of which kernel (network, disk) **34 %** · memory used **1565 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MySQL · get by id with caching, both tokens · round 1 of 2, the closer to the average
## Insert one row
`POST …/
/save-single-or-multiple` with one row of 9 columns in the body : the schema checks and converts it, the database writes it, and the saved row is answered. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/schema-apis/auto-generated-schema-based-save-single-or-multiple-api.html).
No token : the API is public. Each answer : 277 bytes (MongoDB), status 201.
**MongoDB**
Requests / second
1,735
25,621 requests in 15 s
Latency p50
58ms
average 58.0 ms
Latency p99
99ms
max 222 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **1,708** · 2 : **1,762** req/s · spread 3.1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.7 vCPU**, **123 MB** RSS · MongoDB **1.0 vCPU** · sandboxes **0.0 vCPU**, **214 MB** · whole server busy **100 %**, of which kernel (network, disk) **32 %** · memory used **1099 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MongoDB · insert one row, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
2,335
35,428 requests in 15 s
Latency p50
42ms
average 41.8 ms
Latency p99
49ms
max 55 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **2,362** · 2 : **2,308** req/s · spread 2.3 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.7 vCPU**, **114 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.8 vCPU** · sandboxes **0.0 vCPU**, **218 MB** · whole server busy **97 %**, of which kernel (network, disk) **37 %** · memory used **1232 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · insert one row, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
2,081
30,894 requests in 15 s
Latency p50
48ms
average 48.0 ms
Latency p99
54ms
max 63 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **2,060** · 2 : **2,102** req/s · spread 2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **0.6 vCPU**, **117 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.7 vCPU** · sandboxes **0.0 vCPU**, **216 MB** · whole server busy **93 %**, of which kernel (network, disk) **42 %** · memory used **1558 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · MySQL · insert one row, public · round 1 of 2, the closer to the average
## Custom API without a database
A public custom API whose code returns a small object and reads no database : what running code of the account costs, without a database. Lean code runs in the server itself, with QuickJS ; the same code with `Date.now()` in it runs in a sandbox of the account : the trip from API Maker to the runner in its container and back.
**In the server (lean code)**
**The custom API**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
return { message: 'Hello from API Maker', time: 1 };
}
module.exports = main;
```
Requests / second
10,790
162,138 requests in 15 s
Latency p50
9ms
average 8.8 ms
Latency p99
13ms
max 22 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **10,810** · 2 : **10,771** req/s · spread 0.4 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.0 vCPU**, **116 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **315 MB** · whole server busy **100 %**, of which kernel (network, disk) **25 %** · memory used **1187 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · custom API without a database, in the server (lean code) · round 1 of 2, the closer to the average
**In the sandbox**
**The custom API**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
return { message: 'Hello from the sandbox', time: Date.now() };
}
module.exports = main;
```
Requests / second
9,953
149,055 requests in 15 s
Latency p50
10ms
average 9.6 ms
Latency p99
16ms
max 25 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **9,968** · 2 : **9,938** req/s · spread 0.3 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **1.3 vCPU**, **120 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.6 vCPU**, **314 MB** · whole server busy **100 %**, of which kernel (network, disk) **28 %** · memory used **1197 MB** of 3916 MB · steal **0 %** · swap not touched
autocannon · custom API without a database, in the sandbox · round 2 of 2, the closer to the average
## More connections
*Get all, public* and *Get by id with caching, public* on MongoDB, one run of 15 seconds for each number of connections. More clients at once wait longer for their answer, and the server keeps answering them all.
### Get all, public, by connections
**Get all, public, MongoDB : requests per second by connections**
10 connectionsp50 2 ms · p99 5 ms · 3,698
50 connectionsp50 12 ms · p99 24 ms · 3,830
100 connectionsp50 25 ms · p99 67 ms · 3,769
250 connectionsp50 69 ms · p99 128 ms · 3,483
500 connectionsp50 139 ms · p99 163 ms · 3,578
1,000 connectionsp50 277 ms · p99 309 ms · 3,572
| Connections | Requests / second | p50 | p99 | Max | Errors | Server busy | API Maker RSS |
|--:|--:|--:|--:|--:|--:|--:|--:|
| 10 | **3,698** | 2 ms | 5 ms | 12 ms | 0 | 97 % | 115 MB |
| 50 | **3,830** | 12 ms | 24 ms | 81 ms | 0 | 100 % | 118 MB |
| 100 | **3,769** | 25 ms | 67 ms | 206 ms | 0 | 100 % | 122 MB |
| 250 | **3,483** | 69 ms | 128 ms | 194 ms | 0 | 100 % | 133 MB |
| 500 | **3,578** | 139 ms | 163 ms | 246 ms | 0 | 100 % | 148 MB |
| 1,000 | **3,572** | 277 ms | 309 ms | 399 ms | 0 | 100 % | 182 MB |
### Get by id with caching, public, by connections
**Get by id with caching, public, MongoDB : requests per second by connections**
10 connectionsp50 0 ms · p99 1 ms · 11,206
50 connectionsp50 3 ms · p99 5 ms · 15,740
100 connectionsp50 6 ms · p99 9 ms · 16,389
250 connectionsp50 14 ms · p99 20 ms · 16,938
500 connectionsp50 29 ms · p99 38 ms · 16,599
1,000 connectionsp50 72 ms · p99 83 ms · 13,672
| Connections | Requests / second | p50 | p99 | Max | Errors | Server busy | API Maker RSS |
|--:|--:|--:|--:|--:|--:|--:|--:|
| 10 | **11,206** | 0 ms | 1 ms | 7 ms | 0 | 90 % | 120 MB |
| 50 | **15,740** | 3 ms | 5 ms | 12 ms | 0 | 99 % | 119 MB |
| 100 | **16,389** | 6 ms | 9 ms | 21 ms | 0 | 100 % | 121 MB |
| 250 | **16,938** | 14 ms | 20 ms | 45 ms | 0 | 100 % | 131 MB |
| 500 | **16,599** | 29 ms | 38 ms | 69 ms | 0 | 100 % | 146 MB |
| 1,000 | **13,672** | 72 ms | 83 ms | 156 ms | 0 | 100 % | 174 MB |
## Questions
### How many requests per second can API Maker serve on 2 dedicated vCPUs ?
On this 4 GB server, with the database on the same machine : 3,712 requests per second for a whole table of ten rows on MongoDB (PostgreSQL 4,782 · MySQL 5,418), 4,323 for one row by its id, and 16,455 when the answer is cached in Redis. A custom API in TypeScript which reads the table answers 2,591 requests per second when API Maker runs it itself (lean code), 2,269 when it runs in the sandbox of the account.
### How much memory does API Maker use ?
The API Maker process held 99 MB at rest and 127 MB at most under load on this server, in RAM. The rest of the memory went to the databases (MongoDB, Redis, PostgreSQL or MySQL), the sandboxes which run the code of the account, and Linux itself.
### Do the two tokens slow the APIs down ?
API Maker checks both tokens (x-am-authorization and x-am-user-authorization) and the groups of the API user on every request. Get all with both tokens answered 3,564 requests per second on MongoDB (public : 3,712), 4,384 requests per second on PostgreSQL (public : 4,782), 4,939 requests per second on MySQL (public : 5,418). The checks show most where the database does no work : a cached get all answered 11,750 requests per second with both tokens against 15,152 public on MongoDB.
### What does a pre hook cost ?
A pre hook runs code of the account before the API ; a lean hook like this one runs in the server itself, with QuickJS. Get all with a row scoping pre hook answered 2,713 requests per second on MongoDB, against 3,564 for the same API without the hook. On 2 vCPUs, the API, the hook and the database share the same 2 vCPUs.
### Can I run these benchmarks myself ?
Yes : [How API Maker is benchmarked](https://docs.apimaker.dev/v4/docs/benchmarks/methodology.html) gives the dataset, the settings of every API and the exact autocannon commands.
---
# API Maker benchmark : 4 vCPU, 8 GB RAM (Linode dedicated CPU)
> API Maker on 4 dedicated vCPUs, 8 GB (Linode) : 7,614 req/s get all, 32,588 cached, on MongoDB, PostgreSQL and MySQL, with memory and autocannon output.
Source: https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html
Benchmark · Linode (Akamai Cloud) · Dedicated CPU · 12 October 2026
**4 vCPU, 8 GB RAM : 7,614 to 10,000 requests per second for a whole table.**
API Maker 4.0.0 on a Linode Dedicated 8 GB (g6-dedicated-4) : 4 dedicated vCPUs and 8 GB of RAM at $72 a month, its databases on the same machine. Every API was loaded for 15 seconds by autocannon from a second server, two times, on MongoDB, PostgreSQL and MySQL, public and with two tokens, while the server sampled the memory and CPU of every part each second.
Get all · MongoDB
7,614req/s
PostgreSQL 8,912 · MySQL 10,000
Get by id, cached
32,588req/s
answered from Redis · PostgreSQL 33,015 · MySQL 32,897
Custom API · MongoDB
5,228req/s
TypeScript, lean : run in the server · in the sandbox 4,491
API Maker memory
104MB
at rest · 140 MB at most under load
## The server
| | |
|---|---|
| Server | Linode (Akamai Cloud), Dedicated 8 GB (g6-dedicated-4), dedicated cpu, $72 / month |
| CPU | AMD EPYC 7642 48-Core Processor, 4 dedicated vCPUs (KVM) KVM guest, 1 thread per core · L1d 256 KiB (4 instances) · L2 2 MiB (4 instances) · L3 64 MiB (4 instances) · BogoMIPS 4599.99 |
| Memory | 8 GB (7,941 MB usable), swap 8.3 GB (496 MB of Linode + 7.8 GB made by the installer) |
| Disk, region | 160 GB SSD, Mumbai, India (ap-west) |
| System | Ubuntu 24.04.4 LTS, Linux 6.8.0-134, Docker 29.9.0 |
| API Maker | 4.0.0 : release build of api_maker_be_rust 864bb64 (opt-level 3, fat LTO), installed by its installer (https://apimaker.dev/v4/install.sh), no reverse proxy |
| Settings | the defaults of the installer (lean code of the account runs in the server with QuickJS : sandbox.codeInServer), and the sandboxes kept running for the whole run (removeSandboxInactiveSinceMinutes 1440) |
| Databases | MongoDB 8.0.10 (the MongoDB of API Maker, a replica set of one member, in Docker) · Redis 7.0.5 (the Redis of API Maker, in Docker) · PostgreSQL 18.6 (official image postgres:18, max_connections 500) · MySQL 8.4.11 (official image mysql:8.4, max_connections 500) : all on the same server |
| Sandboxes | TypeScript on Node.js 24.21.0 (an image of 403 MB built by API Maker), 2 sandboxes of the account (sandboxCountForAdmin 2, the default), each opening up to 4 runners when it is busy (one per vCPU) |
| Load generator | Dedicated 32 GB (g6-dedicated-16) : AMD EPYC 7642 48-Core Processor, 16 dedicated vCPUs, Ubuntu 24.04.4 LTS, Node.js 24.21.0, autocannon 8.0.0 with 10 worker threads |
| Network | Private network of the same data centre, round trip 0.32 ms (ping) |
| Host | A strict anti-affinity placement group kept the three dedicated CPU servers (2, 4 and 8 vCPUs) on three different hosts. All seven servers were measured at the same time, each by a load generator of its own. |
| Date | 12 October 2026, 05:30 to 06:44 UTC |
Only what a database needs was running while it was measured : API Maker and its two sandboxes, its MongoDB and Redis (API Maker always needs them) and the database under test. The other benchmark databases were stopped, API Maker was restarted and the swap emptied back into memory before each database, when it fitted there. How every number was taken : [How API Maker is benchmarked](https://docs.apimaker.dev/v4/docs/benchmarks/methodology.html). Every server side by side : [All results](https://docs.apimaker.dev/v4/docs/benchmarks/summary.html).
## The data
Every table holds the ten rows of the [API Maker benchmark dataset](https://apimaker.dev/json/benchmark_dataset.json) : `https://apimaker.dev/json/benchmark_dataset.json`. Ten customers, ten columns each ; a *get all* answers all ten (2,418 bytes of JSON on MongoDB), a *get by id* one of them.
| `_id` | `customer_id` | `first_name` | `last_name` | `phone` | `last_update` | `pincode` | `shipping_id` | `dob` | `country` |
|---|---|---|---|---|---|---|---|---|---|
| 60ae2488c37cd955cc144161 | 2 | NICK | WAHLBERG | 1123456789 | 2006-02-15T04:34:00.330Z | 111111 | 2 | 2022-10-30T03:25:03.000Z | India |
| 60ae24c8c37cd955cc144162 | 1 | PENELOPE | GUINESS | 123456789 | 2006-02-15T04:34:00.330Z | 100050 | 1 | 2022-10-30T03:25:03.000Z | India |
| 60ae247ac37cd955cc144160 | 3 | ED | CHASE | 2123456789 | 2006-02-15T04:34:00.330Z | 222222 | 3 | 2022-10-30T03:25:03.000Z | India |
| 60ace1401efc56684403c68c | 4 | JENNIFER | DAVIS | 3123456789 | 2006-02-15T04:34:00.330Z | 100050 | 4 | 2022-10-30T03:25:03.000Z | India |
| 60accda51efc56684403c685 | 5 | JOHNNY | LOLLOBRIGIDA | 4123456789 | 2006-02-15T04:34:00.330Z | 485125 | 1 | 2022-10-30T03:25:03.000Z | India |
| 606b7d364bebce00196eade7 | 6 | JOHNNY | LOLLOBRIGIDA | 5123456789 | 2006-02-15T04:34:00.330Z | 123456 | 2 | 2022-10-30T03:25:03.000Z | India |
| 606b75961055000018fa9d98 | 7 | GRACE | MOSTEL | 6123456789 | 2006-02-15T04:34:00.330Z | 356589 | 3 | 2022-10-30T03:25:03.000Z | India |
| 6064dd02730026001956663e | 8 | MATTHEW | JOHANSSON | 7123456789 | 2006-02-15T04:34:00.330Z | 100050 | 4 | 2022-10-30T03:25:03.000Z | India |
| 6064dcb8730026001956663c | 9 | JOE | SWANK | 8123456789 | 2006-02-15T04:34:00.330Z | 251415 | 1 | 2022-10-30T03:25:03.000Z | India |
| 6064c4c02bafb90018955299 | 10 | CHRISTIAN | GABLE | 9123456789 | 2006-02-15T04:34:00.330Z | 100050 | | 2022-10-30T03:25:03.000Z | India |
## Results at a glance
Requests per second, the average of two rounds of 15 seconds with 100 connections. *Public* APIs need no token ; *both tokens* means every request carries `x-am-authorization` (the token of an API user, whose groups decide what it may call) and `x-am-user-authorization` (the token of a row of the `customers` table, made by a DB token generator), and API Maker checks both.
**Requests per second · 4 vCPU, 8 GB RAM, dedicated CPU** · MongoDB · PostgreSQL · MySQL
Get allpublic · 7,614 · 8,912 · 10,000
Get allboth tokens · 7,220 · 8,245 · 9,236
Get all with cachingpublic · 29,762 · 30,205 · 30,217
Get all with cachingboth tokens · 23,619 · 24,179 · 24,025
Get all by streampublic · 7,342 · 9,098 · 9,458
Get all by streamboth tokens · 6,933 · 8,490 · 8,733
Custom API calling get all QuickJS · public · 5,228 · 5,886 · 6,513
Custom API calling get all QuickJS · both tokens · 4,933 · 5,442 · 6,032
Custom API in the sandbox Sandbox · public · 4,491 · 4,673 · 5,174
Get all with a pre hook QuickJS · both tokens · 5,460 · 6,280 · 6,820
Get by idpublic · 8,777 · 9,655 · 10,654
Get by idboth tokens · 8,182 · 8,790 · 9,758
Get by id with cachingpublic · 32,588 · 33,015 · 32,897
Get by id with cachingboth tokens · 25,516 · 25,875 · 25,837
Insert one rowpublic · 3,574 · 4,236 · 3,462
| API | Access | MongoDB | PostgreSQL | MySQL |
|---|---|--:|--:|--:|
| [Get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-all) | Public | **7,614** p99 28 ms | **8,912** p99 13 ms | **10,000** p99 11 ms |
| [Get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-all) | Both tokens | **7,220** p99 27 ms | **8,245** p99 14 ms | **9,236** p99 12 ms |
| [Get all with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-all-with-caching) | Public | **29,762** p99 5 ms | **30,205** p99 5 ms | **30,217** p99 5 ms |
| [Get all with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-all-with-caching) | Both tokens | **23,619** p99 6 ms | **24,179** p99 6 ms | **24,025** p99 6 ms |
| [Get all by stream](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-all-by-stream) | Public | **7,342** p99 27 ms | **9,098** p99 13 ms | **9,458** p99 12 ms |
| [Get all by stream](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-all-by-stream) | Both tokens | **6,933** p99 26 ms | **8,490** p99 13 ms | **8,733** p99 13 ms |
| [Custom API calling get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#custom-api-calling-get-all) QuickJS | Public | **5,228** p99 32 ms | **5,886** p99 19 ms | **6,513** p99 17 ms |
| [Custom API calling get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#custom-api-calling-get-all) QuickJS | Both tokens | **4,933** p99 35 ms | **5,442** p99 21 ms | **6,032** p99 19 ms |
| [Custom API in the sandbox](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#custom-api-in-the-sandbox) Sandbox | Public | **4,491** p99 41 ms | **4,673** p99 38 ms | **5,174** p99 35 ms |
| [Get all with a pre hook](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-all-with-a-pre-hook) QuickJS | Both tokens | **5,460** p99 31 ms | **6,280** p99 18 ms | **6,820** p99 17 ms |
| [Get by id](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-by-id) | Public | **8,777** p99 22 ms | **9,655** p99 12 ms | **10,654** p99 11 ms |
| [Get by id](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-by-id) | Both tokens | **8,182** p99 22 ms | **8,790** p99 13 ms | **9,758** p99 12 ms |
| [Get by id with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-by-id-with-caching) | Public | **32,588** p99 4 ms | **33,015** p99 4 ms | **32,897** p99 4 ms |
| [Get by id with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#get-by-id-with-caching) | Both tokens | **25,516** p99 6 ms | **25,875** p99 5 ms | **25,837** p99 5 ms |
| [Insert one row](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#insert-one-row) | Public | **3,574** p99 52 ms | **4,236** p99 28 ms | **3,462** p99 33 ms |
| [Custom API without a database](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#custom-api-without-a-database) | Public | **21,532** p99 8 ms | | |
| [Custom API without a database, in the sandbox](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html#custom-api-without-a-database) | Public | **18,562** p99 10 ms | | |
(0 errors) Every one of the **21,624,231 requests** of these runs was answered with status 200 or 201 : no error, no timeout.
## Memory
What each part of the server held, in MB : at rest (the 60 seconds after API Maker and its sandboxes started, before any request) and under load. The bars show the second the whole server held the most memory while its database was loaded, out of the 7,941 MB of the server ; the table gives the most each part held on its own. API Maker is the resident memory of its process ; a container is counted the way `docker stats` counts it.
API Maker · MongoDB of API Maker · Redis · PostgreSQL / MySQL · Sandboxes · Linux, Docker, the rest · Available
MongoDB
at rest
under load
PostgreSQL
at rest
under load
MySQL
at rest
under load
| Part | MongoDB at rest → under load | PostgreSQL at rest → under load | MySQL at rest → under load |
|---|--:|--:|--:|
| **API Maker** (process), in RAM | 104 → **140** | 105 → **132** | 106 → **133** |
| … and in swap | 0 → **0** | 0 → **0** | 0 → **0** |
| MongoDB of API Maker, in RAM | 126 → **305** | 291 → **292** | 291 → **292** |
| … and in swap | 0 → **0** | 0 → **0** | 0 → **0** |
| Redis, in RAM | 3 → **4** | 3 → **4** | 3 → **4** |
| Database under test, in RAM | MongoDB above | 38 → **213** | 421 → **505** |
| … and in swap | MongoDB above | 0 → **0** | 0 → **0** |
| Sandboxes (2 containers), in RAM | 55 → **515** | 55 → **481** | 53 → **505** |
| … and in swap | 0 → **0** | 0 → **0** | 0 → **0** |
| **Whole server**, RAM used | 872 → **1561** | 1079 → **1723** | 1457 → **2024** |
| Swap used | 0 → **0** | 0 → **0** | 0 → **0** |
## CPU
On 4 vCPUs, API Maker, the database and the sandboxes share the same 4 vCPUs : every request costs the work of all of them. During *get all, public*, the CPU was split this way (average of the 15 seconds, in vCPUs : 4.0 is the whole server ; a process counts its own kernel time) :
| | MongoDB | PostgreSQL | MySQL |
|---|--:|--:|--:|
| API Maker | 1.7 vCPU | 1.7 vCPU | 1.7 vCPU |
| The database | 1.7 vCPU | 1.3 vCPU | 1.2 vCPU |
| MongoDB of API Maker (when it is not the one tested) | – | 0.0 vCPU | 0.0 vCPU |
| Sandboxes (idle : no code runs in get all) | 0.0 vCPU | 0.0 vCPU | 0.0 vCPU |
| Whole server busy (of its 4 vCPUs) | 99 % | 90 % | 90 % |
| … of which kernel time (network, disk), counted in the lines above too | 35 % | 35 % | 39 % |
Steal time (CPU the hypervisor gave to other servers) was 0 % on average, 0 % at most. The load generator, sampled the same way, was never more than 16 % busy over its 16 cores : it was never the limit.
## Get all
The schema API of a table answers all its rows : `GET /api/schema////
`. Every request reads the ten rows from the database, converts them with the schema of the table and sends them as JSON. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/schema-apis/auto-generated-schema-based-get-all-api.html).
### Get all : public
No token : the API is public. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
7,614
116,261 requests in 15 s
Latency p50
12ms
average 12.4 ms
Latency p99
28ms
max 69 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **7,751** · 2 : **7,476** req/s · spread 3.6 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.7 vCPU**, **123 MB** RSS · MongoDB **1.7 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **99 %**, of which kernel (network, disk) **35 %** · memory used **916 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
8,912
134,114 requests in 15 s
Latency p50
11ms
average 10.7 ms
Latency p99
13ms
max 18 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **8,941** · 2 : **8,883** req/s · spread 0.7 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.7 vCPU**, **116 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.3 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **90 %**, of which kernel (network, disk) **35 %** · memory used **1103 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
10,000
152,379 requests in 15 s
Latency p50
9ms
average 9.3 ms
Latency p99
11ms
max 18 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **10,160** · 2 : **9,840** req/s · spread 3.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.7 vCPU**, **117 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.2 vCPU** · sandboxes **0.0 vCPU**, **53 MB** · whole server busy **90 %**, of which kernel (network, disk) **39 %** · memory used **1480 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all, public · round 1 of 2, the closer to the average
### Get all : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
7,220
107,315 requests in 15 s
Latency p50
13ms
average 13.5 ms
Latency p99
27ms
max 57 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **7,285** · 2 : **7,155** req/s · spread 1.8 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **1.9 vCPU**, **132 MB** RSS · MongoDB **1.5 vCPU** · sandboxes **0.0 vCPU**, **510 MB** · whole server busy **99 %**, of which kernel (network, disk) **33 %** · memory used **1513 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all, both tokens · round 2 of 2, the closer to the average
**PostgreSQL**
Requests / second
8,245
124,348 requests in 15 s
Latency p50
12ms
average 11.6 ms
Latency p99
14ms
max 21 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **8,291** · 2 : **8,200** req/s · spread 1.1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.9 vCPU**, **117 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.2 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **91 %**, of which kernel (network, disk) **34 %** · memory used **1105 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
9,236
137,909 requests in 15 s
Latency p50
10ms
average 10.4 ms
Latency p99
12ms
max 20 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **9,277** · 2 : **9,196** req/s · spread 0.9 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **2.0 vCPU**, **127 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.1 vCPU** · sandboxes **0.0 vCPU**, **505 MB** · whole server busy **92 %**, of which kernel (network, disk) **37 %** · memory used **2018 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all, both tokens · round 2 of 2, the closer to the average
## Get all with caching
The same request on a table whose API settings say `enableCaching: true`. The first answer is kept in Redis, under a key made of who asks and what is asked ; the next requests are answered from Redis until the answer expires or something writes the table. [About this API](https://docs.apimaker.dev/v4/docs/features/automatic-caching.html).
### Get all with caching : public
No token : the API is public. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
29,762
450,257 requests in 15 s
Latency p50
3ms
average 2.8 ms
Latency p99
5ms
max 16 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **30,018** · 2 : **29,507** req/s · spread 1.7 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.3 vCPU**, **123 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · Redis **0.2 vCPU** · whole server busy **95 %**, of which kernel (network, disk) **42 %** · memory used **901 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all with caching, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
30,205
455,735 requests in 15 s
Latency p50
3ms
average 2.8 ms
Latency p99
5ms
max 13 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **30,384** · 2 : **30,026** req/s · spread 1.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.3 vCPU**, **118 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · Redis **0.2 vCPU** · whole server busy **95 %**, of which kernel (network, disk) **42 %** · memory used **1104 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all with caching, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
30,217
458,018 requests in 15 s
Latency p50
3ms
average 2.8 ms
Latency p99
5ms
max 212 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **30,535** · 2 : **29,898** req/s · spread 2.1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.3 vCPU**, **118 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **53 MB** · Redis **0.2 vCPU** · whole server busy **95 %**, of which kernel (network, disk) **42 %** · memory used **1481 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all with caching, public · round 1 of 2, the closer to the average
### Get all with caching : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
23,619
355,519 requests in 15 s
Latency p50
4ms
average 3.7 ms
Latency p99
6ms
max 15 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **23,702** · 2 : **23,537** req/s · spread 0.7 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.4 vCPU**, **120 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · Redis **0.2 vCPU** · whole server busy **97 %**, of which kernel (network, disk) **35 %** · memory used **896 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all with caching, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
24,179
365,574 requests in 15 s
Latency p50
4ms
average 3.6 ms
Latency p99
6ms
max 15 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **24,373** · 2 : **23,985** req/s · spread 1.6 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.4 vCPU**, **118 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · Redis **0.2 vCPU** · whole server busy **97 %**, of which kernel (network, disk) **35 %** · memory used **1099 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all with caching, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
24,025
365,041 requests in 15 s
Latency p50
4ms
average 3.6 ms
Latency p99
6ms
max 14 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **24,333** · 2 : **23,717** req/s · spread 2.6 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.4 vCPU**, **119 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **53 MB** · Redis **0.2 vCPU** · whole server busy **97 %**, of which kernel (network, disk) **35 %** · memory used **1483 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all with caching, both tokens · round 1 of 2, the closer to the average
## Get all by stream
`GET …/
/stream` : the rows are sent while they are read from the database cursor, so a large table never sits whole in memory. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/schema-apis/auto-generated-schema-based-get-all-by-stream-api.html).
### Get all by stream : public
No token : the API is public. Each answer : 2,477 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
7,342
111,227 requests in 15 s
Latency p50
13ms
average 13.0 ms
Latency p99
27ms
max 79 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **7,415** · 2 : **7,269** req/s · spread 2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.8 vCPU**, **129 MB** RSS · MongoDB **1.6 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **99 %**, of which kernel (network, disk) **32 %** · memory used **923 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all by stream, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
9,098
136,731 requests in 15 s
Latency p50
10ms
average 10.5 ms
Latency p99
13ms
max 22 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **9,116** · 2 : **9,079** req/s · spread 0.4 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.7 vCPU**, **131 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.3 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **90 %**, of which kernel (network, disk) **36 %** · memory used **1126 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all by stream, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
9,458
144,777 requests in 15 s
Latency p50
10ms
average 9.9 ms
Latency p99
12ms
max 20 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **9,653** · 2 : **9,264** req/s · spread 4.1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.9 vCPU**, **124 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.1 vCPU** · sandboxes **0.0 vCPU**, **53 MB** · whole server busy **92 %**, of which kernel (network, disk) **38 %** · memory used **1489 MB** of 7942 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all by stream, public · round 1 of 2, the closer to the average
### Get all by stream : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,577 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
6,933
104,966 requests in 15 s
Latency p50
13ms
average 13.8 ms
Latency p99
26ms
max 55 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **6,998** · 2 : **6,867** req/s · spread 1.9 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.0 vCPU**, **129 MB** RSS · MongoDB **1.5 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **99 %**, of which kernel (network, disk) **30 %** · memory used **936 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all by stream, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
8,490
127,901 requests in 15 s
Latency p50
11ms
average 11.2 ms
Latency p99
13ms
max 21 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **8,527** · 2 : **8,454** req/s · spread 0.9 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.9 vCPU**, **125 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.2 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **93 %**, of which kernel (network, disk) **34 %** · memory used **1126 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all by stream, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
8,733
129,622 requests in 15 s
Latency p50
11ms
average 11.1 ms
Latency p99
13ms
max 23 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **8,824** · 2 : **8,642** req/s · spread 2.1 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **2.1 vCPU**, **130 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.0 vCPU** · sandboxes **0.0 vCPU**, **505 MB** · whole server busy **93 %**, of which kernel (network, disk) **35 %** · memory used **2014 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all by stream, both tokens · round 2 of 2, the closer to the average
## Custom API calling get all
A custom API written in TypeScript, `return await g.sys.db.getAll({ instance, database, collection })`. This code is *lean* : it only reads what it is handed and asks `g.sys` for a read, so API Maker runs it in the server itself, with QuickJS, on the thread which answers the request, and the request never leaves the server. Code which needs more (a package, the time of the machine, `g.shared`, …) runs in the sandbox of the account : see the next API. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/custom-apis/user-created-custom-api.html).
**The custom API (public : customers_public ; both tokens : customers)**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
return await g.sys.db.getAll({ instance: 'mongodb', database: 'am_bench', collection: 'customers_public' });
}
module.exports = main;
```
### Custom API calling get all : public
No token : the API is public. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
5,228
78,614 requests in 15 s
Latency p50
18ms
average 18.6 ms
Latency p99
32ms
max 60 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **5,242** · 2 : **5,214** req/s · spread 0.5 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.4 vCPU**, **131 MB** RSS · MongoDB **1.2 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **100 %**, of which kernel (network, disk) **25 %** · memory used **950 MB** of 7942 MB · steal **0 %** · swap not touched
autocannon · MongoDB · custom api calling get all, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
5,886
88,531 requests in 15 s
Latency p50
16ms
average 16.4 ms
Latency p99
19ms
max 27 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **5,902** · 2 : **5,869** req/s · spread 0.6 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.5 vCPU**, **122 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.9 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **96 %**, of which kernel (network, disk) **25 %** · memory used **1129 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · custom api calling get all, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
6,513
98,309 requests in 15 s
Latency p50
15ms
average 14.8 ms
Latency p99
17ms
max 23 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **6,554** · 2 : **6,472** req/s · spread 1.3 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.6 vCPU**, **125 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.7 vCPU** · sandboxes **0.0 vCPU**, **53 MB** · whole server busy **96 %**, of which kernel (network, disk) **27 %** · memory used **1493 MB** of 7942 MB · steal **0 %** · swap not touched
autocannon · MySQL · custom api calling get all, public · round 1 of 2, the closer to the average
### Custom API calling get all : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
4,933
73,535 requests in 15 s
Latency p50
20ms
average 19.9 ms
Latency p99
35ms
max 52 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **4,963** · 2 : **4,903** req/s · spread 1.2 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **2.5 vCPU**, **133 MB** RSS · MongoDB **1.1 vCPU** · sandboxes **0.0 vCPU**, **511 MB** · whole server busy **99 %**, of which kernel (network, disk) **23 %** · memory used **1543 MB** of 7942 MB · steal **0 %** · swap not touched
autocannon · MongoDB · custom api calling get all, both tokens · round 2 of 2, the closer to the average
**PostgreSQL**
Requests / second
5,442
82,083 requests in 15 s
Latency p50
18ms
average 17.8 ms
Latency p99
21ms
max 27 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **5,473** · 2 : **5,411** req/s · spread 1.1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.6 vCPU**, **123 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.8 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **97 %**, of which kernel (network, disk) **25 %** · memory used **1122 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · custom api calling get all, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
6,032
90,466 requests in 15 s
Latency p50
16ms
average 16.1 ms
Latency p99
19ms
max 26 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **6,031** · 2 : **6,034** req/s · spread 0 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.7 vCPU**, **128 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.7 vCPU** · sandboxes **0.0 vCPU**, **53 MB** · whole server busy **97 %**, of which kernel (network, disk) **26 %** · memory used **1489 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MySQL · custom api calling get all, both tokens · round 1 of 2, the closer to the average
## Custom API in the sandbox
The same custom API, with one line more : it reads `Date.now()`, the time of the machine, which lean code may not. So this code runs in a sandbox of the account (a container with Node.js 24) : the request goes from API Maker to a runner of the sandbox and back, and the rows are read from inside the sandbox by the core of API Maker loaded there. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/custom-apis/user-created-custom-api.html).
**The custom API which runs in the sandbox**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
const started = Date.now(); // the time of the machine : this code runs in the sandbox of the account
return await g.sys.db.getAll({ instance: 'mongodb', database: 'am_bench', collection: 'customers_public' });
}
module.exports = main;
```
No token : the API is public. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
4,491
67,027 requests in 15 s
Latency p50
21ms
average 21.9 ms
Latency p99
41ms
max 79 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **4,469** · 2 : **4,512** req/s · spread 1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.0 vCPU**, **127 MB** RSS · MongoDB **1.0 vCPU** · sandboxes **1.9 vCPU**, **501 MB** · whole server busy **100 %**, of which kernel (network, disk) **21 %** · memory used **1388 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MongoDB · custom api in the sandbox, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
4,673
70,427 requests in 15 s
Latency p50
21ms
average 20.8 ms
Latency p99
38ms
max 62 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **4,651** · 2 : **4,696** req/s · spread 1 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **1.0 vCPU**, **121 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.8 vCPU** · sandboxes **1.8 vCPU**, **481 MB** · whole server busy **99 %**, of which kernel (network, disk) **26 %** · memory used **1693 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · custom api in the sandbox, public · round 2 of 2, the closer to the average
**MySQL**
Requests / second
5,174
77,268 requests in 15 s
Latency p50
19ms
average 18.9 ms
Latency p99
35ms
max 53 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **5,152** · 2 : **5,196** req/s · spread 0.9 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.1 vCPU**, **122 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.6 vCPU** · sandboxes **1.8 vCPU**, **486 MB** · whole server busy **99 %**, of which kernel (network, disk) **28 %** · memory used **1977 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MySQL · custom api in the sandbox, public · round 1 of 2, the closer to the average
## Get all with a pre hook
Get all, with both tokens, on a table whose get all API has a pre hook written in TypeScript : before the API, the hook runs (lean code : in the server, with QuickJS), reads the signed-in person from `x-am-user-authorization` and keeps the rows of their country (`g.req.query.find`), the row scoping most applications need. Every row of the dataset is in India, as the person is, so the answer is the same ten rows. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/hooks/preHook-api.html).
**The pre hook of SCHEMA_GET_ALL on customers_pre_hook**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
if (!g.req.isApiRequestFromUser) return;
const person = g.req.auth.authAMDB; // the person, from x-am-user-authorization
if (!person) throw [{ code: T.EStatusCode.UNAUTHORIZED, message: 'Sign in first.' }];
const find = g.req.query.find ? (typeof g.req.query.find === 'string' ? JSON.parse(g.req.query.find) : g.req.query.find) : {};
g.req.query.find = { $and: [find, { country: person.country }] };
}
module.exports = main;
```
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
5,460
81,990 requests in 15 s
Latency p50
18ms
average 17.8 ms
Latency p99
31ms
max 66 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **5,466** · 2 : **5,453** req/s · spread 0.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.2 vCPU**, **130 MB** RSS · MongoDB **1.3 vCPU** · sandboxes **0.0 vCPU**, **506 MB** · whole server busy **100 %**, of which kernel (network, disk) **26 %** · memory used **1407 MB** of 7942 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all with a pre hook, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
6,280
94,601 requests in 15 s
Latency p50
15ms
average 15.4 ms
Latency p99
18ms
max 26 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **6,307** · 2 : **6,253** req/s · spread 0.9 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.3 vCPU**, **120 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.0 vCPU** · sandboxes **0.0 vCPU**, **470 MB** · whole server busy **96 %**, of which kernel (network, disk) **27 %** · memory used **1657 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all with a pre hook, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
6,820
102,790 requests in 15 s
Latency p50
14ms
average 14.1 ms
Latency p99
17ms
max 23 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **6,786** · 2 : **6,853** req/s · spread 1 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **2.4 vCPU**, **127 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.9 vCPU** · sandboxes **0.0 vCPU**, **493 MB** · whole server busy **95 %**, of which kernel (network, disk) **29 %** · memory used **2016 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all with a pre hook, both tokens · round 2 of 2, the closer to the average
## Get by id
One row by its primary key : `GET …/
/get-by-id/`. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/schema-apis/auto-generated-schema-based-get-by-id-api.html).
### Get by id : public
No token : the API is public. Each answer : 278 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
8,777
131,470 requests in 15 s
Latency p50
11ms
average 10.9 ms
Latency p99
22ms
max 56 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **8,764** · 2 : **8,790** req/s · spread 0.3 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.8 vCPU**, **131 MB** RSS · MongoDB **1.6 vCPU** · sandboxes **0.0 vCPU**, **505 MB** · whole server busy **99 %**, of which kernel (network, disk) **34 %** · memory used **1390 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get by id, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
9,655
147,101 requests in 15 s
Latency p50
10ms
average 9.7 ms
Latency p99
12ms
max 17 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **9,807** · 2 : **9,503** req/s · spread 3.1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.6 vCPU**, **121 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.4 vCPU** · sandboxes **0.0 vCPU**, **470 MB** · whole server busy **92 %**, of which kernel (network, disk) **35 %** · memory used **1643 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get by id, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
10,654
159,179 requests in 15 s
Latency p50
9ms
average 8.9 ms
Latency p99
11ms
max 18 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **10,612** · 2 : **10,695** req/s · spread 0.8 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.7 vCPU**, **126 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.1 vCPU** · sandboxes **0.0 vCPU**, **492 MB** · whole server busy **87 %**, of which kernel (network, disk) **36 %** · memory used **1985 MB** of 7942 MB · steal **0 %** · swap not touched
autocannon · MySQL · get by id, public · round 1 of 2, the closer to the average
### Get by id : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 278 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
8,182
122,215 requests in 15 s
Latency p50
12ms
average 11.8 ms
Latency p99
22ms
max 46 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **8,148** · 2 : **8,215** req/s · spread 0.8 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.0 vCPU**, **131 MB** RSS · MongoDB **1.4 vCPU** · sandboxes **0.0 vCPU**, **505 MB** · whole server busy **99 %**, of which kernel (network, disk) **33 %** · memory used **1393 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get by id, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
8,790
131,939 requests in 15 s
Latency p50
11ms
average 10.9 ms
Latency p99
13ms
max 21 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **8,785** · 2 : **8,795** req/s · spread 0.1 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **1.7 vCPU**, **123 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.3 vCPU** · sandboxes **0.0 vCPU**, **468 MB** · whole server busy **90 %**, of which kernel (network, disk) **32 %** · memory used **1689 MB** of 7942 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get by id, both tokens · round 2 of 2, the closer to the average
**MySQL**
Requests / second
9,758
146,675 requests in 15 s
Latency p50
10ms
average 9.7 ms
Latency p99
12ms
max 20 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **9,780** · 2 : **9,737** req/s · spread 0.4 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.9 vCPU**, **127 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.0 vCPU** · sandboxes **0.0 vCPU**, **492 MB** · whole server busy **91 %**, of which kernel (network, disk) **35 %** · memory used **1986 MB** of 7942 MB · steal **0 %** · swap not touched
autocannon · MySQL · get by id, both tokens · round 1 of 2, the closer to the average
## Get by id with caching
One row by its primary key, on a table with `enableCaching: true` : answered from Redis after the first request. [About this API](https://docs.apimaker.dev/v4/docs/features/automatic-caching.html).
### Get by id with caching : public
No token : the API is public. Each answer : 278 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
32,588
486,856 requests in 15 s
Latency p50
3ms
average 2.6 ms
Latency p99
4ms
max 12 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **32,458** · 2 : **32,718** req/s · spread 0.8 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.3 vCPU**, **128 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **505 MB** · Redis **0.2 vCPU** · whole server busy **94 %**, of which kernel (network, disk) **37 %** · memory used **1405 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get by id with caching, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
33,015
493,728 requests in 15 s
Latency p50
3ms
average 2.5 ms
Latency p99
4ms
max 13 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **32,914** · 2 : **33,115** req/s · spread 0.6 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.2 vCPU**, **121 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **470 MB** · Redis **0.2 vCPU** · whole server busy **94 %**, of which kernel (network, disk) **37 %** · memory used **1649 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get by id with caching, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
32,897
499,478 requests in 15 s
Latency p50
2ms
average 2.5 ms
Latency p99
4ms
max 13 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **33,297** · 2 : **32,497** req/s · spread 2.4 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.2 vCPU**, **125 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **492 MB** · Redis **0.2 vCPU** · whole server busy **94 %**, of which kernel (network, disk) **38 %** · memory used **1976 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MySQL · get by id with caching, public · round 1 of 2, the closer to the average
### Get by id with caching : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 278 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
25,516
381,272 requests in 15 s
Latency p50
3ms
average 3.4 ms
Latency p99
6ms
max 14 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **25,419** · 2 : **25,612** req/s · spread 0.8 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.4 vCPU**, **127 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **505 MB** · Redis **0.2 vCPU** · whole server busy **96 %**, of which kernel (network, disk) **31 %** · memory used **1370 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get by id with caching, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
25,875
388,252 requests in 15 s
Latency p50
3ms
average 3.4 ms
Latency p99
5ms
max 14 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **25,867** · 2 : **25,882** req/s · spread 0.1 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **3.4 vCPU**, **121 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **468 MB** · Redis **0.2 vCPU** · whole server busy **97 %**, of which kernel (network, disk) **31 %** · memory used **1701 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get by id with caching, both tokens · round 2 of 2, the closer to the average
**MySQL**
Requests / second
25,837
388,702 requests in 15 s
Latency p50
3ms
average 3.4 ms
Latency p99
5ms
max 15 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **25,914** · 2 : **25,761** req/s · spread 0.6 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.4 vCPU**, **125 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **492 MB** · Redis **0.2 vCPU** · whole server busy **97 %**, of which kernel (network, disk) **30 %** · memory used **1982 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MySQL · get by id with caching, both tokens · round 1 of 2, the closer to the average
## Insert one row
`POST …/
/save-single-or-multiple` with one row of 9 columns in the body : the schema checks and converts it, the database writes it, and the saved row is answered. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/schema-apis/auto-generated-schema-based-save-single-or-multiple-api.html).
No token : the API is public. Each answer : 277 bytes (MongoDB), status 201.
**MongoDB**
Requests / second
3,574
53,698 requests in 15 s
Latency p50
27ms
average 27.4 ms
Latency p99
52ms
max 124 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,580** · 2 : **3,568** req/s · spread 0.3 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.3 vCPU**, **132 MB** RSS · MongoDB **2.0 vCPU** · sandboxes **0.0 vCPU**, **505 MB** · whole server busy **97 %**, of which kernel (network, disk) **29 %** · memory used **1457 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MongoDB · insert one row, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
4,236
64,298 requests in 15 s
Latency p50
23ms
average 22.8 ms
Latency p99
28ms
max 44 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **4,287** · 2 : **4,185** req/s · spread 2.4 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.2 vCPU**, **124 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.5 vCPU** · sandboxes **0.0 vCPU**, **470 MB** · whole server busy **85 %**, of which kernel (network, disk) **31 %** · memory used **1674 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · insert one row, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
3,462
51,392 requests in 15 s
Latency p50
29ms
average 28.7 ms
Latency p99
33ms
max 49 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **3,427** · 2 : **3,498** req/s · spread 2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.0 vCPU**, **129 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.1 vCPU** · sandboxes **0.0 vCPU**, **492 MB** · whole server busy **78 %**, of which kernel (network, disk) **33 %** · memory used **1996 MB** of 7941 MB · steal **0 %** · swap not touched
autocannon · MySQL · insert one row, public · round 1 of 2, the closer to the average
## Custom API without a database
A public custom API whose code returns a small object and reads no database : what running code of the account costs, without a database. Lean code runs in the server itself, with QuickJS ; the same code with `Date.now()` in it runs in a sandbox of the account : the trip from API Maker to the runner in its container and back.
**In the server (lean code)**
**The custom API**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
return { message: 'Hello from API Maker', time: 1 };
}
module.exports = main;
```
Requests / second
21,532
323,087 requests in 15 s
Latency p50
4ms
average 4.2 ms
Latency p99
8ms
max 19 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **21,526** · 2 : **21,539** req/s · spread 0.1 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **4.0 vCPU**, **124 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **507 MB** · whole server busy **100 %**, of which kernel (network, disk) **24 %** · memory used **1508 MB** of 7942 MB · steal **0 %** · swap not touched
autocannon · custom API without a database, in the server (lean code) · round 2 of 2, the closer to the average
**In the sandbox**
**The custom API**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
return { message: 'Hello from the sandbox', time: Date.now() };
}
module.exports = main;
```
Requests / second
18,562
278,386 requests in 15 s
Latency p50
5ms
average 4.9 ms
Latency p99
10ms
max 18 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **18,558** · 2 : **18,566** req/s · spread 0 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.7 vCPU**, **128 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **1.2 vCPU**, **509 MB** · whole server busy **98 %**, of which kernel (network, disk) **27 %** · memory used **1515 MB** of 7942 MB · steal **0 %** · swap not touched
autocannon · custom API without a database, in the sandbox · round 1 of 2, the closer to the average
## More connections
*Get all, public* and *Get by id with caching, public* on MongoDB, one run of 15 seconds for each number of connections. More clients at once wait longer for their answer, and the server keeps answering them all.
### Get all, public, by connections
**Get all, public, MongoDB : requests per second by connections**
10 connectionsp50 1 ms · p99 2 ms · 6,558
50 connectionsp50 6 ms · p99 14 ms · 7,616
100 connectionsp50 12 ms · p99 28 ms · 7,565
250 connectionsp50 33 ms · p99 56 ms · 7,278
500 connectionsp50 70 ms · p99 86 ms · 7,099
1,000 connectionsp50 141 ms · p99 157 ms · 7,063
| Connections | Requests / second | p50 | p99 | Max | Errors | Server busy | API Maker RSS |
|--:|--:|--:|--:|--:|--:|--:|--:|
| 10 | **6,558** | 1 ms | 2 ms | 11 ms | 0 | 87 % | 123 MB |
| 50 | **7,616** | 6 ms | 14 ms | 32 ms | 0 | 98 % | 127 MB |
| 100 | **7,565** | 12 ms | 28 ms | 77 ms | 0 | 99 % | 132 MB |
| 250 | **7,278** | 33 ms | 56 ms | 113 ms | 0 | 99 % | 144 MB |
| 500 | **7,099** | 70 ms | 86 ms | 123 ms | 0 | 99 % | 158 MB |
| 1,000 | **7,063** | 141 ms | 157 ms | 211 ms | 0 | 99 % | 194 MB |
### Get by id with caching, public, by connections
**Get by id with caching, public, MongoDB : requests per second by connections**
10 connectionsp50 0 ms · p99 1 ms · 15,484
50 connectionsp50 1 ms · p99 2 ms · 29,267
100 connectionsp50 3 ms · p99 4 ms · 32,315
250 connectionsp50 7 ms · p99 12 ms · 32,425
500 connectionsp50 15 ms · p99 22 ms · 31,813
1,000 connectionsp50 32 ms · p99 43 ms · 30,921
| Connections | Requests / second | p50 | p99 | Max | Errors | Server busy | API Maker RSS |
|--:|--:|--:|--:|--:|--:|--:|--:|
| 10 | **15,484** | 0 ms | 1 ms | 11 ms | 0 | 68 % | 129 MB |
| 50 | **29,267** | 1 ms | 2 ms | 8 ms | 0 | 89 % | 129 MB |
| 100 | **32,315** | 3 ms | 4 ms | 13 ms | 0 | 94 % | 133 MB |
| 250 | **32,425** | 7 ms | 12 ms | 24 ms | 0 | 97 % | 141 MB |
| 500 | **31,813** | 15 ms | 22 ms | 49 ms | 0 | 98 % | 154 MB |
| 1,000 | **30,921** | 32 ms | 43 ms | 75 ms | 0 | 98 % | 182 MB |
## Questions
### How many requests per second can API Maker serve on 4 dedicated vCPUs ?
On this 8 GB server, with the database on the same machine : 7,614 requests per second for a whole table of ten rows on MongoDB (PostgreSQL 8,912 · MySQL 10,000), 8,777 for one row by its id, and 32,588 when the answer is cached in Redis. A custom API in TypeScript which reads the table answers 5,228 requests per second when API Maker runs it itself (lean code), 4,491 when it runs in the sandbox of the account.
### How much memory does API Maker use ?
The API Maker process held 104 MB at rest and 140 MB at most under load on this server, in RAM. The rest of the memory went to the databases (MongoDB, Redis, PostgreSQL or MySQL), the sandboxes which run the code of the account, and Linux itself.
### Do the two tokens slow the APIs down ?
API Maker checks both tokens (x-am-authorization and x-am-user-authorization) and the groups of the API user on every request. Get all with both tokens answered 7,220 requests per second on MongoDB (public : 7,614), 8,245 requests per second on PostgreSQL (public : 8,912), 9,236 requests per second on MySQL (public : 10,000). The checks show most where the database does no work : a cached get all answered 23,619 requests per second with both tokens against 29,762 public on MongoDB.
### What does a pre hook cost ?
A pre hook runs code of the account before the API ; a lean hook like this one runs in the server itself, with QuickJS. Get all with a row scoping pre hook answered 5,460 requests per second on MongoDB, against 7,220 for the same API without the hook. On 4 vCPUs, the API, the hook and the database share the same 4 vCPUs.
### Can I run these benchmarks myself ?
Yes : [How API Maker is benchmarked](https://docs.apimaker.dev/v4/docs/benchmarks/methodology.html) gives the dataset, the settings of every API and the exact autocannon commands.
---
# API Maker benchmark : 8 vCPU, 16 GB RAM (Linode dedicated CPU)
> API Maker on 8 dedicated vCPUs, 16 GB (Linode) : 12,640 req/s get all, 47,980 cached, on MongoDB, PostgreSQL and MySQL, with memory and autocannon output.
Source: https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html
Benchmark · Linode (Akamai Cloud) · Dedicated CPU · 12 October 2026
**8 vCPU, 16 GB RAM : 12,640 to 13,748 requests per second for a whole table.**
API Maker 4.0.0 on a Linode Dedicated 16 GB (g6-dedicated-8) : 8 dedicated vCPUs and 16 GB of RAM at $144 a month, its databases on the same machine. Every API was loaded for 15 seconds by autocannon from a second server, two times, on MongoDB, PostgreSQL and MySQL, public and with two tokens, while the server sampled the memory and CPU of every part each second.
Get all · MongoDB
12,640req/s
PostgreSQL 12,641 · MySQL 13,748
Get by id, cached
47,980req/s
answered from Redis · PostgreSQL 47,888 · MySQL 48,818
Custom API · MongoDB
8,893req/s
TypeScript, lean : run in the server · in the sandbox 7,569
API Maker memory
111MB
at rest · 176 MB at most under load
## The server
| | |
|---|---|
| Server | Linode (Akamai Cloud), Dedicated 16 GB (g6-dedicated-8), dedicated cpu, $144 / month |
| CPU | AMD EPYC 7642 48-Core Processor, 8 dedicated vCPUs (KVM) KVM guest, 1 thread per core · L1d 512 KiB (8 instances) · L2 4 MiB (8 instances) · L3 128 MiB (8 instances) · BogoMIPS 4599.99 |
| Memory | 16 GB (15,991 MB usable), swap 8.5 GB (496 MB of Linode + 8 GB made by the installer) |
| Disk, region | 320 GB SSD, Mumbai, India (ap-west) |
| System | Ubuntu 24.04.4 LTS, Linux 6.8.0-134, Docker 29.9.0 |
| API Maker | 4.0.0 : release build of api_maker_be_rust 864bb64 (opt-level 3, fat LTO), installed by its installer (https://apimaker.dev/v4/install.sh), no reverse proxy |
| Settings | the defaults of the installer (lean code of the account runs in the server with QuickJS : sandbox.codeInServer), and the sandboxes kept running for the whole run (removeSandboxInactiveSinceMinutes 1440) |
| Databases | MongoDB 8.0.10 (the MongoDB of API Maker, a replica set of one member, in Docker) · Redis 7.0.5 (the Redis of API Maker, in Docker) · PostgreSQL 18.6 (official image postgres:18, max_connections 500) · MySQL 8.4.11 (official image mysql:8.4, max_connections 500) : all on the same server |
| Sandboxes | TypeScript on Node.js 24.21.0 (an image of 403 MB built by API Maker), 2 sandboxes of the account (sandboxCountForAdmin 2, the default), each opening up to 8 runners when it is busy (one per vCPU) |
| Load generator | Dedicated 64 GB (g6-dedicated-32) : AMD EPYC 7642 48-Core Processor, 32 dedicated vCPUs, Ubuntu 24.04.4 LTS, Node.js 24.21.0, autocannon 8.0.0 with 20 worker threads |
| Network | Private network of the same data centre, round trip 0.28 ms (ping) |
| Host | A strict anti-affinity placement group kept the three dedicated CPU servers (2, 4 and 8 vCPUs) on three different hosts. All seven servers were measured at the same time, each by a load generator of its own. |
| Date | 12 October 2026, 05:30 to 06:44 UTC |
Only what a database needs was running while it was measured : API Maker and its two sandboxes, its MongoDB and Redis (API Maker always needs them) and the database under test. The other benchmark databases were stopped, API Maker was restarted and the swap emptied back into memory before each database, when it fitted there. How every number was taken : [How API Maker is benchmarked](https://docs.apimaker.dev/v4/docs/benchmarks/methodology.html). Every server side by side : [All results](https://docs.apimaker.dev/v4/docs/benchmarks/summary.html).
## The data
Every table holds the ten rows of the [API Maker benchmark dataset](https://apimaker.dev/json/benchmark_dataset.json) : `https://apimaker.dev/json/benchmark_dataset.json`. Ten customers, ten columns each ; a *get all* answers all ten (2,418 bytes of JSON on MongoDB), a *get by id* one of them.
| `_id` | `customer_id` | `first_name` | `last_name` | `phone` | `last_update` | `pincode` | `shipping_id` | `dob` | `country` |
|---|---|---|---|---|---|---|---|---|---|
| 60ae2488c37cd955cc144161 | 2 | NICK | WAHLBERG | 1123456789 | 2006-02-15T04:34:00.330Z | 111111 | 2 | 2022-10-30T03:25:03.000Z | India |
| 60ae24c8c37cd955cc144162 | 1 | PENELOPE | GUINESS | 123456789 | 2006-02-15T04:34:00.330Z | 100050 | 1 | 2022-10-30T03:25:03.000Z | India |
| 60ae247ac37cd955cc144160 | 3 | ED | CHASE | 2123456789 | 2006-02-15T04:34:00.330Z | 222222 | 3 | 2022-10-30T03:25:03.000Z | India |
| 60ace1401efc56684403c68c | 4 | JENNIFER | DAVIS | 3123456789 | 2006-02-15T04:34:00.330Z | 100050 | 4 | 2022-10-30T03:25:03.000Z | India |
| 60accda51efc56684403c685 | 5 | JOHNNY | LOLLOBRIGIDA | 4123456789 | 2006-02-15T04:34:00.330Z | 485125 | 1 | 2022-10-30T03:25:03.000Z | India |
| 606b7d364bebce00196eade7 | 6 | JOHNNY | LOLLOBRIGIDA | 5123456789 | 2006-02-15T04:34:00.330Z | 123456 | 2 | 2022-10-30T03:25:03.000Z | India |
| 606b75961055000018fa9d98 | 7 | GRACE | MOSTEL | 6123456789 | 2006-02-15T04:34:00.330Z | 356589 | 3 | 2022-10-30T03:25:03.000Z | India |
| 6064dd02730026001956663e | 8 | MATTHEW | JOHANSSON | 7123456789 | 2006-02-15T04:34:00.330Z | 100050 | 4 | 2022-10-30T03:25:03.000Z | India |
| 6064dcb8730026001956663c | 9 | JOE | SWANK | 8123456789 | 2006-02-15T04:34:00.330Z | 251415 | 1 | 2022-10-30T03:25:03.000Z | India |
| 6064c4c02bafb90018955299 | 10 | CHRISTIAN | GABLE | 9123456789 | 2006-02-15T04:34:00.330Z | 100050 | | 2022-10-30T03:25:03.000Z | India |
## Results at a glance
Requests per second, the average of two rounds of 15 seconds with 100 connections. *Public* APIs need no token ; *both tokens* means every request carries `x-am-authorization` (the token of an API user, whose groups decide what it may call) and `x-am-user-authorization` (the token of a row of the `customers` table, made by a DB token generator), and API Maker checks both.
**Requests per second · 8 vCPU, 16 GB RAM, dedicated CPU** · MongoDB · PostgreSQL · MySQL
Get allpublic · 12,640 · 12,641 · 13,748
Get allboth tokens · 12,106 · 11,913 · 12,712
Get all with cachingpublic · 43,980 · 43,173 · 44,027
Get all with cachingboth tokens · 36,123 · 35,403 · 35,915
Get all by streampublic · 11,898 · 13,073 · 13,095
Get all by streamboth tokens · 11,516 · 12,162 · 12,340
Custom API calling get all QuickJS · public · 8,893 · 9,176 · 9,820
Custom API calling get all QuickJS · both tokens · 8,426 · 8,561 · 9,129
Custom API in the sandbox Sandbox · public · 7,569 · 7,916 · 8,657
Get all with a pre hook QuickJS · both tokens · 9,279 · 9,524 · 10,204
Get by idpublic · 14,224 · 13,571 · 14,510
Get by idboth tokens · 13,443 · 12,656 · 13,517
Get by id with cachingpublic · 47,980 · 47,888 · 48,818
Get by id with cachingboth tokens · 38,521 · 38,045 · 38,544
Insert one rowpublic · 5,490 · 5,874 · 3,542
| API | Access | MongoDB | PostgreSQL | MySQL |
|---|---|--:|--:|--:|
| [Get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-all) | Public | **12,640** p99 17 ms | **12,641** p99 10 ms | **13,748** p99 9 ms |
| [Get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-all) | Both tokens | **12,106** p99 17 ms | **11,913** p99 10 ms | **12,712** p99 10 ms |
| [Get all with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-all-with-caching) | Public | **43,980** p99 3 ms | **43,173** p99 3 ms | **44,027** p99 3 ms |
| [Get all with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-all-with-caching) | Both tokens | **36,123** p99 4 ms | **35,403** p99 4 ms | **35,915** p99 4 ms |
| [Get all by stream](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-all-by-stream) | Public | **11,898** p99 17 ms | **13,073** p99 9 ms | **13,095** p99 9 ms |
| [Get all by stream](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-all-by-stream) | Both tokens | **11,516** p99 18 ms | **12,162** p99 10 ms | **12,340** p99 10 ms |
| [Custom API calling get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#custom-api-calling-get-all) QuickJS | Public | **8,893** p99 20 ms | **9,176** p99 13 ms | **9,820** p99 12 ms |
| [Custom API calling get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#custom-api-calling-get-all) QuickJS | Both tokens | **8,426** p99 21 ms | **8,561** p99 14 ms | **9,129** p99 13 ms |
| [Custom API in the sandbox](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#custom-api-in-the-sandbox) Sandbox | Public | **7,569** p99 24 ms | **7,916** p99 22 ms | **8,657** p99 20 ms |
| [Get all with a pre hook](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-all-with-a-pre-hook) QuickJS | Both tokens | **9,279** p99 20 ms | **9,524** p99 13 ms | **10,204** p99 13 ms |
| [Get by id](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-by-id) | Public | **14,224** p99 14 ms | **13,571** p99 9 ms | **14,510** p99 8 ms |
| [Get by id](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-by-id) | Both tokens | **13,443** p99 14 ms | **12,656** p99 11 ms | **13,517** p99 9 ms |
| [Get by id with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-by-id-with-caching) | Public | **47,980** p99 3 ms | **47,888** p99 3 ms | **48,818** p99 3 ms |
| [Get by id with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#get-by-id-with-caching) | Both tokens | **38,521** p99 4 ms | **38,045** p99 4 ms | **38,544** p99 4 ms |
| [Insert one row](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#insert-one-row) | Public | **5,490** p99 32 ms | **5,874** p99 19 ms | **3,542** p99 38 ms |
| [Custom API without a database](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#custom-api-without-a-database) | Public | **39,192** p99 4 ms | | |
| [Custom API without a database, in the sandbox](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html#custom-api-without-a-database) | Public | **27,920** p99 8 ms | | |
(0 errors) Every one of the **32,429,901 requests** of these runs was answered with status 200 or 201 : no error, no timeout.
## Memory
What each part of the server held, in MB : at rest (the 60 seconds after API Maker and its sandboxes started, before any request) and under load. The bars show the second the whole server held the most memory while its database was loaded, out of the 15,991 MB of the server ; the table gives the most each part held on its own. API Maker is the resident memory of its process ; a container is counted the way `docker stats` counts it.
API Maker · MongoDB of API Maker · Redis · PostgreSQL / MySQL · Sandboxes · Linux, Docker, the rest · Available
MongoDB
at rest
under load
PostgreSQL
at rest
under load
MySQL
at rest
under load
| Part | MongoDB at rest → under load | PostgreSQL at rest → under load | MySQL at rest → under load |
|---|--:|--:|--:|
| **API Maker** (process), in RAM | 111 → **176** | 110 → **159** | 107 → **152** |
| … and in swap | 0 → **0** | 0 → **0** | 0 → **0** |
| MongoDB of API Maker, in RAM | 127 → **384** | 369 → **372** | 369 → **372** |
| … and in swap | 0 → **0** | 0 → **0** | 0 → **0** |
| Redis, in RAM | 3 → **4** | 3 → **4** | 3 → **4** |
| Database under test, in RAM | MongoDB above | 38 → **320** | 421 → **519** |
| … and in swap | MongoDB above | 0 → **0** | 0 → **0** |
| Sandboxes (2 containers), in RAM | 55 → **856** | 55 → **818** | 55 → **880** |
| … and in swap | 0 → **0** | 0 → **0** | 0 → **0** |
| **Whole server**, RAM used | 946 → **2093** | 1232 → **2349** | 1627 → **2602** |
| Swap used | 0 → **0** | 0 → **0** | 0 → **0** |
## CPU
On 8 vCPUs, API Maker, the database and the sandboxes share the same 8 vCPUs : every request costs the work of all of them. During *get all, public*, the CPU was split this way (average of the 15 seconds, in vCPUs : 8.0 is the whole server ; a process counts its own kernel time) :
| | MongoDB | PostgreSQL | MySQL |
|---|--:|--:|--:|
| API Maker | 3.3 vCPU | 3.0 vCPU | 2.9 vCPU |
| The database | 3.3 vCPU | 1.7 vCPU | 1.6 vCPU |
| MongoDB of API Maker (when it is not the one tested) | – | 0.0 vCPU | 0.0 vCPU |
| Sandboxes (idle : no code runs in get all) | 0.0 vCPU | 0.0 vCPU | 0.0 vCPU |
| Whole server busy (of its 8 vCPUs) | 94 % | 73 % | 72 % |
| … of which kernel time (network, disk), counted in the lines above too | 31 % | 28 % | 31 % |
Steal time (CPU the hypervisor gave to other servers) was 0 % on average, 7 % at most. The load generator, sampled the same way, was never more than 13 % busy over its 32 cores : it was never the limit.
## Get all
The schema API of a table answers all its rows : `GET /api/schema////
`. Every request reads the ten rows from the database, converts them with the schema of the table and sends them as JSON. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/schema-apis/auto-generated-schema-based-get-all-api.html).
### Get all : public
No token : the API is public. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
12,640
192,274 requests in 15 s
Latency p50
7ms
average 7.3 ms
Latency p99
17ms
max 44 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **12,818** · 2 : **12,461** req/s · spread 2.8 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.3 vCPU**, **131 MB** RSS · MongoDB **3.3 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **94 %**, of which kernel (network, disk) **31 %** · memory used **975 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
12,641
188,004 requests in 15 s
Latency p50
7ms
average 7.5 ms
Latency p99
10ms
max 19 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **12,748** · 2 : **12,534** req/s · spread 1.7 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **3.0 vCPU**, **139 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.7 vCPU** · sandboxes **0.0 vCPU**, **815 MB** · whole server busy **73 %**, of which kernel (network, disk) **28 %** · memory used **2291 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all, public · round 2 of 2, the closer to the average
**MySQL**
Requests / second
13,748
206,778 requests in 15 s
Latency p50
7ms
average 6.8 ms
Latency p99
9ms
max 14 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **13,785** · 2 : **13,711** req/s · spread 0.5 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.9 vCPU**, **126 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.6 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **72 %**, of which kernel (network, disk) **31 %** · memory used **1667 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all, public · round 1 of 2, the closer to the average
### Get all : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
12,106
185,158 requests in 15 s
Latency p50
7ms
average 7.6 ms
Latency p99
17ms
max 42 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **12,344** · 2 : **11,868** req/s · spread 3.9 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.7 vCPU**, **131 MB** RSS · MongoDB **2.9 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **94 %**, of which kernel (network, disk) **30 %** · memory used **990 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
11,913
181,979 requests in 15 s
Latency p50
8ms
average 7.7 ms
Latency p99
10ms
max 18 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **12,133** · 2 : **11,693** req/s · spread 3.7 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.3 vCPU**, **126 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.7 vCPU** · sandboxes **0.0 vCPU**, **57 MB** · whole server busy **75 %**, of which kernel (network, disk) **27 %** · memory used **1284 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
12,712
192,036 requests in 15 s
Latency p50
7ms
average 7.3 ms
Latency p99
10ms
max 16 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **12,804** · 2 : **12,620** req/s · spread 1.4 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.3 vCPU**, **129 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.5 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **74 %**, of which kernel (network, disk) **29 %** · memory used **1670 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all, both tokens · round 1 of 2, the closer to the average
## Get all with caching
The same request on a table whose API settings say `enableCaching: true`. The first answer is kept in Redis, under a key made of who asks and what is asked ; the next requests are answered from Redis until the answer expires or something writes the table. [About this API](https://docs.apimaker.dev/v4/docs/features/automatic-caching.html).
### Get all with caching : public
No token : the API is public. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
43,980
658,305 requests in 15 s
Latency p50
2ms
average 1.8 ms
Latency p99
3ms
max 207 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **44,069** · 2 : **43,890** req/s · spread 0.4 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **6.2 vCPU**, **142 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **855 MB** · Redis **0.3 vCPU** · whole server busy **86 %**, of which kernel (network, disk) **34 %** · memory used **2003 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all with caching, public · round 2 of 2, the closer to the average
**PostgreSQL**
Requests / second
43,173
649,417 requests in 15 s
Latency p50
2ms
average 1.8 ms
Latency p99
3ms
max 10 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **43,052** · 2 : **43,295** req/s · spread 0.6 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **6.2 vCPU**, **137 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **814 MB** · Redis **0.3 vCPU** · whole server busy **86 %**, of which kernel (network, disk) **34 %** · memory used **2279 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all with caching, public · round 2 of 2, the closer to the average
**MySQL**
Requests / second
44,027
663,287 requests in 15 s
Latency p50
2ms
average 1.8 ms
Latency p99
3ms
max 9 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **44,219** · 2 : **43,835** req/s · spread 0.9 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **6.2 vCPU**, **125 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · Redis **0.3 vCPU** · whole server busy **86 %**, of which kernel (network, disk) **34 %** · memory used **1623 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all with caching, public · round 1 of 2, the closer to the average
### Get all with caching : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
36,123
535,203 requests in 15 s
Latency p50
2ms
average 2.3 ms
Latency p99
4ms
max 10 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **36,562** · 2 : **35,683** req/s · spread 2.4 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **6.5 vCPU**, **143 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **855 MB** · Redis **0.3 vCPU** · whole server busy **90 %**, of which kernel (network, disk) **29 %** · memory used **2020 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all with caching, both tokens · round 2 of 2, the closer to the average
**PostgreSQL**
Requests / second
35,403
528,689 requests in 15 s
Latency p50
2ms
average 2.3 ms
Latency p99
4ms
max 212 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **35,560** · 2 : **35,246** req/s · spread 0.9 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **6.5 vCPU**, **137 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **814 MB** · Redis **0.3 vCPU** · whole server busy **90 %**, of which kernel (network, disk) **29 %** · memory used **2273 MB** of 15991 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all with caching, both tokens · round 2 of 2, the closer to the average
**MySQL**
Requests / second
35,915
547,580 requests in 15 s
Latency p50
2ms
average 2.2 ms
Latency p99
4ms
max 18 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **36,505** · 2 : **35,325** req/s · spread 3.3 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **6.5 vCPU**, **125 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · Redis **0.3 vCPU** · whole server busy **89 %**, of which kernel (network, disk) **29 %** · memory used **1631 MB** of 15991 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all with caching, both tokens · round 1 of 2, the closer to the average
## Get all by stream
`GET …/
/stream` : the rows are sent while they are read from the database cursor, so a large table never sits whole in memory. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/schema-apis/auto-generated-schema-based-get-all-by-stream-api.html).
### Get all by stream : public
No token : the API is public. Each answer : 2,477 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
11,898
176,800 requests in 15 s
Latency p50
8ms
average 8.0 ms
Latency p99
17ms
max 52 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **12,009** · 2 : **11,787** req/s · spread 1.9 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **3.6 vCPU**, **147 MB** RSS · MongoDB **3.0 vCPU** · sandboxes **0.0 vCPU**, **855 MB** · whole server busy **95 %**, of which kernel (network, disk) **29 %** · memory used **2056 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all by stream, public · round 2 of 2, the closer to the average
**PostgreSQL**
Requests / second
13,073
197,970 requests in 15 s
Latency p50
7ms
average 7.1 ms
Latency p99
9ms
max 16 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **13,198** · 2 : **12,947** req/s · spread 1.9 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.0 vCPU**, **151 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.8 vCPU** · sandboxes **0.0 vCPU**, **57 MB** · whole server busy **74 %**, of which kernel (network, disk) **29 %** · memory used **1307 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all by stream, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
13,095
196,524 requests in 15 s
Latency p50
7ms
average 7.1 ms
Latency p99
9ms
max 218 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **13,102** · 2 : **13,088** req/s · spread 0.1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.3 vCPU**, **145 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.5 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **74 %**, of which kernel (network, disk) **29 %** · memory used **1656 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all by stream, public · round 1 of 2, the closer to the average
### Get all by stream : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,577 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
11,516
173,108 requests in 15 s
Latency p50
8ms
average 8.2 ms
Latency p99
18ms
max 55 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **11,542** · 2 : **11,490** req/s · spread 0.4 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.9 vCPU**, **148 MB** RSS · MongoDB **2.7 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **95 %**, of which kernel (network, disk) **28 %** · memory used **1019 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all by stream, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
12,162
184,136 requests in 15 s
Latency p50
8ms
average 7.7 ms
Latency p99
10ms
max 16 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **12,276** · 2 : **12,048** req/s · spread 1.9 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.3 vCPU**, **150 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.7 vCPU** · sandboxes **0.0 vCPU**, **57 MB** · whole server busy **76 %**, of which kernel (network, disk) **27 %** · memory used **1310 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all by stream, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
12,340
184,543 requests in 15 s
Latency p50
8ms
average 7.6 ms
Latency p99
10ms
max 221 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **12,303** · 2 : **12,376** req/s · spread 0.6 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.6 vCPU**, **145 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.4 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **76 %**, of which kernel (network, disk) **28 %** · memory used **1659 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all by stream, both tokens · round 1 of 2, the closer to the average
## Custom API calling get all
A custom API written in TypeScript, `return await g.sys.db.getAll({ instance, database, collection })`. This code is *lean* : it only reads what it is handed and asks `g.sys` for a read, so API Maker runs it in the server itself, with QuickJS, on the thread which answers the request, and the request never leaves the server. Code which needs more (a package, the time of the machine, `g.shared`, …) runs in the sandbox of the account : see the next API. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/custom-apis/user-created-custom-api.html).
**The custom API (public : customers_public ; both tokens : customers)**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
return await g.sys.db.getAll({ instance: 'mongodb', database: 'am_bench', collection: 'customers_public' });
}
module.exports = main;
```
### Custom API calling get all : public
No token : the API is public. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
8,893
132,169 requests in 15 s
Latency p50
11ms
average 10.8 ms
Latency p99
20ms
max 45 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **8,976** · 2 : **8,810** req/s · spread 1.9 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **4.6 vCPU**, **144 MB** RSS · MongoDB **2.3 vCPU** · sandboxes **0.0 vCPU**, **855 MB** · whole server busy **96 %**, of which kernel (network, disk) **23 %** · memory used **2051 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · MongoDB · custom api calling get all, public · round 2 of 2, the closer to the average
**PostgreSQL**
Requests / second
9,176
138,881 requests in 15 s
Latency p50
10ms
average 10.3 ms
Latency p99
13ms
max 18 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **9,258** · 2 : **9,094** req/s · spread 1.8 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **4.6 vCPU**, **137 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.3 vCPU** · sandboxes **0.0 vCPU**, **57 MB** · whole server busy **85 %**, of which kernel (network, disk) **22 %** · memory used **1297 MB** of 15991 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · custom api calling get all, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
9,820
147,636 requests in 15 s
Latency p50
10ms
average 9.7 ms
Latency p99
12ms
max 19 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **9,844** · 2 : **9,796** req/s · spread 0.5 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **4.5 vCPU**, **136 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.2 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **82 %**, of which kernel (network, disk) **23 %** · memory used **1653 MB** of 15991 MB · steal **0 %** · swap not touched
autocannon · MySQL · custom api calling get all, public · round 1 of 2, the closer to the average
### Custom API calling get all : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
8,426
127,632 requests in 15 s
Latency p50
11ms
average 11.3 ms
Latency p99
21ms
max 36 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **8,510** · 2 : **8,342** req/s · spread 2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **4.9 vCPU**, **143 MB** RSS · MongoDB **2.1 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **97 %**, of which kernel (network, disk) **22 %** · memory used **1033 MB** of 15991 MB · steal **0 %** · swap not touched
autocannon · MongoDB · custom api calling get all, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
8,561
127,705 requests in 15 s
Latency p50
11ms
average 11.2 ms
Latency p99
14ms
max 19 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **8,607** · 2 : **8,514** req/s · spread 1.1 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **4.8 vCPU**, **139 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.2 vCPU** · sandboxes **0.0 vCPU**, **814 MB** · whole server busy **86 %**, of which kernel (network, disk) **20 %** · memory used **2333 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · custom api calling get all, both tokens · round 2 of 2, the closer to the average
**MySQL**
Requests / second
9,129
136,922 requests in 15 s
Latency p50
10ms
average 10.5 ms
Latency p99
13ms
max 21 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **9,128** · 2 : **9,130** req/s · spread 0 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **4.8 vCPU**, **138 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.1 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **85 %**, of which kernel (network, disk) **22 %** · memory used **1655 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · MySQL · custom api calling get all, both tokens · round 1 of 2, the closer to the average
## Custom API in the sandbox
The same custom API, with one line more : it reads `Date.now()`, the time of the machine, which lean code may not. So this code runs in a sandbox of the account (a container with Node.js 24) : the request goes from API Maker to a runner of the sandbox and back, and the rows are read from inside the sandbox by the core of API Maker loaded there. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/custom-apis/user-created-custom-api.html).
**The custom API which runs in the sandbox**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
const started = Date.now(); // the time of the machine : this code runs in the sandbox of the account
return await g.sys.db.getAll({ instance: 'mongodb', database: 'am_bench', collection: 'customers_public' });
}
module.exports = main;
```
No token : the API is public. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
7,569
113,233 requests in 15 s
Latency p50
13ms
average 12.8 ms
Latency p99
24ms
max 57 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **7,550** · 2 : **7,588** req/s · spread 0.5 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **1.9 vCPU**, **137 MB** RSS · MongoDB **2.0 vCPU** · sandboxes **3.9 vCPU**, **842 MB** · whole server busy **98 %**, of which kernel (network, disk) **22 %** · memory used **1868 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · MongoDB · custom api in the sandbox, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
7,916
118,732 requests in 15 s
Latency p50
12ms
average 12.1 ms
Latency p99
22ms
max 33 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **7,916** · 2 : **7,915** req/s · spread 0 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.0 vCPU**, **133 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.4 vCPU** · sandboxes **3.6 vCPU**, **799 MB** · whole server busy **97 %**, of which kernel (network, disk) **25 %** · memory used **2292 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · custom api in the sandbox, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
8,657
129,801 requests in 15 s
Latency p50
11ms
average 11.1 ms
Latency p99
20ms
max 30 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **8,654** · 2 : **8,661** req/s · spread 0.1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.1 vCPU**, **132 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.1 vCPU** · sandboxes **3.7 vCPU**, **863 MB** · whole server busy **97 %**, of which kernel (network, disk) **27 %** · memory used **2536 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · MySQL · custom api in the sandbox, public · round 1 of 2, the closer to the average
## Get all with a pre hook
Get all, with both tokens, on a table whose get all API has a pre hook written in TypeScript : before the API, the hook runs (lean code : in the server, with QuickJS), reads the signed-in person from `x-am-user-authorization` and keeps the rows of their country (`g.req.query.find`), the row scoping most applications need. Every row of the dataset is in India, as the person is, so the answer is the same ten rows. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/hooks/preHook-api.html).
**The pre hook of SCHEMA_GET_ALL on customers_pre_hook**
```typescript
import * as T from 'types';
async function main(g: T.IAMGlobal) {
if (!g.req.isApiRequestFromUser) return;
const person = g.req.auth.authAMDB; // the person, from x-am-user-authorization
if (!person) throw [{ code: T.EStatusCode.UNAUTHORIZED, message: 'Sign in first.' }];
const find = g.req.query.find ? (typeof g.req.query.find === 'string' ? JSON.parse(g.req.query.find) : g.req.query.find) : {};
g.req.query.find = { $and: [find, { country: person.country }] };
}
module.exports = main;
```
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 2,418 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
9,279
139,353 requests in 15 s
Latency p50
10ms
average 10.3 ms
Latency p99
20ms
max 41 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **9,268** · 2 : **9,290** req/s · spread 0.2 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **4.3 vCPU**, **143 MB** RSS · MongoDB **2.7 vCPU** · sandboxes **0.0 vCPU**, **838 MB** · whole server busy **97 %**, of which kernel (network, disk) **25 %** · memory used **2014 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get all with a pre hook, both tokens · round 2 of 2, the closer to the average
**PostgreSQL**
Requests / second
9,524
144,274 requests in 15 s
Latency p50
10ms
average 9.9 ms
Latency p99
13ms
max 17 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **9,618** · 2 : **9,429** req/s · spread 2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **4.1 vCPU**, **138 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.6 vCPU** · sandboxes **0.0 vCPU**, **798 MB** · whole server busy **82 %**, of which kernel (network, disk) **24 %** · memory used **2288 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get all with a pre hook, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
10,204
153,692 requests in 15 s
Latency p50
9ms
average 9.3 ms
Latency p99
13ms
max 20 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **10,247** · 2 : **10,161** req/s · spread 0.8 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **4.1 vCPU**, **138 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.3 vCPU** · sandboxes **0.0 vCPU**, **864 MB** · whole server busy **81 %**, of which kernel (network, disk) **25 %** · memory used **2544 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · MySQL · get all with a pre hook, both tokens · round 1 of 2, the closer to the average
## Get by id
One row by its primary key : `GET …/
/get-by-id/`. [About this API](https://docs.apimaker.dev/v4/docs/apis-all/schema-apis/auto-generated-schema-based-get-by-id-api.html).
### Get by id : public
No token : the API is public. Each answer : 278 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
14,224
213,867 requests in 15 s
Latency p50
6ms
average 6.5 ms
Latency p99
14ms
max 38 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **14,189** · 2 : **14,259** req/s · spread 0.5 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **3.4 vCPU**, **144 MB** RSS · MongoDB **3.0 vCPU** · sandboxes **0.0 vCPU**, **838 MB** · whole server busy **93 %**, of which kernel (network, disk) **31 %** · memory used **2012 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get by id, public · round 2 of 2, the closer to the average
**PostgreSQL**
Requests / second
13,571
205,599 requests in 15 s
Latency p50
7ms
average 6.8 ms
Latency p99
9ms
max 14 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **13,708** · 2 : **13,433** req/s · spread 2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.6 vCPU**, **138 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **2.0 vCPU** · sandboxes **0.0 vCPU**, **798 MB** · whole server busy **72 %**, of which kernel (network, disk) **27 %** · memory used **2282 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get by id, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
14,510
218,937 requests in 15 s
Latency p50
6ms
average 6.3 ms
Latency p99
8ms
max 215 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **14,597** · 2 : **14,423** req/s · spread 1.2 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **2.9 vCPU**, **137 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.6 vCPU** · sandboxes **0.0 vCPU**, **864 MB** · whole server busy **71 %**, of which kernel (network, disk) **29 %** · memory used **2546 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · MySQL · get by id, public · round 1 of 2, the closer to the average
### Get by id : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 278 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
13,443
202,576 requests in 15 s
Latency p50
7ms
average 6.9 ms
Latency p99
14ms
max 28 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **13,505** · 2 : **13,382** req/s · spread 0.9 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.9 vCPU**, **143 MB** RSS · MongoDB **2.6 vCPU** · sandboxes **0.0 vCPU**, **839 MB** · whole server busy **93 %**, of which kernel (network, disk) **29 %** · memory used **1819 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get by id, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
12,656
189,474 requests in 15 s
Latency p50
7ms
average 7.4 ms
Latency p99
11ms
max 18 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **12,633** · 2 : **12,679** req/s · spread 0.4 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **3.0 vCPU**, **139 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.9 vCPU** · sandboxes **0.0 vCPU**, **798 MB** · whole server busy **75 %**, of which kernel (network, disk) **26 %** · memory used **2286 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get by id, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
13,517
202,182 requests in 15 s
Latency p50
7ms
average 6.9 ms
Latency p99
9ms
max 15 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **13,554** · 2 : **13,479** req/s · spread 0.6 % · the output below is round 2, the closer to the average
(Server during this run) API Maker **3.3 vCPU**, **138 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.5 vCPU** · sandboxes **0.0 vCPU**, **863 MB** · whole server busy **73 %**, of which kernel (network, disk) **28 %** · memory used **2563 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · MySQL · get by id, both tokens · round 2 of 2, the closer to the average
## Get by id with caching
One row by its primary key, on a table with `enableCaching: true` : answered from Redis after the first request. [About this API](https://docs.apimaker.dev/v4/docs/features/automatic-caching.html).
### Get by id with caching : public
No token : the API is public. Each answer : 278 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
47,980
713,371 requests in 15 s
Latency p50
2ms
average 1.6 ms
Latency p99
3ms
max 9 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **47,562** · 2 : **48,398** req/s · spread 1.7 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **6.2 vCPU**, **140 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **839 MB** · Redis **0.3 vCPU** · whole server busy **87 %**, of which kernel (network, disk) **31 %** · memory used **1819 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get by id with caching, public · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
47,888
711,782 requests in 15 s
Latency p50
2ms
average 1.6 ms
Latency p99
3ms
max 9 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **47,455** · 2 : **48,321** req/s · spread 1.8 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **6.2 vCPU**, **135 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **798 MB** · Redis **0.3 vCPU** · whole server busy **87 %**, of which kernel (network, disk) **31 %** · memory used **2284 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · PostgreSQL · get by id with caching, public · round 1 of 2, the closer to the average
**MySQL**
Requests / second
48,818
731,797 requests in 15 s
Latency p50
2ms
average 1.5 ms
Latency p99
3ms
max 12 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **48,784** · 2 : **48,852** req/s · spread 0.1 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **6.2 vCPU**, **134 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **864 MB** · Redis **0.3 vCPU** · whole server busy **87 %**, of which kernel (network, disk) **31 %** · memory used **2551 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · MySQL · get by id with caching, public · round 1 of 2, the closer to the average
### Get by id with caching : both tokens
With `x-am-authorization` and `x-am-user-authorization`, both checked on every request. Each answer : 278 bytes (MongoDB), status 200.
**MongoDB**
Requests / second
38,521
582,318 requests in 15 s
Latency p50
2ms
average 2.1 ms
Latency p99
4ms
max 15 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **38,824** · 2 : **38,218** req/s · spread 1.6 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **6.5 vCPU**, **139 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **839 MB** · Redis **0.3 vCPU** · whole server busy **89 %**, of which kernel (network, disk) **25 %** · memory used **1799 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · MongoDB · get by id with caching, both tokens · round 1 of 2, the closer to the average
**PostgreSQL**
Requests / second
38,045
574,818 requests in 15 s
Latency p50
2ms
average 2.1 ms
Latency p99
4ms
max 14 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **38,320** · 2 : **37,770** req/s · spread 1.4 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **6.4 vCPU**, **136 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **798 MB** · Redis **0.3 vCPU** · whole server busy **88 %**, of which kernel (network, disk) **26 %** · memory used **2279 MB** of 15992 MB · steal **1 %** · swap not touched
autocannon · PostgreSQL · get by id with caching, both tokens · round 1 of 2, the closer to the average
**MySQL**
Requests / second
38,544
579,232 requests in 15 s
Latency p50
2ms
average 2.1 ms
Latency p99
4ms
max 11 ms
Errors
0
non-2xx, errors, timeouts
(2 rounds of 15 s) 1 : **38,617** · 2 : **38,472** req/s · spread 0.4 % · the output below is round 1, the closer to the average
(Server during this run) API Maker **6.5 vCPU**, **134 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **864 MB** · Redis **0.2 vCPU** · whole server busy **89 %**, of which kernel (network, disk) **27 %** · memory used **2545 MB** of 15992 MB · steal **0 %** · swap not touched
autocannon · MySQL · get by id with caching, both tokens · round 1 of 2, the closer to the average
## Insert one row
`POST …/