# 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

<nav class="am-bench-switch" aria-label="Benchmark servers">
Shared CPU

- [1 vCPU1 GB · $5](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-1-vcpu-1gb.html)
- [2 vCPU4 GB · $24](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-2-vcpu-4gb.html)
- [4 vCPU8 GB · $48](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-4-vcpu-8gb.html)
- [8 vCPU32 GB · $192](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html)

Dedicated CPU

- [2 vCPU4 GB · $36](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-2-vcpu-4gb.html)
- [4 vCPU8 GB · $72](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-4-vcpu-8gb.html)
- [8 vCPU16 GB · $144](https://docs.apimaker.dev/v4/docs/benchmarks/linode-dedicated-8-vcpu-16gb.html)

Compare

[All resultsevery server side by side](https://docs.apimaker.dev/v4/docs/benchmarks/summary.html)

</nav>

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)<br>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<br>at rest → under load | PostgreSQL<br>at rest → under load | MySQL<br>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/<user>/<instance>/<database>/<table>`. 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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l "http://192.168.133.239:38246/api/schema/bench/mongodb/am_bench/customers_public"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/mongodb/am_bench/customers_public
    100 connections
    5 workers

    ┌─────────┬──────┬───────┬───────┬───────┬──────────┬──────────┬────────┐
    │ Stat    │ 2.5% │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev    │ Max    │
    ├─────────┼──────┼───────┼───────┼───────┼──────────┼──────────┼────────┤
    │ Latency │ 7 ms │ 20 ms │ 31 ms │ 40 ms │ 20.42 ms │ 25.63 ms │ 973 ms │
    └─────────┴──────┴───────┴───────┴───────┴──────────┴──────────┴────────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 4,563   │ 4,563   │ 4,691   │ 5,827   │ 4,841.47 │ 350.71 │ 4,563   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 12.5 MB │ 12.5 MB │ 12.8 MB │ 15.9 MB │ 13.2 MB  │ 957 kB │ 12.5 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 1            │
    ├────────────┼──────────────┤
    │ 0.01       │ 1            │
    ├────────────┼──────────────┤
    │ 0.1        │ 2            │
    ├────────────┼──────────────┤
    │ 1          │ 5            │
    ├────────────┼──────────────┤
    │ 2.5        │ 7            │
    ├────────────┼──────────────┤
    │ 10         │ 12           │
    ├────────────┼──────────────┤
    │ 25         │ 17           │
    ├────────────┼──────────────┤
    │ 50         │ 20           │
    ├────────────┼──────────────┤
    │ 75         │ 23           │
    ├────────────┼──────────────┤
    │ 90         │ 26           │
    ├────────────┼──────────────┤
    │ 97.5       │ 31           │
    ├────────────┼──────────────┤
    │ 99         │ 40           │
    ├────────────┼──────────────┤
    │ 99.9       │ 95           │
    ├────────────┼──────────────┤
    │ 99.99      │ 966          │
    ├────────────┼──────────────┤
    │ 99.999     │ 973          │
    └────────────┴──────────────┘

    73k requests in 15.02s, 199 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l "http://192.168.133.239:38246/api/schema/bench/postgres/am_bench/public.customers_public"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/postgres/am_bench/public.customers_public
    100 connections
    5 workers

    ┌─────────┬───────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼───────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 14 ms │ 18 ms │ 21 ms │ 22 ms │ 17.87 ms │ 1.88 ms │ 32 ms │
    └─────────┴───────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬───────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%   │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼───────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 5,055   │ 5,055   │ 5,375 │ 6,135   │ 5,444.94 │ 315.33 │ 5,052   │
    ├───────────┼─────────┼─────────┼───────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 12.2 MB │ 12.2 MB │ 13 MB │ 14.9 MB │ 13.2 MB  │ 764 kB │ 12.2 MB │
    └───────────┴─────────┴─────────┴───────┴─────────┴──────────┴────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 1            │
    ├────────────┼──────────────┤
    │ 0.01       │ 3            │
    ├────────────┼──────────────┤
    │ 0.1        │ 7            │
    ├────────────┼──────────────┤
    │ 1          │ 13           │
    ├────────────┼──────────────┤
    │ 2.5        │ 14           │
    ├────────────┼──────────────┤
    │ 10         │ 16           │
    ├────────────┼──────────────┤
    │ 25         │ 17           │
    ├────────────┼──────────────┤
    │ 50         │ 18           │
    ├────────────┼──────────────┤
    │ 75         │ 19           │
    ├────────────┼──────────────┤
    │ 90         │ 20           │
    ├────────────┼──────────────┤
    │ 97.5       │ 21           │
    ├────────────┼──────────────┤
    │ 99         │ 22           │
    ├────────────┼──────────────┤
    │ 99.9       │ 27           │
    ├────────────┼──────────────┤
    │ 99.99      │ 30           │
    ├────────────┼──────────────┤
    │ 99.999     │ 32           │
    └────────────┴──────────────┘

    82k requests in 15.02s, 198 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l "http://192.168.133.239:38246/api/schema/bench/mysql/am_bench/customers_public"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/mysql/am_bench/customers_public
    100 connections
    5 workers

    ┌─────────┬───────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼───────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 13 ms │ 14 ms │ 17 ms │ 17 ms │ 14.26 ms │ 1.12 ms │ 30 ms │
    └─────────┴───────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬───────┬───────┬─────────┬─────────┬──────────┬────────┬───────┐
    │ Stat      │ 1%    │ 2.5%  │ 50%     │ 97.5%   │ Avg      │ Stdev  │ Min   │
    ├───────────┼───────┼───────┼─────────┼─────────┼──────────┼────────┼───────┤
    │ Req/Sec   │ 6,595 │ 6,595 │ 6,807   │ 6,847   │ 6,774.27 │ 70.77  │ 6,593 │
    ├───────────┼───────┼───────┼─────────┼─────────┼──────────┼────────┼───────┤
    │ Bytes/Sec │ 16 MB │ 16 MB │ 16.5 MB │ 16.6 MB │ 16.4 MB  │ 173 kB │ 16 MB │
    └───────────┴───────┴───────┴─────────┴─────────┴──────────┴────────┴───────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 1            │
    ├────────────┼──────────────┤
    │ 0.01       │ 2            │
    ├────────────┼──────────────┤
    │ 0.1        │ 11           │
    ├────────────┼──────────────┤
    │ 1          │ 12           │
    ├────────────┼──────────────┤
    │ 2.5        │ 13           │
    ├────────────┼──────────────┤
    │ 10         │ 13           │
    ├────────────┼──────────────┤
    │ 25         │ 14           │
    ├────────────┼──────────────┤
    │ 50         │ 14           │
    ├────────────┼──────────────┤
    │ 75         │ 15           │
    ├────────────┼──────────────┤
    │ 90         │ 16           │
    ├────────────┼──────────────┤
    │ 97.5       │ 17           │
    ├────────────┼──────────────┤
    │ 99         │ 17           │
    ├────────────┼──────────────┤
    │ 99.9       │ 21           │
    ├────────────┼──────────────┤
    │ 99.99      │ 26           │
    ├────────────┼──────────────┤
    │ 99.999     │ 28           │
    └────────────┴──────────────┘

    102k requests in 15.02s, 246 MB read
    ```

### 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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l -H "x-am-authorization: <token>" -H "x-am-user-authorization: <token>" "http://192.168.133.239:38246/api/schema/bench/mongodb/am_bench/customers"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/mongodb/am_bench/customers
    100 connections
    5 workers

    ┌─────────┬───────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼───────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 10 ms │ 22 ms │ 35 ms │ 38 ms │ 21.89 ms │ 6.21 ms │ 82 ms │
    └─────────┴───────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 4,303   │ 4,303   │ 4,479   │ 4,579   │ 4,466.27 │ 79.84  │ 4,300   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 11.8 MB │ 11.8 MB │ 12.3 MB │ 12.5 MB │ 12.2 MB  │ 220 kB │ 11.8 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 0            │
    ├────────────┼──────────────┤
    │ 0.01       │ 2            │
    ├────────────┼──────────────┤
    │ 0.1        │ 4            │
    ├────────────┼──────────────┤
    │ 1          │ 8            │
    ├────────────┼──────────────┤
    │ 2.5        │ 10           │
    ├────────────┼──────────────┤
    │ 10         │ 14           │
    ├────────────┼──────────────┤
    │ 25         │ 18           │
    ├────────────┼──────────────┤
    │ 50         │ 22           │
    ├────────────┼──────────────┤
    │ 75         │ 26           │
    ├────────────┼──────────────┤
    │ 90         │ 29           │
    ├────────────┼──────────────┤
    │ 97.5       │ 35           │
    ├────────────┼──────────────┤
    │ 99         │ 38           │
    ├────────────┼──────────────┤
    │ 99.9       │ 52           │
    ├────────────┼──────────────┤
    │ 99.99      │ 74           │
    ├────────────┼──────────────┤
    │ 99.999     │ 82           │
    └────────────┴──────────────┘

    67k requests in 15.02s, 183 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l -H "x-am-authorization: <token>" -H "x-am-user-authorization: <token>" "http://192.168.133.239:38246/api/schema/bench/postgres/am_bench/public.customers"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/postgres/am_bench/public.customers
    100 connections
    5 workers

    ┌─────────┬───────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼───────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 16 ms │ 18 ms │ 21 ms │ 22 ms │ 18.38 ms │ 1.31 ms │ 29 ms │
    └─────────┴───────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 5,151   │ 5,151   │ 5,315   │ 5,395   │ 5,295.87 │ 70.87  │ 5,148   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 12.5 MB │ 12.5 MB │ 12.9 MB │ 13.1 MB │ 12.8 MB  │ 173 kB │ 12.5 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 5            │
    ├────────────┼──────────────┤
    │ 0.01       │ 7            │
    ├────────────┼──────────────┤
    │ 0.1        │ 15           │
    ├────────────┼──────────────┤
    │ 1          │ 16           │
    ├────────────┼──────────────┤
    │ 2.5        │ 16           │
    ├────────────┼──────────────┤
    │ 10         │ 17           │
    ├────────────┼──────────────┤
    │ 25         │ 18           │
    ├────────────┼──────────────┤
    │ 50         │ 18           │
    ├────────────┼──────────────┤
    │ 75         │ 19           │
    ├────────────┼──────────────┤
    │ 90         │ 20           │
    ├────────────┼──────────────┤
    │ 97.5       │ 21           │
    ├────────────┼──────────────┤
    │ 99         │ 22           │
    ├────────────┼──────────────┤
    │ 99.9       │ 25           │
    ├────────────┼──────────────┤
    │ 99.99      │ 28           │
    ├────────────┼──────────────┤
    │ 99.999     │ 29           │
    └────────────┴──────────────┘

    80k requests in 15.02s, 193 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l -H "x-am-authorization: <token>" -H "x-am-user-authorization: <token>" "http://192.168.133.239:38246/api/schema/bench/mysql/am_bench/customers"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/mysql/am_bench/customers
    100 connections
    5 workers

    ┌─────────┬───────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼───────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 14 ms │ 16 ms │ 19 ms │ 20 ms │ 16.25 ms │ 1.38 ms │ 30 ms │
    └─────────┴───────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬───────┬───────┬─────────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%    │ 2.5%  │ 50%     │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼───────┼───────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 5,755 │ 5,755 │ 5,959   │ 6,411   │ 5,969.74 │ 157.58 │ 5,754   │
    ├───────────┼───────┼───────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 14 MB │ 14 MB │ 14.4 MB │ 15.5 MB │ 14.5 MB  │ 382 kB │ 13.9 MB │
    └───────────┴───────┴───────┴─────────┴─────────┴──────────┴────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 2            │
    ├────────────┼──────────────┤
    │ 0.01       │ 2            │
    ├────────────┼──────────────┤
    │ 0.1        │ 9            │
    ├────────────┼──────────────┤
    │ 1          │ 13           │
    ├────────────┼──────────────┤
    │ 2.5        │ 14           │
    ├────────────┼──────────────┤
    │ 10         │ 15           │
    ├────────────┼──────────────┤
    │ 25         │ 16           │
    ├────────────┼──────────────┤
    │ 50         │ 16           │
    ├────────────┼──────────────┤
    │ 75         │ 17           │
    ├────────────┼──────────────┤
    │ 90         │ 18           │
    ├────────────┼──────────────┤
    │ 97.5       │ 19           │
    ├────────────┼──────────────┤
    │ 99         │ 20           │
    ├────────────┼──────────────┤
    │ 99.9       │ 23           │
    ├────────────┼──────────────┤
    │ 99.99      │ 27           │
    ├────────────┼──────────────┤
    │ 99.999     │ 30           │
    └────────────┴──────────────┘

    90k requests in 15.02s, 217 MB read
    ```

## 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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l "http://192.168.133.239:38246/api/schema/bench/mongodb/am_bench/customers_public_cached"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/mongodb/am_bench/customers_public_cached
    100 connections
    5 workers

    ┌─────────┬──────┬──────┬───────┬──────┬─────────┬──────────┬────────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg     │ Stdev    │ Max    │
    ├─────────┼──────┼──────┼───────┼──────┼─────────┼──────────┼────────┤
    │ Latency │ 2 ms │ 5 ms │ 7 ms  │ 8 ms │ 5.03 ms │ 10.65 ms │ 916 ms │
    └─────────┴──────┴──────┴───────┴──────┴─────────┴──────────┴────────┘
    ┌───────────┬─────────┬─────────┬────────┬─────────┬──────────┬──────────┬────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%    │ 97.5%   │ Avg      │ Stdev    │ Min    │
    ├───────────┼─────────┼─────────┼────────┼─────────┼──────────┼──────────┼────────┤
    │ Req/Sec   │ 16,831  │ 16,831  │ 17,887 │ 23,695  │ 18,356.8 │ 1,748.38 │ 16,824 │
    ├───────────┼─────────┼─────────┼────────┼─────────┼──────────┼──────────┼────────┤
    │ Bytes/Sec │ 46.1 MB │ 46.1 MB │ 49 MB  │ 64.8 MB │ 50.2 MB  │ 4.78 MB  │ 46 MB  │
    └───────────┴─────────┴─────────┴────────┴─────────┴──────────┴──────────┴────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 0            │
    ├────────────┼──────────────┤
    │ 0.01       │ 0            │
    ├────────────┼──────────────┤
    │ 0.1        │ 1            │
    ├────────────┼──────────────┤
    │ 1          │ 2            │
    ├────────────┼──────────────┤
    │ 2.5        │ 2            │
    ├────────────┼──────────────┤
    │ 10         │ 3            │
    ├────────────┼──────────────┤
    │ 25         │ 4            │
    ├────────────┼──────────────┤
    │ 50         │ 5            │
    ├────────────┼──────────────┤
    │ 75         │ 6            │
    ├────────────┼──────────────┤
    │ 90         │ 6            │
    ├────────────┼──────────────┤
    │ 97.5       │ 7            │
    ├────────────┼──────────────┤
    │ 99         │ 8            │
    ├────────────┼──────────────┤
    │ 99.9       │ 12           │
    ├────────────┼──────────────┤
    │ 99.99      │ 847          │
    ├────────────┼──────────────┤
    │ 99.999     │ 915          │
    └────────────┴──────────────┘

    275k requests in 15.02s, 754 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l "http://192.168.133.239:38246/api/schema/bench/postgres/am_bench/public.customers_public_cached"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/postgres/am_bench/public.customers_public_cached
    100 connections
    5 workers

    ┌─────────┬──────┬──────┬───────┬──────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼──────┼─────────┼─────────┼───────┤
    │ Latency │ 3 ms │ 5 ms │ 7 ms  │ 8 ms │ 5.08 ms │ 1.18 ms │ 21 ms │
    └─────────┴──────┴──────┴───────┴──────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬───────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg       │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Req/Sec   │ 17,199  │ 17,199  │ 17,951  │ 18,703  │ 17,922.67 │ 405.27 │ 17,195  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Bytes/Sec │ 41.7 MB │ 41.7 MB │ 43.5 MB │ 45.4 MB │ 43.5 MB   │ 981 kB │ 41.7 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴───────────┴────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 0            │
    ├────────────┼──────────────┤
    │ 0.01       │ 1            │
    ├────────────┼──────────────┤
    │ 0.1        │ 1            │
    ├────────────┼──────────────┤
    │ 1          │ 2            │
    ├────────────┼──────────────┤
    │ 2.5        │ 3            │
    ├────────────┼──────────────┤
    │ 10         │ 4            │
    ├────────────┼──────────────┤
    │ 25         │ 4            │
    ├────────────┼──────────────┤
    │ 50         │ 5            │
    ├────────────┼──────────────┤
    │ 75         │ 6            │
    ├────────────┼──────────────┤
    │ 90         │ 6            │
    ├────────────┼──────────────┤
    │ 97.5       │ 7            │
    ├────────────┼──────────────┤
    │ 99         │ 8            │
    ├────────────┼──────────────┤
    │ 99.9       │ 10           │
    ├────────────┼──────────────┤
    │ 99.99      │ 18           │
    ├────────────┼──────────────┤
    │ 99.999     │ 20           │
    └────────────┴──────────────┘

    269k requests in 15.02s, 652 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l "http://192.168.133.239:38246/api/schema/bench/mysql/am_bench/customers_public_cached"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/mysql/am_bench/customers_public_cached
    100 connections
    5 workers

    ┌─────────┬──────┬──────┬───────┬──────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼──────┼─────────┼─────────┼───────┤
    │ Latency │ 3 ms │ 5 ms │ 7 ms  │ 8 ms │ 5.02 ms │ 1.19 ms │ 37 ms │
    └─────────┴──────┴──────┴───────┴──────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬───────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg       │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Req/Sec   │ 17,535  │ 17,535  │ 18,095  │ 19,135  │ 18,109.34 │ 394.64 │ 17,521  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Bytes/Sec │ 42.5 MB │ 42.5 MB │ 43.9 MB │ 46.4 MB │ 43.9 MB   │ 962 kB │ 42.5 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴───────────┴────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 0            │
    ├────────────┼──────────────┤
    │ 0.01       │ 1            │
    ├────────────┼──────────────┤
    │ 0.1        │ 1            │
    ├────────────┼──────────────┤
    │ 1          │ 2            │
    ├────────────┼──────────────┤
    │ 2.5        │ 3            │
    ├────────────┼──────────────┤
    │ 10         │ 4            │
    ├────────────┼──────────────┤
    │ 25         │ 4            │
    ├────────────┼──────────────┤
    │ 50         │ 5            │
    ├────────────┼──────────────┤
    │ 75         │ 6            │
    ├────────────┼──────────────┤
    │ 90         │ 6            │
    ├────────────┼──────────────┤
    │ 97.5       │ 7            │
    ├────────────┼──────────────┤
    │ 99         │ 8            │
    ├────────────┼──────────────┤
    │ 99.9       │ 10           │
    ├────────────┼──────────────┤
    │ 99.99      │ 21           │
    ├────────────┼──────────────┤
    │ 99.999     │ 32           │
    └────────────┴──────────────┘

    272k requests in 15.02s, 659 MB read
    ```

### 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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l -H "x-am-authorization: <token>" -H "x-am-user-authorization: <token>" "http://192.168.133.239:38246/api/schema/bench/mongodb/am_bench/customers_cached"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/mongodb/am_bench/customers_cached
    100 connections
    5 workers

    ┌─────────┬──────┬──────┬───────┬───────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%   │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼───────┼─────────┼─────────┼───────┤
    │ Latency │ 4 ms │ 7 ms │ 10 ms │ 10 ms │ 6.59 ms │ 1.51 ms │ 26 ms │
    └─────────┴──────┴──────┴───────┴───────┴─────────┴─────────┴───────┘
    ┌───────────┬────────┬────────┬─────────┬────────┬───────────┬─────────┬────────┐
    │ Stat      │ 1%     │ 2.5%   │ 50%     │ 97.5%  │ Avg       │ Stdev   │ Min    │
    ├───────────┼────────┼────────┼─────────┼────────┼───────────┼─────────┼────────┤
    │ Req/Sec   │ 13,519 │ 13,519 │ 14,119  │ 14,967 │ 14,111.74 │ 387.51  │ 13,519 │
    ├───────────┼────────┼────────┼─────────┼────────┼───────────┼─────────┼────────┤
    │ Bytes/Sec │ 37 MB  │ 37 MB  │ 38.6 MB │ 41 MB  │ 38.6 MB   │ 1.06 MB │ 37 MB  │
    └───────────┴────────┴────────┴─────────┴────────┴───────────┴─────────┴────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 1            │
    ├────────────┼──────────────┤
    │ 0.01       │ 1            │
    ├────────────┼──────────────┤
    │ 0.1        │ 2            │
    ├────────────┼──────────────┤
    │ 1          │ 3            │
    ├────────────┼──────────────┤
    │ 2.5        │ 4            │
    ├────────────┼──────────────┤
    │ 10         │ 5            │
    ├────────────┼──────────────┤
    │ 25         │ 6            │
    ├────────────┼──────────────┤
    │ 50         │ 7            │
    ├────────────┼──────────────┤
    │ 75         │ 8            │
    ├────────────┼──────────────┤
    │ 90         │ 8            │
    ├────────────┼──────────────┤
    │ 97.5       │ 10           │
    ├────────────┼──────────────┤
    │ 99         │ 10           │
    ├────────────┼──────────────┤
    │ 99.9       │ 13           │
    ├────────────┼──────────────┤
    │ 99.99      │ 21           │
    ├────────────┼──────────────┤
    │ 99.999     │ 26           │
    └────────────┴──────────────┘

    212k requests in 15.02s, 579 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l -H "x-am-authorization: <token>" -H "x-am-user-authorization: <token>" "http://192.168.133.239:38246/api/schema/bench/postgres/am_bench/public.customers_cached"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/postgres/am_bench/public.customers_cached
    100 connections
    5 workers

    ┌─────────┬──────┬──────┬───────┬───────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%   │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼───────┼─────────┼─────────┼───────┤
    │ Latency │ 4 ms │ 7 ms │ 10 ms │ 12 ms │ 6.67 ms │ 1.74 ms │ 25 ms │
    └─────────┴──────┴──────┴───────┴───────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg     │ Stdev   │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤
    │ Req/Sec   │ 12,431  │ 12,431  │ 14,207  │ 14,615  │ 13,940  │ 650.35  │ 12,431  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤
    │ Bytes/Sec │ 30.2 MB │ 30.2 MB │ 34.5 MB │ 35.5 MB │ 33.8 MB │ 1.58 MB │ 30.2 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 0            │
    ├────────────┼──────────────┤
    │ 0.01       │ 1            │
    ├────────────┼──────────────┤
    │ 0.1        │ 2            │
    ├────────────┼──────────────┤
    │ 1          │ 3            │
    ├────────────┼──────────────┤
    │ 2.5        │ 4            │
    ├────────────┼──────────────┤
    │ 10         │ 5            │
    ├────────────┼──────────────┤
    │ 25         │ 6            │
    ├────────────┼──────────────┤
    │ 50         │ 7            │
    ├────────────┼──────────────┤
    │ 75         │ 8            │
    ├────────────┼──────────────┤
    │ 90         │ 9            │
    ├────────────┼──────────────┤
    │ 97.5       │ 10           │
    ├────────────┼──────────────┤
    │ 99         │ 12           │
    ├────────────┼──────────────┤
    │ 99.9       │ 18           │
    ├────────────┼──────────────┤
    │ 99.99      │ 22           │
    ├────────────┼──────────────┤
    │ 99.999     │ 24           │
    └────────────┴──────────────┘

    209k requests in 15.02s, 507 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l -H "x-am-authorization: <token>" -H "x-am-user-authorization: <token>" "http://192.168.133.239:38246/api/schema/bench/mysql/am_bench/customers_cached"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/mysql/am_bench/customers_cached
    100 connections
    5 workers

    ┌─────────┬──────┬──────┬───────┬───────┬─────────┬────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%   │ Avg     │ Stdev  │ Max   │
    ├─────────┼──────┼──────┼───────┼───────┼─────────┼────────┼───────┤
    │ Latency │ 4 ms │ 7 ms │ 10 ms │ 10 ms │ 6.66 ms │ 1.5 ms │ 25 ms │
    └─────────┴──────┴──────┴───────┴───────┴─────────┴────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬───────────┬─────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg       │ Stdev   │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼─────────┼─────────┤
    │ Req/Sec   │ 13,167  │ 13,167  │ 13,919  │ 14,871  │ 13,966.67 │ 480.06  │ 13,162  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼─────────┼─────────┤
    │ Bytes/Sec │ 31.9 MB │ 31.9 MB │ 33.8 MB │ 36.1 MB │ 33.9 MB   │ 1.17 MB │ 31.9 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴───────────┴─────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 1            │
    ├────────────┼──────────────┤
    │ 0.01       │ 1            │
    ├────────────┼──────────────┤
    │ 0.1        │ 2            │
    ├────────────┼──────────────┤
    │ 1          │ 3            │
    ├────────────┼──────────────┤
    │ 2.5        │ 4            │
    ├────────────┼──────────────┤
    │ 10         │ 5            │
    ├────────────┼──────────────┤
    │ 25         │ 6            │
    ├────────────┼──────────────┤
    │ 50         │ 7            │
    ├────────────┼──────────────┤
    │ 75         │ 8            │
    ├────────────┼──────────────┤
    │ 90         │ 8            │
    ├────────────┼──────────────┤
    │ 97.5       │ 10           │
    ├────────────┼──────────────┤
    │ 99         │ 10           │
    ├────────────┼──────────────┤
    │ 99.9       │ 13           │
    ├────────────┼──────────────┤
    │ 99.99      │ 19           │
    ├────────────┼──────────────┤
    │ 99.999     │ 24           │
    └────────────┴──────────────┘

    210k requests in 15.02s, 508 MB read
    ```

## Get all by stream

`GET …/<table>/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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l "http://192.168.133.239:38246/api/schema/bench/mongodb/am_bench/customers_public/stream"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/mongodb/am_bench/customers_public/stream
    100 connections
    5 workers

    ┌─────────┬───────┬───────┬───────┬───────┬──────────┬─────────┬────────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max    │
    ├─────────┼───────┼───────┼───────┼───────┼──────────┼─────────┼────────┤
    │ Latency │ 11 ms │ 21 ms │ 34 ms │ 39 ms │ 21.53 ms │ 6.26 ms │ 104 ms │
    └─────────┴───────┴───────┴───────┴───────┴──────────┴─────────┴────────┘
    ┌───────────┬─────────┬─────────┬───────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%   │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼───────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 4,363   │ 4,363   │ 4,507 │ 4,687   │ 4,537.47 │ 93.8   │ 4,363   │
    ├───────────┼─────────┼─────────┼───────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 12.6 MB │ 12.6 MB │ 13 MB │ 13.5 MB │ 13.1 MB  │ 269 kB │ 12.6 MB │
    └───────────┴─────────┴─────────┴───────┴─────────┴──────────┴────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 3            │
    ├────────────┼──────────────┤
    │ 0.01       │ 4            │
    ├────────────┼──────────────┤
    │ 0.1        │ 6            │
    ├────────────┼──────────────┤
    │ 1          │ 9            │
    ├────────────┼──────────────┤
    │ 2.5        │ 11           │
    ├────────────┼──────────────┤
    │ 10         │ 14           │
    ├────────────┼──────────────┤
    │ 25         │ 18           │
    ├────────────┼──────────────┤
    │ 50         │ 21           │
    ├────────────┼──────────────┤
    │ 75         │ 25           │
    ├────────────┼──────────────┤
    │ 90         │ 29           │
    ├────────────┼──────────────┤
    │ 97.5       │ 34           │
    ├────────────┼──────────────┤
    │ 99         │ 39           │
    ├────────────┼──────────────┤
    │ 99.9       │ 69           │
    ├────────────┼──────────────┤
    │ 99.99      │ 90           │
    ├────────────┼──────────────┤
    │ 99.999     │ 104          │
    └────────────┴──────────────┘

    68k requests in 15.02s, 196 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l "http://192.168.133.239:38246/api/schema/bench/postgres/am_bench/public.customers_public/stream"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/postgres/am_bench/public.customers_public/stream
    100 connections
    5 workers

    ┌─────────┬───────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼───────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 14 ms │ 17 ms │ 19 ms │ 20 ms │ 16.57 ms │ 1.34 ms │ 31 ms │
    └─────────┴───────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬───────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%   │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼───────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 5,671   │ 5,671   │ 5,839 │ 6,187   │ 5,858.27 │ 119.2  │ 5,669   │
    ├───────────┼─────────┼─────────┼───────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 14.6 MB │ 14.6 MB │ 15 MB │ 15.9 MB │ 15.1 MB  │ 306 kB │ 14.6 MB │
    └───────────┴─────────┴─────────┴───────┴─────────┴──────────┴────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 1            │
    ├────────────┼──────────────┤
    │ 0.01       │ 3            │
    ├────────────┼──────────────┤
    │ 0.1        │ 8            │
    ├────────────┼──────────────┤
    │ 1          │ 13           │
    ├────────────┼──────────────┤
    │ 2.5        │ 14           │
    ├────────────┼──────────────┤
    │ 10         │ 15           │
    ├────────────┼──────────────┤
    │ 25         │ 16           │
    ├────────────┼──────────────┤
    │ 50         │ 17           │
    ├────────────┼──────────────┤
    │ 75         │ 17           │
    ├────────────┼──────────────┤
    │ 90         │ 18           │
    ├────────────┼──────────────┤
    │ 97.5       │ 19           │
    ├────────────┼──────────────┤
    │ 99         │ 20           │
    ├────────────┼──────────────┤
    │ 99.9       │ 23           │
    ├────────────┼──────────────┤
    │ 99.99      │ 28           │
    ├────────────┼──────────────┤
    │ 99.999     │ 31           │
    └────────────┴──────────────┘

    88k requests in 15.02s, 226 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l "http://192.168.133.239:38246/api/schema/bench/mysql/am_bench/customers_public/stream"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/mysql/am_bench/customers_public/stream
    100 connections
    5 workers

    ┌─────────┬───────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼───────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 15 ms │ 17 ms │ 19 ms │ 21 ms │ 16.66 ms │ 1.33 ms │ 29 ms │
    └─────────┴───────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬─────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg     │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼────────┼─────────┤
    │ Req/Sec   │ 5,659   │ 5,659   │ 5,795   │ 6,139   │ 5,826.8 │ 130.7  │ 5,656   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼────────┼─────────┤
    │ Bytes/Sec │ 14.6 MB │ 14.6 MB │ 14.9 MB │ 15.8 MB │ 15 MB   │ 338 kB │ 14.6 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴─────────┴────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 5            │
    ├────────────┼──────────────┤
    │ 0.01       │ 6            │
    ├────────────┼──────────────┤
    │ 0.1        │ 12           │
    ├────────────┼──────────────┤
    │ 1          │ 14           │
    ├────────────┼──────────────┤
    │ 2.5        │ 15           │
    ├────────────┼──────────────┤
    │ 10         │ 15           │
    ├────────────┼──────────────┤
    │ 25         │ 16           │
    ├────────────┼──────────────┤
    │ 50         │ 17           │
    ├────────────┼──────────────┤
    │ 75         │ 17           │
    ├────────────┼──────────────┤
    │ 90         │ 18           │
    ├────────────┼──────────────┤
    │ 97.5       │ 19           │
    ├────────────┼──────────────┤
    │ 99         │ 21           │
    ├────────────┼──────────────┤
    │ 99.9       │ 24           │
    ├────────────┼──────────────┤
    │ 99.99      │ 27           │
    ├────────────┼──────────────┤
    │ 99.999     │ 29           │
    └────────────┴──────────────┘

    87k requests in 15.02s, 225 MB read
    ```

### 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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l -H "x-am-authorization: <token>" -H "x-am-user-authorization: <token>" "http://192.168.133.239:38246/api/schema/bench/mongodb/am_bench/customers/stream"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/mongodb/am_bench/customers/stream
    100 connections
    5 workers

    ┌─────────┬───────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼───────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 12 ms │ 23 ms │ 35 ms │ 39 ms │ 22.79 ms │ 5.95 ms │ 83 ms │
    └─────────┴───────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 4,041   │ 4,041   │ 4,307   │ 4,459   │ 4,293.47 │ 115.19 │ 4,040   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 12.1 MB │ 12.1 MB │ 12.9 MB │ 13.3 MB │ 12.8 MB  │ 344 kB │ 12.1 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 2            │
    ├────────────┼──────────────┤
    │ 0.01       │ 4            │
    ├────────────┼──────────────┤
    │ 0.1        │ 6            │
    ├────────────┼──────────────┤
    │ 1          │ 10           │
    ├────────────┼──────────────┤
    │ 2.5        │ 12           │
    ├────────────┼──────────────┤
    │ 10         │ 16           │
    ├────────────┼──────────────┤
    │ 25         │ 19           │
    ├────────────┼──────────────┤
    │ 50         │ 23           │
    ├────────────┼──────────────┤
    │ 75         │ 26           │
    ├────────────┼──────────────┤
    │ 90         │ 30           │
    ├────────────┼──────────────┤
    │ 97.5       │ 35           │
    ├────────────┼──────────────┤
    │ 99         │ 39           │
    ├────────────┼──────────────┤
    │ 99.9       │ 51           │
    ├────────────┼──────────────┤
    │ 99.99      │ 75           │
    ├────────────┼──────────────┤
    │ 99.999     │ 83           │
    └────────────┴──────────────┘

    64k requests in 15.02s, 192 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l -H "x-am-authorization: <token>" -H "x-am-user-authorization: <token>" "http://192.168.133.239:38246/api/schema/bench/postgres/am_bench/public.customers/stream"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/postgres/am_bench/public.customers/stream
    100 connections
    5 workers

    ┌─────────┬───────┬───────┬───────┬───────┬───────┬─────────┬───────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg   │ Stdev   │ Max   │
    ├─────────┼───────┼───────┼───────┼───────┼───────┼─────────┼───────┤
    │ Latency │ 17 ms │ 19 ms │ 22 ms │ 23 ms │ 19 ms │ 1.44 ms │ 29 ms │
    └─────────┴───────┴───────┴───────┴───────┴───────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬───────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5% │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼───────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 4,979   │ 4,979   │ 5,183   │ 5,243 │ 5,127.61 │ 94.82  │ 4,978   │
    ├───────────┼─────────┼─────────┼─────────┼───────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 13.3 MB │ 13.3 MB │ 13.9 MB │ 14 MB │ 13.7 MB  │ 253 kB │ 13.3 MB │
    └───────────┴─────────┴─────────┴─────────┴───────┴──────────┴────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 2            │
    ├────────────┼──────────────┤
    │ 0.01       │ 2            │
    ├────────────┼──────────────┤
    │ 0.1        │ 5            │
    ├────────────┼──────────────┤
    │ 1          │ 16           │
    ├────────────┼──────────────┤
    │ 2.5        │ 17           │
    ├────────────┼──────────────┤
    │ 10         │ 18           │
    ├────────────┼──────────────┤
    │ 25         │ 18           │
    ├────────────┼──────────────┤
    │ 50         │ 19           │
    ├────────────┼──────────────┤
    │ 75         │ 20           │
    ├────────────┼──────────────┤
    │ 90         │ 21           │
    ├────────────┼──────────────┤
    │ 97.5       │ 22           │
    ├────────────┼──────────────┤
    │ 99         │ 23           │
    ├────────────┼──────────────┤
    │ 99.9       │ 26           │
    ├────────────┼──────────────┤
    │ 99.99      │ 28           │
    ├────────────┼──────────────┤
    │ 99.999     │ 29           │
    └────────────┴──────────────┘

    77k requests in 15.02s, 206 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l -H "x-am-authorization: <token>" -H "x-am-user-authorization: <token>" "http://192.168.133.239:38246/api/schema/bench/mysql/am_bench/customers/stream"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/mysql/am_bench/customers/stream
    100 connections
    5 workers

    ┌─────────┬───────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼───────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 16 ms │ 18 ms │ 21 ms │ 22 ms │ 18.04 ms │ 1.41 ms │ 29 ms │
    └─────────┴───────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 5,171   │ 5,171   │ 5,339   │ 5,579   │ 5,394.27 │ 129.12 │ 5,168   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 13.8 MB │ 13.8 MB │ 14.3 MB │ 14.9 MB │ 14.4 MB  │ 344 kB │ 13.8 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 1            │
    ├────────────┼──────────────┤
    │ 0.01       │ 2            │
    ├────────────┼──────────────┤
    │ 0.1        │ 7            │
    ├────────────┼──────────────┤
    │ 1          │ 15           │
    ├────────────┼──────────────┤
    │ 2.5        │ 16           │
    ├────────────┼──────────────┤
    │ 10         │ 17           │
    ├────────────┼──────────────┤
    │ 25         │ 17           │
    ├────────────┼──────────────┤
    │ 50         │ 18           │
    ├────────────┼──────────────┤
    │ 75         │ 19           │
    ├────────────┼──────────────┤
    │ 90         │ 20           │
    ├────────────┼──────────────┤
    │ 97.5       │ 21           │
    ├────────────┼──────────────┤
    │ 99         │ 22           │
    ├────────────┼──────────────┤
    │ 99.9       │ 25           │
    ├────────────┼──────────────┤
    │ 99.99      │ 28           │
    ├────────────┼──────────────┤
    │ 99.999     │ 29           │
    └────────────┴──────────────┘

    81k requests in 15.03s, 216 MB read
    ```

## 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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l "http://192.168.133.239:38246/api/custom-api/bench/bench_mongodb_public"
    Running 15s test @ http://192.168.133.239:38246/api/custom-api/bench/bench_mongodb_public
    100 connections
    5 workers

    ┌─────────┬───────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼───────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 14 ms │ 31 ms │ 47 ms │ 50 ms │ 30.49 ms │ 8.11 ms │ 72 ms │
    └─────────┴───────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 3,111   │ 3,111   │ 3,243   │ 3,319   │ 3,225.94 │ 62.58  │ 3,111   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 8.51 MB │ 8.51 MB │ 8.87 MB │ 9.08 MB │ 8.82 MB  │ 171 kB │ 8.51 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 1            │
    ├────────────┼──────────────┤
    │ 0.01       │ 1            │
    ├────────────┼──────────────┤
    │ 0.1        │ 4            │
    ├────────────┼──────────────┤
    │ 1          │ 10           │
    ├────────────┼──────────────┤
    │ 2.5        │ 14           │
    ├────────────┼──────────────┤
    │ 10         │ 20           │
    ├────────────┼──────────────┤
    │ 25         │ 25           │
    ├────────────┼──────────────┤
    │ 50         │ 31           │
    ├────────────┼──────────────┤
    │ 75         │ 36           │
    ├────────────┼──────────────┤
    │ 90         │ 41           │
    ├────────────┼──────────────┤
    │ 97.5       │ 47           │
    ├────────────┼──────────────┤
    │ 99         │ 50           │
    ├────────────┼──────────────┤
    │ 99.9       │ 58           │
    ├────────────┼──────────────┤
    │ 99.99      │ 64           │
    ├────────────┼──────────────┤
    │ 99.999     │ 72           │
    └────────────┴──────────────┘

    48k requests in 15.02s, 132 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l "http://192.168.133.239:38246/api/custom-api/bench/bench_postgres_public"
    Running 15s test @ http://192.168.133.239:38246/api/custom-api/bench/bench_postgres_public
    100 connections
    5 workers

    ┌─────────┬───────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼───────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 23 ms │ 26 ms │ 29 ms │ 30 ms │ 25.78 ms │ 1.74 ms │ 43 ms │
    └─────────┴───────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬────────┬─────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%  │ Avg     │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼────────┼─────────┼────────┼─────────┤
    │ Req/Sec   │ 3,719   │ 3,719   │ 3,787   │ 3,919  │ 3,804.2 │ 57.46  │ 3,718   │
    ├───────────┼─────────┼─────────┼─────────┼────────┼─────────┼────────┼─────────┤
    │ Bytes/Sec │ 9.02 MB │ 9.02 MB │ 9.18 MB │ 9.5 MB │ 9.22 MB │ 139 kB │ 9.01 MB │
    └───────────┴─────────┴─────────┴─────────┴────────┴─────────┴────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 2            │
    ├────────────┼──────────────┤
    │ 0.01       │ 3            │
    ├────────────┼──────────────┤
    │ 0.1        │ 10           │
    ├────────────┼──────────────┤
    │ 1          │ 23           │
    ├────────────┼──────────────┤
    │ 2.5        │ 23           │
    ├────────────┼──────────────┤
    │ 10         │ 24           │
    ├────────────┼──────────────┤
    │ 25         │ 25           │
    ├────────────┼──────────────┤
    │ 50         │ 26           │
    ├────────────┼──────────────┤
    │ 75         │ 27           │
    ├────────────┼──────────────┤
    │ 90         │ 28           │
    ├────────────┼──────────────┤
    │ 97.5       │ 29           │
    ├────────────┼──────────────┤
    │ 99         │ 30           │
    ├────────────┼──────────────┤
    │ 99.9       │ 36           │
    ├────────────┼──────────────┤
    │ 99.99      │ 40           │
    ├────────────┼──────────────┤
    │ 99.999     │ 43           │
    └────────────┴──────────────┘

    57k requests in 15.02s, 138 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l "http://192.168.133.239:38246/api/custom-api/bench/bench_mysql_public"
    Running 15s test @ http://192.168.133.239:38246/api/custom-api/bench/bench_mysql_public
    100 connections
    5 workers

    ┌─────────┬───────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼───────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 21 ms │ 24 ms │ 27 ms │ 28 ms │ 23.73 ms │ 1.65 ms │ 36 ms │
    └─────────┴───────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬───────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg   │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────┼────────┼─────────┤
    │ Req/Sec   │ 3,997   │ 3,997   │ 4,111   │ 4,311   │ 4,127 │ 91.56  │ 3,997   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────┼────────┼─────────┤
    │ Bytes/Sec │ 9.69 MB │ 9.69 MB │ 9.96 MB │ 10.4 MB │ 10 MB │ 221 kB │ 9.69 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴───────┴────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 3            │
    ├────────────┼──────────────┤
    │ 0.01       │ 6            │
    ├────────────┼──────────────┤
    │ 0.1        │ 12           │
    ├────────────┼──────────────┤
    │ 1          │ 20           │
    ├────────────┼──────────────┤
    │ 2.5        │ 21           │
    ├────────────┼──────────────┤
    │ 10         │ 22           │
    ├────────────┼──────────────┤
    │ 25         │ 23           │
    ├────────────┼──────────────┤
    │ 50         │ 24           │
    ├────────────┼──────────────┤
    │ 75         │ 25           │
    ├────────────┼──────────────┤
    │ 90         │ 26           │
    ├────────────┼──────────────┤
    │ 97.5       │ 27           │
    ├────────────┼──────────────┤
    │ 99         │ 28           │
    ├────────────┼──────────────┤
    │ 99.9       │ 32           │
    ├────────────┼──────────────┤
    │ 99.99      │ 35           │
    ├────────────┼──────────────┤
    │ 99.999     │ 36           │
    └────────────┴──────────────┘

    62k requests in 15.02s, 150 MB read
    ```

### 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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l -H "x-am-authorization: <token>" -H "x-am-user-authorization: <token>" "http://192.168.133.239:38246/api/custom-api/bench/bench_mongodb_tokens"
    Running 15s test @ http://192.168.133.239:38246/api/custom-api/bench/bench_mongodb_tokens
    100 connections
    5 workers

    ┌─────────┬───────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼───────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 15 ms │ 33 ms │ 50 ms │ 54 ms │ 32.94 ms │ 8.72 ms │ 89 ms │
    └─────────┴───────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 2,921   │ 2,921   │ 2,989   │ 3,061   │ 2,990.07 │ 44.43  │ 2,920   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 7.99 MB │ 7.99 MB │ 8.18 MB │ 8.37 MB │ 8.18 MB  │ 121 kB │ 7.99 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 1            │
    ├────────────┼──────────────┤
    │ 0.01       │ 1            │
    ├────────────┼──────────────┤
    │ 0.1        │ 4            │
    ├────────────┼──────────────┤
    │ 1          │ 11           │
    ├────────────┼──────────────┤
    │ 2.5        │ 15           │
    ├────────────┼──────────────┤
    │ 10         │ 22           │
    ├────────────┼──────────────┤
    │ 25         │ 27           │
    ├────────────┼──────────────┤
    │ 50         │ 33           │
    ├────────────┼──────────────┤
    │ 75         │ 38           │
    ├────────────┼──────────────┤
    │ 90         │ 44           │
    ├────────────┼──────────────┤
    │ 97.5       │ 50           │
    ├────────────┼──────────────┤
    │ 99         │ 54           │
    ├────────────┼──────────────┤
    │ 99.9       │ 63           │
    ├────────────┼──────────────┤
    │ 99.99      │ 82           │
    ├────────────┼──────────────┤
    │ 99.999     │ 89           │
    └────────────┴──────────────┘

    45k requests in 15.02s, 123 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l -H "x-am-authorization: <token>" -H "x-am-user-authorization: <token>" "http://192.168.133.239:38246/api/custom-api/bench/bench_postgres_tokens"
    Running 15s test @ http://192.168.133.239:38246/api/custom-api/bench/bench_postgres_tokens
    100 connections
    5 workers

    ┌─────────┬───────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼───────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 25 ms │ 28 ms │ 31 ms │ 32 ms │ 27.93 ms │ 1.71 ms │ 44 ms │
    └─────────┴───────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg     │ Stdev   │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤
    │ Req/Sec   │ 3,439   │ 3,439   │ 3,527   │ 3,565   │ 3,517.4 │ 36.26   │ 3,438   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤
    │ Bytes/Sec │ 8.34 MB │ 8.34 MB │ 8.55 MB │ 8.64 MB │ 8.52 MB │ 88.9 kB │ 8.33 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 11           │
    ├────────────┼──────────────┤
    │ 0.01       │ 12           │
    ├────────────┼──────────────┤
    │ 0.1        │ 20           │
    ├────────────┼──────────────┤
    │ 1          │ 24           │
    ├────────────┼──────────────┤
    │ 2.5        │ 25           │
    ├────────────┼──────────────┤
    │ 10         │ 26           │
    ├────────────┼──────────────┤
    │ 25         │ 27           │
    ├────────────┼──────────────┤
    │ 50         │ 28           │
    ├────────────┼──────────────┤
    │ 75         │ 29           │
    ├────────────┼──────────────┤
    │ 90         │ 30           │
    ├────────────┼──────────────┤
    │ 97.5       │ 31           │
    ├────────────┼──────────────┤
    │ 99         │ 32           │
    ├────────────┼──────────────┤
    │ 99.9       │ 36           │
    ├────────────┼──────────────┤
    │ 99.99      │ 43           │
    ├────────────┼──────────────┤
    │ 99.999     │ 44           │
    └────────────┴──────────────┘

    53k requests in 15.02s, 128 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l -H "x-am-authorization: <token>" -H "x-am-user-authorization: <token>" "http://192.168.133.239:38246/api/custom-api/bench/bench_mysql_tokens"
    Running 15s test @ http://192.168.133.239:38246/api/custom-api/bench/bench_mysql_tokens
    100 connections
    5 workers

    ┌─────────┬───────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼───────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 24 ms │ 27 ms │ 30 ms │ 31 ms │ 26.64 ms │ 1.66 ms │ 41 ms │
    └─────────┴───────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 3,605   │ 3,605   │ 3,695   │ 3,779   │ 3,683.94 │ 46.06  │ 3,605   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 8.74 MB │ 8.74 MB │ 8.96 MB │ 9.16 MB │ 8.93 MB  │ 111 kB │ 8.74 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 17           │
    ├────────────┼──────────────┤
    │ 0.01       │ 19           │
    ├────────────┼──────────────┤
    │ 0.1        │ 22           │
    ├────────────┼──────────────┤
    │ 1          │ 23           │
    ├────────────┼──────────────┤
    │ 2.5        │ 24           │
    ├────────────┼──────────────┤
    │ 10         │ 25           │
    ├────────────┼──────────────┤
    │ 25         │ 26           │
    ├────────────┼──────────────┤
    │ 50         │ 27           │
    ├────────────┼──────────────┤
    │ 75         │ 28           │
    ├────────────┼──────────────┤
    │ 90         │ 29           │
    ├────────────┼──────────────┤
    │ 97.5       │ 30           │
    ├────────────┼──────────────┤
    │ 99         │ 31           │
    ├────────────┼──────────────┤
    │ 99.9       │ 35           │
    ├────────────┼──────────────┤
    │ 99.99      │ 38           │
    ├────────────┼──────────────┤
    │ 99.999     │ 41           │
    └────────────┴──────────────┘

    55k requests in 15.02s, 134 MB read
    ```

## 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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l "http://192.168.133.239:38246/api/custom-api/bench/bench_mongodb_sandbox"
    Running 15s test @ http://192.168.133.239:38246/api/custom-api/bench/bench_mongodb_sandbox
    100 connections
    5 workers

    ┌─────────┬───────┬───────┬───────┬───────┬──────────┬──────────┬────────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev    │ Max    │
    ├─────────┼───────┼───────┼───────┼───────┼──────────┼──────────┼────────┤
    │ Latency │ 12 ms │ 31 ms │ 55 ms │ 64 ms │ 31.83 ms │ 12.31 ms │ 217 ms │
    └─────────┴───────┴───────┴───────┴───────┴──────────┴──────────┴────────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 2,941   │ 2,941   │ 3,067   │ 3,279   │ 3,087.27 │ 88.44  │ 2,941   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 8.04 MB │ 8.04 MB │ 8.39 MB │ 8.97 MB │ 8.44 MB  │ 242 kB │ 8.04 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 2            │
    ├────────────┼──────────────┤
    │ 0.01       │ 3            │
    ├────────────┼──────────────┤
    │ 0.1        │ 5            │
    ├────────────┼──────────────┤
    │ 1          │ 9            │
    ├────────────┼──────────────┤
    │ 2.5        │ 12           │
    ├────────────┼──────────────┤
    │ 10         │ 18           │
    ├────────────┼──────────────┤
    │ 25         │ 24           │
    ├────────────┼──────────────┤
    │ 50         │ 31           │
    ├────────────┼──────────────┤
    │ 75         │ 39           │
    ├────────────┼──────────────┤
    │ 90         │ 46           │
    ├────────────┼──────────────┤
    │ 97.5       │ 55           │
    ├────────────┼──────────────┤
    │ 99         │ 64           │
    ├────────────┼──────────────┤
    │ 99.9       │ 135          │
    ├────────────┼──────────────┤
    │ 99.99      │ 170          │
    ├────────────┼──────────────┤
    │ 99.999     │ 217          │
    └────────────┴──────────────┘

    46k requests in 15.02s, 127 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l "http://192.168.133.239:38246/api/custom-api/bench/bench_postgres_sandbox"
    Running 15s test @ http://192.168.133.239:38246/api/custom-api/bench/bench_postgres_sandbox
    100 connections
    5 workers

    ┌─────────┬───────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼───────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 14 ms │ 28 ms │ 47 ms │ 51 ms │ 28.71 ms │ 8.59 ms │ 75 ms │
    └─────────┴───────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬─────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg     │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼────────┼─────────┤
    │ Req/Sec   │ 3,351   │ 3,351   │ 3,405   │ 3,511   │ 3,422.2 │ 47.84  │ 3,351   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼────────┼─────────┤
    │ Bytes/Sec │ 8.13 MB │ 8.13 MB │ 8.25 MB │ 8.51 MB │ 8.29 MB │ 115 kB │ 8.12 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴─────────┴────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 1            │
    ├────────────┼──────────────┤
    │ 0.01       │ 6            │
    ├────────────┼──────────────┤
    │ 0.1        │ 8            │
    ├────────────┼──────────────┤
    │ 1          │ 12           │
    ├────────────┼──────────────┤
    │ 2.5        │ 14           │
    ├────────────┼──────────────┤
    │ 10         │ 18           │
    ├────────────┼──────────────┤
    │ 25         │ 23           │
    ├────────────┼──────────────┤
    │ 50         │ 28           │
    ├────────────┼──────────────┤
    │ 75         │ 34           │
    ├────────────┼──────────────┤
    │ 90         │ 40           │
    ├────────────┼──────────────┤
    │ 97.5       │ 47           │
    ├────────────┼──────────────┤
    │ 99         │ 51           │
    ├────────────┼──────────────┤
    │ 99.9       │ 61           │
    ├────────────┼──────────────┤
    │ 99.99      │ 70           │
    ├────────────┼──────────────┤
    │ 99.999     │ 75           │
    └────────────┴──────────────┘

    51k requests in 15.02s, 124 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l "http://192.168.133.239:38246/api/custom-api/bench/bench_mysql_sandbox"
    Running 15s test @ http://192.168.133.239:38246/api/custom-api/bench/bench_mysql_sandbox
    100 connections
    5 workers

    ┌─────────┬───────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼───────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 13 ms │ 25 ms │ 42 ms │ 46 ms │ 25.29 ms │ 7.57 ms │ 80 ms │
    └─────────┴───────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬────────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%    │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼────────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 3,607   │ 3,607   │ 3,917  │ 4,013   │ 3,876.07 │ 122.27 │ 3,607   │
    ├───────────┼─────────┼─────────┼────────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 8.75 MB │ 8.75 MB │ 9.5 MB │ 9.73 MB │ 9.4 MB   │ 296 kB │ 8.74 MB │
    └───────────┴─────────┴─────────┴────────┴─────────┴──────────┴────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 3            │
    ├────────────┼──────────────┤
    │ 0.01       │ 5            │
    ├────────────┼──────────────┤
    │ 0.1        │ 7            │
    ├────────────┼──────────────┤
    │ 1          │ 11           │
    ├────────────┼──────────────┤
    │ 2.5        │ 13           │
    ├────────────┼──────────────┤
    │ 10         │ 16           │
    ├────────────┼──────────────┤
    │ 25         │ 20           │
    ├────────────┼──────────────┤
    │ 50         │ 25           │
    ├────────────┼──────────────┤
    │ 75         │ 30           │
    ├────────────┼──────────────┤
    │ 90         │ 35           │
    ├────────────┼──────────────┤
    │ 97.5       │ 42           │
    ├────────────┼──────────────┤
    │ 99         │ 46           │
    ├────────────┼──────────────┤
    │ 99.9       │ 55           │
    ├────────────┼──────────────┤
    │ 99.99      │ 66           │
    ├────────────┼──────────────┤
    │ 99.999     │ 80           │
    └────────────┴──────────────┘

    58k requests in 15.02s, 141 MB read
    ```

## 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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l -H "x-am-authorization: <token>" -H "x-am-user-authorization: <token>" "http://192.168.133.239:38246/api/schema/bench/mongodb/am_bench/customers_pre_hook"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/mongodb/am_bench/customers_pre_hook
    100 connections
    5 workers

    ┌─────────┬───────┬───────┬───────┬───────┬──────────┬─────────┬────────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max    │
    ├─────────┼───────┼───────┼───────┼───────┼──────────┼─────────┼────────┤
    │ Latency │ 14 ms │ 29 ms │ 46 ms │ 50 ms │ 29.54 ms │ 8.29 ms │ 107 ms │
    └─────────┴───────┴───────┴───────┴───────┴──────────┴─────────┴────────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬─────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg     │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼────────┼─────────┤
    │ Req/Sec   │ 3,207   │ 3,207   │ 3,329   │ 3,445   │ 3,327.8 │ 69.53  │ 3,206   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼────────┼─────────┤
    │ Bytes/Sec │ 8.77 MB │ 8.77 MB │ 9.11 MB │ 9.42 MB │ 9.1 MB  │ 189 kB │ 8.77 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴─────────┴────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 1            │
    ├────────────┼──────────────┤
    │ 0.01       │ 1            │
    ├────────────┼──────────────┤
    │ 0.1        │ 4            │
    ├────────────┼──────────────┤
    │ 1          │ 10           │
    ├────────────┼──────────────┤
    │ 2.5        │ 14           │
    ├────────────┼──────────────┤
    │ 10         │ 19           │
    ├────────────┼──────────────┤
    │ 25         │ 24           │
    ├────────────┼──────────────┤
    │ 50         │ 29           │
    ├────────────┼──────────────┤
    │ 75         │ 35           │
    ├────────────┼──────────────┤
    │ 90         │ 40           │
    ├────────────┼──────────────┤
    │ 97.5       │ 46           │
    ├────────────┼──────────────┤
    │ 99         │ 50           │
    ├────────────┼──────────────┤
    │ 99.9       │ 66           │
    ├────────────┼──────────────┤
    │ 99.99      │ 94           │
    ├────────────┼──────────────┤
    │ 99.999     │ 107          │
    └────────────┴──────────────┘

    50k requests in 15.02s, 136 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l -H "x-am-authorization: <token>" -H "x-am-user-authorization: <token>" "http://192.168.133.239:38246/api/schema/bench/postgres/am_bench/public.customers_pre_hook"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/postgres/am_bench/public.customers_pre_hook
    100 connections
    5 workers

    ┌─────────┬───────┬───────┬───────┬───────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg     │ Stdev   │ Max   │
    ├─────────┼───────┼───────┼───────┼───────┼─────────┼─────────┼───────┤
    │ Latency │ 22 ms │ 25 ms │ 30 ms │ 31 ms │ 25.2 ms │ 2.19 ms │ 39 ms │
    └─────────┴───────┴───────┴───────┴───────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 3,511   │ 3,511   │ 3,967   │ 4,163   │ 3,890.27 │ 205.93 │ 3,511   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 8.51 MB │ 8.51 MB │ 9.62 MB │ 10.1 MB │ 9.43 MB  │ 499 kB │ 8.51 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 6            │
    ├────────────┼──────────────┤
    │ 0.01       │ 8            │
    ├────────────┼──────────────┤
    │ 0.1        │ 19           │
    ├────────────┼──────────────┤
    │ 1          │ 21           │
    ├────────────┼──────────────┤
    │ 2.5        │ 22           │
    ├────────────┼──────────────┤
    │ 10         │ 23           │
    ├────────────┼──────────────┤
    │ 25         │ 24           │
    ├────────────┼──────────────┤
    │ 50         │ 25           │
    ├────────────┼──────────────┤
    │ 75         │ 26           │
    ├────────────┼──────────────┤
    │ 90         │ 28           │
    ├────────────┼──────────────┤
    │ 97.5       │ 30           │
    ├────────────┼──────────────┤
    │ 99         │ 31           │
    ├────────────┼──────────────┤
    │ 99.9       │ 34           │
    ├────────────┼──────────────┤
    │ 99.99      │ 38           │
    ├────────────┼──────────────┤
    │ 99.999     │ 39           │
    └────────────┴──────────────┘

    58k requests in 15.02s, 141 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l -H "x-am-authorization: <token>" -H "x-am-user-authorization: <token>" "http://192.168.133.239:38246/api/schema/bench/mysql/am_bench/customers_pre_hook"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/mysql/am_bench/customers_pre_hook
    100 connections
    5 workers

    ┌─────────┬───────┬───────┬───────┬───────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg     │ Stdev   │ Max   │
    ├─────────┼───────┼───────┼───────┼───────┼─────────┼─────────┼───────┤
    │ Latency │ 20 ms │ 22 ms │ 26 ms │ 27 ms │ 22.5 ms │ 1.53 ms │ 37 ms │
    └─────────┴───────┴───────┴───────┴───────┴─────────┴─────────┴───────┘
    ┌───────────┬────────┬────────┬─────────┬─────────┬──────────┬────────┬────────┐
    │ Stat      │ 1%     │ 2.5%   │ 50%     │ 97.5%   │ Avg      │ Stdev  │ Min    │
    ├───────────┼────────┼────────┼─────────┼─────────┼──────────┼────────┼────────┤
    │ Req/Sec   │ 4,085  │ 4,085  │ 4,347   │ 4,467   │ 4,345.94 │ 89.55  │ 4,085  │
    ├───────────┼────────┼────────┼─────────┼─────────┼──────────┼────────┼────────┤
    │ Bytes/Sec │ 9.9 MB │ 9.9 MB │ 10.5 MB │ 10.8 MB │ 10.5 MB  │ 216 kB │ 9.9 MB │
    └───────────┴────────┴────────┴─────────┴─────────┴──────────┴────────┴────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 6            │
    ├────────────┼──────────────┤
    │ 0.01       │ 12           │
    ├────────────┼──────────────┤
    │ 0.1        │ 18           │
    ├────────────┼──────────────┤
    │ 1          │ 19           │
    ├────────────┼──────────────┤
    │ 2.5        │ 20           │
    ├────────────┼──────────────┤
    │ 10         │ 21           │
    ├────────────┼──────────────┤
    │ 25         │ 22           │
    ├────────────┼──────────────┤
    │ 50         │ 22           │
    ├────────────┼──────────────┤
    │ 75         │ 23           │
    ├────────────┼──────────────┤
    │ 90         │ 24           │
    ├────────────┼──────────────┤
    │ 97.5       │ 26           │
    ├────────────┼──────────────┤
    │ 99         │ 27           │
    ├────────────┼──────────────┤
    │ 99.9       │ 30           │
    ├────────────┼──────────────┤
    │ 99.99      │ 36           │
    ├────────────┼──────────────┤
    │ 99.999     │ 37           │
    └────────────┴──────────────┘

    65k requests in 15.02s, 158 MB read
    ```

## Get by id

One row by its primary key : `GET …/<table>/get-by-id/<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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l "http://192.168.133.239:38246/api/schema/bench/mongodb/am_bench/customers_public/get-by-id/60ae2488c37cd955cc144161"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/mongodb/am_bench/customers_public/get-by-id/60ae2488c37cd955cc144161
    100 connections
    5 workers

    ┌─────────┬──────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼──────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 8 ms │ 18 ms │ 29 ms │ 33 ms │ 18.12 ms │ 5.45 ms │ 87 ms │
    └─────────┴──────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬─────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev   │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
    │ Req/Sec   │ 5,155   │ 5,155   │ 5,363   │ 5,647   │ 5,369.74 │ 123.6   │ 5,153   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
    │ Bytes/Sec │ 3.06 MB │ 3.06 MB │ 3.19 MB │ 3.35 MB │ 3.19 MB  │ 73.5 kB │ 3.06 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴─────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 1            │
    ├────────────┼──────────────┤
    │ 0.01       │ 1            │
    ├────────────┼──────────────┤
    │ 0.1        │ 3            │
    ├────────────┼──────────────┤
    │ 1          │ 7            │
    ├────────────┼──────────────┤
    │ 2.5        │ 8            │
    ├────────────┼──────────────┤
    │ 10         │ 12           │
    ├────────────┼──────────────┤
    │ 25         │ 15           │
    ├────────────┼──────────────┤
    │ 50         │ 18           │
    ├────────────┼──────────────┤
    │ 75         │ 21           │
    ├────────────┼──────────────┤
    │ 90         │ 24           │
    ├────────────┼──────────────┤
    │ 97.5       │ 29           │
    ├────────────┼──────────────┤
    │ 99         │ 33           │
    ├────────────┼──────────────┤
    │ 99.9       │ 54           │
    ├────────────┼──────────────┤
    │ 99.99      │ 82           │
    ├────────────┼──────────────┤
    │ 99.999     │ 87           │
    └────────────┴──────────────┘

    81k requests in 15.02s, 47.8 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l "http://192.168.133.239:38246/api/schema/bench/postgres/am_bench/public.customers_public/get-by-id/2"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/postgres/am_bench/public.customers_public/get-by-id/2
    100 connections
    5 workers

    ┌─────────┬───────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼───────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 13 ms │ 15 ms │ 18 ms │ 19 ms │ 15.14 ms │ 1.27 ms │ 26 ms │
    └─────────┴───────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬─────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev   │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
    │ Req/Sec   │ 6,135   │ 6,135   │ 6,395   │ 6,611   │ 6,395.34 │ 127.22  │ 6,133   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
    │ Bytes/Sec │ 3.44 MB │ 3.44 MB │ 3.59 MB │ 3.71 MB │ 3.59 MB  │ 71.6 kB │ 3.44 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴─────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 1            │
    ├────────────┼──────────────┤
    │ 0.01       │ 3            │
    ├────────────┼──────────────┤
    │ 0.1        │ 9            │
    ├────────────┼──────────────┤
    │ 1          │ 12           │
    ├────────────┼──────────────┤
    │ 2.5        │ 13           │
    ├────────────┼──────────────┤
    │ 10         │ 14           │
    ├────────────┼──────────────┤
    │ 25         │ 14           │
    ├────────────┼──────────────┤
    │ 50         │ 15           │
    ├────────────┼──────────────┤
    │ 75         │ 16           │
    ├────────────┼──────────────┤
    │ 90         │ 17           │
    ├────────────┼──────────────┤
    │ 97.5       │ 18           │
    ├────────────┼──────────────┤
    │ 99         │ 19           │
    ├────────────┼──────────────┤
    │ 99.9       │ 22           │
    ├────────────┼──────────────┤
    │ 99.99      │ 25           │
    ├────────────┼──────────────┤
    │ 99.999     │ 26           │
    └────────────┴──────────────┘

    96k requests in 15.02s, 53.8 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l "http://192.168.133.239:38246/api/schema/bench/mysql/am_bench/customers_public/get-by-id/2"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/mysql/am_bench/customers_public/get-by-id/2
    100 connections
    5 workers

    ┌─────────┬───────┬───────┬───────┬───────┬──────────┬────────┬───────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev  │ Max   │
    ├─────────┼───────┼───────┼───────┼───────┼──────────┼────────┼───────┤
    │ Latency │ 12 ms │ 13 ms │ 16 ms │ 16 ms │ 13.32 ms │ 1.1 ms │ 28 ms │
    └─────────┴───────┴───────┴───────┴───────┴──────────┴────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg     │ Stdev   │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤
    │ Req/Sec   │ 6,939   │ 6,939   │ 7,255   │ 7,387   │ 7,235.6 │ 119.99  │ 6,939   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤
    │ Bytes/Sec │ 3.89 MB │ 3.89 MB │ 4.07 MB │ 4.14 MB │ 4.06 MB │ 67.2 kB │ 3.89 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 1            │
    ├────────────┼──────────────┤
    │ 0.01       │ 2            │
    ├────────────┼──────────────┤
    │ 0.1        │ 9            │
    ├────────────┼──────────────┤
    │ 1          │ 11           │
    ├────────────┼──────────────┤
    │ 2.5        │ 12           │
    ├────────────┼──────────────┤
    │ 10         │ 12           │
    ├────────────┼──────────────┤
    │ 25         │ 13           │
    ├────────────┼──────────────┤
    │ 50         │ 13           │
    ├────────────┼──────────────┤
    │ 75         │ 14           │
    ├────────────┼──────────────┤
    │ 90         │ 15           │
    ├────────────┼──────────────┤
    │ 97.5       │ 16           │
    ├────────────┼──────────────┤
    │ 99         │ 16           │
    ├────────────┼──────────────┤
    │ 99.9       │ 19           │
    ├────────────┼──────────────┤
    │ 99.99      │ 25           │
    ├────────────┼──────────────┤
    │ 99.999     │ 28           │
    └────────────┴──────────────┘

    109k requests in 15.02s, 60.9 MB read
    ```

### 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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l -H "x-am-authorization: <token>" -H "x-am-user-authorization: <token>" "http://192.168.133.239:38246/api/schema/bench/mongodb/am_bench/customers/get-by-id/60ae2488c37cd955cc144161"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/mongodb/am_bench/customers/get-by-id/60ae2488c37cd955cc144161
    100 connections
    5 workers

    ┌─────────┬──────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼──────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 9 ms │ 20 ms │ 32 ms │ 35 ms │ 19.88 ms │ 5.61 ms │ 63 ms │
    └─────────┴──────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 4,227   │ 4,227   │ 4,943   │ 5,115   │ 4,903.87 │ 203.33 │ 4,227   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 2.51 MB │ 2.51 MB │ 2.94 MB │ 3.04 MB │ 2.91 MB  │ 121 kB │ 2.51 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 0            │
    ├────────────┼──────────────┤
    │ 0.01       │ 1            │
    ├────────────┼──────────────┤
    │ 0.1        │ 4            │
    ├────────────┼──────────────┤
    │ 1          │ 7            │
    ├────────────┼──────────────┤
    │ 2.5        │ 9            │
    ├────────────┼──────────────┤
    │ 10         │ 13           │
    ├────────────┼──────────────┤
    │ 25         │ 16           │
    ├────────────┼──────────────┤
    │ 50         │ 20           │
    ├────────────┼──────────────┤
    │ 75         │ 23           │
    ├────────────┼──────────────┤
    │ 90         │ 27           │
    ├────────────┼──────────────┤
    │ 97.5       │ 32           │
    ├────────────┼──────────────┤
    │ 99         │ 35           │
    ├────────────┼──────────────┤
    │ 99.9       │ 44           │
    ├────────────┼──────────────┤
    │ 99.99      │ 55           │
    ├────────────┼──────────────┤
    │ 99.999     │ 63           │
    └────────────┴──────────────┘

    74k requests in 15.02s, 43.7 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l -H "x-am-authorization: <token>" -H "x-am-user-authorization: <token>" "http://192.168.133.239:38246/api/schema/bench/postgres/am_bench/public.customers/get-by-id/2"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/postgres/am_bench/public.customers/get-by-id/2
    100 connections
    5 workers

    ┌─────────┬───────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼───────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 15 ms │ 17 ms │ 20 ms │ 21 ms │ 16.91 ms │ 1.39 ms │ 33 ms │
    └─────────┴───────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬─────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev   │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
    │ Req/Sec   │ 5,475   │ 5,475   │ 5,791   │ 5,987   │ 5,741.47 │ 163.38  │ 5,473   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
    │ Bytes/Sec │ 3.07 MB │ 3.07 MB │ 3.25 MB │ 3.36 MB │ 3.22 MB  │ 91.7 kB │ 3.07 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴─────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 0            │
    ├────────────┼──────────────┤
    │ 0.01       │ 4            │
    ├────────────┼──────────────┤
    │ 0.1        │ 13           │
    ├────────────┼──────────────┤
    │ 1          │ 14           │
    ├────────────┼──────────────┤
    │ 2.5        │ 15           │
    ├────────────┼──────────────┤
    │ 10         │ 15           │
    ├────────────┼──────────────┤
    │ 25         │ 16           │
    ├────────────┼──────────────┤
    │ 50         │ 17           │
    ├────────────┼──────────────┤
    │ 75         │ 18           │
    ├────────────┼──────────────┤
    │ 90         │ 18           │
    ├────────────┼──────────────┤
    │ 97.5       │ 20           │
    ├────────────┼──────────────┤
    │ 99         │ 21           │
    ├────────────┼──────────────┤
    │ 99.9       │ 26           │
    ├────────────┼──────────────┤
    │ 99.99      │ 29           │
    ├────────────┼──────────────┤
    │ 99.999     │ 33           │
    └────────────┴──────────────┘

    86k requests in 15.02s, 48.3 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l -H "x-am-authorization: <token>" -H "x-am-user-authorization: <token>" "http://192.168.133.239:38246/api/schema/bench/mysql/am_bench/customers/get-by-id/2"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/mysql/am_bench/customers/get-by-id/2
    100 connections
    5 workers

    ┌─────────┬───────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼───────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 13 ms │ 15 ms │ 18 ms │ 19 ms │ 15.03 ms │ 1.28 ms │ 28 ms │
    └─────────┴───────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬────────┬────────┬─────────┬────────┬─────────┬─────────┬─────────┐
    │ Stat      │ 1%     │ 2.5%   │ 50%     │ 97.5%  │ Avg     │ Stdev   │ Min     │
    ├───────────┼────────┼────────┼─────────┼────────┼─────────┼─────────┼─────────┤
    │ Req/Sec   │ 6,051  │ 6,051  │ 6,463   │ 6,603  │ 6,440.4 │ 130.84  │ 6,051   │
    ├───────────┼────────┼────────┼─────────┼────────┼─────────┼─────────┼─────────┤
    │ Bytes/Sec │ 3.4 MB │ 3.4 MB │ 3.63 MB │ 3.7 MB │ 3.61 MB │ 73.3 kB │ 3.39 MB │
    └───────────┴────────┴────────┴─────────┴────────┴─────────┴─────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 1            │
    ├────────────┼──────────────┤
    │ 0.01       │ 2            │
    ├────────────┼──────────────┤
    │ 0.1        │ 6            │
    ├────────────┼──────────────┤
    │ 1          │ 13           │
    ├────────────┼──────────────┤
    │ 2.5        │ 13           │
    ├────────────┼──────────────┤
    │ 10         │ 14           │
    ├────────────┼──────────────┤
    │ 25         │ 14           │
    ├────────────┼──────────────┤
    │ 50         │ 15           │
    ├────────────┼──────────────┤
    │ 75         │ 16           │
    ├────────────┼──────────────┤
    │ 90         │ 16           │
    ├────────────┼──────────────┤
    │ 97.5       │ 18           │
    ├────────────┼──────────────┤
    │ 99         │ 19           │
    ├────────────┼──────────────┤
    │ 99.9       │ 22           │
    ├────────────┼──────────────┤
    │ 99.99      │ 27           │
    ├────────────┼──────────────┤
    │ 99.999     │ 28           │
    └────────────┴──────────────┘

    97k requests in 15.02s, 54.2 MB read
    ```

## 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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l "http://192.168.133.239:38246/api/schema/bench/mongodb/am_bench/customers_public_cached/get-by-id/60ae2488c37cd955cc144161"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/mongodb/am_bench/customers_public_cached/get-by-id/60ae2488c37cd955cc144161
    100 connections
    5 workers

    ┌─────────┬──────┬──────┬───────┬──────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼──────┼─────────┼─────────┼───────┤
    │ Latency │ 3 ms │ 5 ms │ 7 ms  │ 8 ms │ 4.86 ms │ 1.33 ms │ 36 ms │
    └─────────┴──────┴──────┴───────┴──────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬───────────┬──────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg       │ Stdev    │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼──────────┼─────────┤
    │ Req/Sec   │ 16,303  │ 16,303  │ 19,135  │ 20,911  │ 18,666.41 │ 1,576.32 │ 16,302  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼──────────┼─────────┤
    │ Bytes/Sec │ 9.72 MB │ 9.72 MB │ 11.4 MB │ 12.5 MB │ 11.1 MB   │ 939 kB   │ 9.72 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴───────────┴──────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 0            │
    ├────────────┼──────────────┤
    │ 0.01       │ 1            │
    ├────────────┼──────────────┤
    │ 0.1        │ 1            │
    ├────────────┼──────────────┤
    │ 1          │ 2            │
    ├────────────┼──────────────┤
    │ 2.5        │ 3            │
    ├────────────┼──────────────┤
    │ 10         │ 3            │
    ├────────────┼──────────────┤
    │ 25         │ 4            │
    ├────────────┼──────────────┤
    │ 50         │ 5            │
    ├────────────┼──────────────┤
    │ 75         │ 6            │
    ├────────────┼──────────────┤
    │ 90         │ 6            │
    ├────────────┼──────────────┤
    │ 97.5       │ 7            │
    ├────────────┼──────────────┤
    │ 99         │ 8            │
    ├────────────┼──────────────┤
    │ 99.9       │ 12           │
    ├────────────┼──────────────┤
    │ 99.99      │ 21           │
    ├────────────┼──────────────┤
    │ 99.999     │ 35           │
    └────────────┴──────────────┘

    280k requests in 15.02s, 167 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l "http://192.168.133.239:38246/api/schema/bench/postgres/am_bench/public.customers_public_cached/get-by-id/2"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/postgres/am_bench/public.customers_public_cached/get-by-id/2
    100 connections
    5 workers

    ┌─────────┬──────┬──────┬───────┬──────┬─────────┬────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg     │ Stdev  │ Max   │
    ├─────────┼──────┼──────┼───────┼──────┼─────────┼────────┼───────┤
    │ Latency │ 3 ms │ 5 ms │ 7 ms  │ 7 ms │ 4.62 ms │ 1.1 ms │ 21 ms │
    └─────────┴──────┴──────┴───────┴──────┴─────────┴────────┴───────┘
    ┌───────────┬─────────┬─────────┬────────┬─────────┬───────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%    │ 97.5%   │ Avg       │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼────────┼─────────┼───────────┼────────┼─────────┤
    │ Req/Sec   │ 18,671  │ 18,671  │ 19,583 │ 20,367  │ 19,549.34 │ 565.89 │ 18,659  │
    ├───────────┼─────────┼─────────┼────────┼─────────┼───────────┼────────┼─────────┤
    │ Bytes/Sec │ 10.5 MB │ 10.5 MB │ 11 MB  │ 11.5 MB │ 11 MB     │ 319 kB │ 10.5 MB │
    └───────────┴─────────┴─────────┴────────┴─────────┴───────────┴────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 0            │
    ├────────────┼──────────────┤
    │ 0.01       │ 1            │
    ├────────────┼──────────────┤
    │ 0.1        │ 1            │
    ├────────────┼──────────────┤
    │ 1          │ 2            │
    ├────────────┼──────────────┤
    │ 2.5        │ 3            │
    ├────────────┼──────────────┤
    │ 10         │ 3            │
    ├────────────┼──────────────┤
    │ 25         │ 4            │
    ├────────────┼──────────────┤
    │ 50         │ 5            │
    ├────────────┼──────────────┤
    │ 75         │ 5            │
    ├────────────┼──────────────┤
    │ 90         │ 6            │
    ├────────────┼──────────────┤
    │ 97.5       │ 7            │
    ├────────────┼──────────────┤
    │ 99         │ 7            │
    ├────────────┼──────────────┤
    │ 99.9       │ 9            │
    ├────────────┼──────────────┤
    │ 99.99      │ 17           │
    ├────────────┼──────────────┤
    │ 99.999     │ 20           │
    └────────────┴──────────────┘

    293k requests in 15.02s, 165 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l "http://192.168.133.239:38246/api/schema/bench/mysql/am_bench/customers_public_cached/get-by-id/2"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/mysql/am_bench/customers_public_cached/get-by-id/2
    100 connections
    5 workers

    ┌─────────┬──────┬──────┬───────┬──────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼──────┼─────────┼─────────┼───────┤
    │ Latency │ 3 ms │ 4 ms │ 7 ms  │ 7 ms │ 4.51 ms │ 1.11 ms │ 25 ms │
    └─────────┴──────┴──────┴───────┴──────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 19,007  │ 19,007  │ 19,951  │ 20,591  │ 19,979.2 │ 440.33 │ 18,993  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 10.7 MB │ 10.7 MB │ 11.2 MB │ 11.6 MB │ 11.2 MB  │ 249 kB │ 10.7 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 0            │
    ├────────────┼──────────────┤
    │ 0.01       │ 1            │
    ├────────────┼──────────────┤
    │ 0.1        │ 1            │
    ├────────────┼──────────────┤
    │ 1          │ 2            │
    ├────────────┼──────────────┤
    │ 2.5        │ 3            │
    ├────────────┼──────────────┤
    │ 10         │ 3            │
    ├────────────┼──────────────┤
    │ 25         │ 4            │
    ├────────────┼──────────────┤
    │ 50         │ 4            │
    ├────────────┼──────────────┤
    │ 75         │ 5            │
    ├────────────┼──────────────┤
    │ 90         │ 6            │
    ├────────────┼──────────────┤
    │ 97.5       │ 7            │
    ├────────────┼──────────────┤
    │ 99         │ 7            │
    ├────────────┼──────────────┤
    │ 99.9       │ 10           │
    ├────────────┼──────────────┤
    │ 99.99      │ 19           │
    ├────────────┼──────────────┤
    │ 99.999     │ 21           │
    └────────────┴──────────────┘

    300k requests in 15.03s, 169 MB read
    ```

### 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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l -H "x-am-authorization: <token>" -H "x-am-user-authorization: <token>" "http://192.168.133.239:38246/api/schema/bench/mongodb/am_bench/customers_cached/get-by-id/60ae2488c37cd955cc144161"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/mongodb/am_bench/customers_cached/get-by-id/60ae2488c37cd955cc144161
    100 connections
    5 workers

    ┌─────────┬──────┬──────┬───────┬───────┬─────────┬────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%   │ Avg     │ Stdev  │ Max   │
    ├─────────┼──────┼──────┼───────┼───────┼─────────┼────────┼───────┤
    │ Latency │ 3 ms │ 6 ms │ 9 ms  │ 10 ms │ 6.14 ms │ 1.5 ms │ 45 ms │
    └─────────┴──────┴──────┴───────┴───────┴─────────┴────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬───────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg       │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Req/Sec   │ 13,879  │ 13,879  │ 15,183  │ 16,063  │ 15,063.74 │ 495.26 │ 13,875  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Bytes/Sec │ 8.27 MB │ 8.27 MB │ 9.05 MB │ 9.58 MB │ 8.98 MB   │ 296 kB │ 8.27 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴───────────┴────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 0            │
    ├────────────┼──────────────┤
    │ 0.01       │ 1            │
    ├────────────┼──────────────┤
    │ 0.1        │ 2            │
    ├────────────┼──────────────┤
    │ 1          │ 3            │
    ├────────────┼──────────────┤
    │ 2.5        │ 3            │
    ├────────────┼──────────────┤
    │ 10         │ 4            │
    ├────────────┼──────────────┤
    │ 25         │ 5            │
    ├────────────┼──────────────┤
    │ 50         │ 6            │
    ├────────────┼──────────────┤
    │ 75         │ 7            │
    ├────────────┼──────────────┤
    │ 90         │ 8            │
    ├────────────┼──────────────┤
    │ 97.5       │ 9            │
    ├────────────┼──────────────┤
    │ 99         │ 10           │
    ├────────────┼──────────────┤
    │ 99.9       │ 12           │
    ├────────────┼──────────────┤
    │ 99.99      │ 23           │
    ├────────────┼──────────────┤
    │ 99.999     │ 45           │
    └────────────┴──────────────┘

    226k requests in 15.02s, 135 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l -H "x-am-authorization: <token>" -H "x-am-user-authorization: <token>" "http://192.168.133.239:38246/api/schema/bench/postgres/am_bench/public.customers_cached/get-by-id/2"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/postgres/am_bench/public.customers_cached/get-by-id/2
    100 connections
    5 workers

    ┌─────────┬──────┬──────┬───────┬───────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%   │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼───────┼─────────┼─────────┼───────┤
    │ Latency │ 3 ms │ 6 ms │ 9 ms  │ 10 ms │ 6.09 ms │ 1.42 ms │ 22 ms │
    └─────────┴──────┴──────┴───────┴───────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬───────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg       │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Req/Sec   │ 14,487  │ 14,487  │ 15,199  │ 15,999  │ 15,173.07 │ 445.43 │ 14,480  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Bytes/Sec │ 8.16 MB │ 8.16 MB │ 8.56 MB │ 9.01 MB │ 8.54 MB   │ 252 kB │ 8.15 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴───────────┴────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 0            │
    ├────────────┼──────────────┤
    │ 0.01       │ 1            │
    ├────────────┼──────────────┤
    │ 0.1        │ 2            │
    ├────────────┼──────────────┤
    │ 1          │ 3            │
    ├────────────┼──────────────┤
    │ 2.5        │ 3            │
    ├────────────┼──────────────┤
    │ 10         │ 4            │
    ├────────────┼──────────────┤
    │ 25         │ 5            │
    ├────────────┼──────────────┤
    │ 50         │ 6            │
    ├────────────┼──────────────┤
    │ 75         │ 7            │
    ├────────────┼──────────────┤
    │ 90         │ 8            │
    ├────────────┼──────────────┤
    │ 97.5       │ 9            │
    ├────────────┼──────────────┤
    │ 99         │ 10           │
    ├────────────┼──────────────┤
    │ 99.9       │ 12           │
    ├────────────┼──────────────┤
    │ 99.99      │ 19           │
    ├────────────┼──────────────┤
    │ 99.999     │ 22           │
    └────────────┴──────────────┘

    228k requests in 15.02s, 128 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l -H "x-am-authorization: <token>" -H "x-am-user-authorization: <token>" "http://192.168.133.239:38246/api/schema/bench/mysql/am_bench/customers_cached/get-by-id/2"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/mysql/am_bench/customers_cached/get-by-id/2
    100 connections
    5 workers

    ┌─────────┬──────┬──────┬───────┬──────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼──────┼─────────┼─────────┼───────┤
    │ Latency │ 3 ms │ 6 ms │ 9 ms  │ 9 ms │ 6.07 ms │ 1.43 ms │ 24 ms │
    └─────────┴──────┴──────┴───────┴──────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬───────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg       │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Req/Sec   │ 14,335  │ 14,335  │ 15,175  │ 16,031  │ 15,222.67 │ 469.2  │ 14,335  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Bytes/Sec │ 8.07 MB │ 8.07 MB │ 8.54 MB │ 9.03 MB │ 8.57 MB   │ 264 kB │ 8.07 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴───────────┴────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 0            │
    ├────────────┼──────────────┤
    │ 0.01       │ 1            │
    ├────────────┼──────────────┤
    │ 0.1        │ 2            │
    ├────────────┼──────────────┤
    │ 1          │ 3            │
    ├────────────┼──────────────┤
    │ 2.5        │ 3            │
    ├────────────┼──────────────┤
    │ 10         │ 4            │
    ├────────────┼──────────────┤
    │ 25         │ 5            │
    ├────────────┼──────────────┤
    │ 50         │ 6            │
    ├────────────┼──────────────┤
    │ 75         │ 7            │
    ├────────────┼──────────────┤
    │ 90         │ 8            │
    ├────────────┼──────────────┤
    │ 97.5       │ 9            │
    ├────────────┼──────────────┤
    │ 99         │ 9            │
    ├────────────┼──────────────┤
    │ 99.9       │ 12           │
    ├────────────┼──────────────┤
    │ 99.99      │ 19           │
    ├────────────┼──────────────┤
    │ 99.999     │ 22           │
    └────────────┴──────────────┘

    228k requests in 15.02s, 129 MB read
    ```

## Insert one row

`POST …/<table>/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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l -m POST -b '{"customer_id":1,"first_name":"BENCH","last_name":"INSERT","phone":1123456789,"last_update":"2006-02-15T04:34:00.330Z","pincode":111111,"shipping_id":2,"dob":"2022-10-30T03:25:03.000Z","country":"India"}' -H "content-type: application/json" "http://192.168.133.239:38246/api/schema/bench/mongodb/am_bench/inserts_public/save-single-or-multiple"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/mongodb/am_bench/inserts_public/save-single-or-multiple
    100 connections
    5 workers

    ┌─────────┬───────┬───────┬───────┬───────┬──────────┬──────────┬────────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev    │ Max    │
    ├─────────┼───────┼───────┼───────┼───────┼──────────┼──────────┼────────┤
    │ Latency │ 22 ms │ 38 ms │ 72 ms │ 83 ms │ 40.82 ms │ 13.21 ms │ 167 ms │
    └─────────┴───────┴───────┴───────┴───────┴──────────┴──────────┴────────┘
    ┌───────────┬────────┬────────┬─────────┬─────────┬─────────┬─────────┬────────┐
    │ Stat      │ 1%     │ 2.5%   │ 50%     │ 97.5%   │ Avg     │ Stdev   │ Min    │
    ├───────────┼────────┼────────┼─────────┼─────────┼─────────┼─────────┼────────┤
    │ Req/Sec   │ 2,175  │ 2,175  │ 2,387   │ 2,659   │ 2,418.6 │ 116.1   │ 2,174  │
    ├───────────┼────────┼────────┼─────────┼─────────┼─────────┼─────────┼────────┤
    │ Bytes/Sec │ 1.3 MB │ 1.3 MB │ 1.43 MB │ 1.59 MB │ 1.45 MB │ 69.5 kB │ 1.3 MB │
    └───────────┴────────┴────────┴─────────┴─────────┴─────────┴─────────┴────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 10           │
    ├────────────┼──────────────┤
    │ 0.01       │ 11           │
    ├────────────┼──────────────┤
    │ 0.1        │ 13           │
    ├────────────┼──────────────┤
    │ 1          │ 19           │
    ├────────────┼──────────────┤
    │ 2.5        │ 22           │
    ├────────────┼──────────────┤
    │ 10         │ 27           │
    ├────────────┼──────────────┤
    │ 25         │ 32           │
    ├────────────┼──────────────┤
    │ 50         │ 38           │
    ├────────────┼──────────────┤
    │ 75         │ 48           │
    ├────────────┼──────────────┤
    │ 90         │ 58           │
    ├────────────┼──────────────┤
    │ 97.5       │ 72           │
    ├────────────┼──────────────┤
    │ 99         │ 83           │
    ├────────────┼──────────────┤
    │ 99.9       │ 116          │
    ├────────────┼──────────────┤
    │ 99.99      │ 149          │
    ├────────────┼──────────────┤
    │ 99.999     │ 167          │
    └────────────┴──────────────┘

    36k requests in 15.02s, 21.7 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l -m POST -b '{"first_name":"BENCH","last_name":"INSERT","phone":1123456789,"last_update":"2006-02-15T04:34:00.330Z","pincode":111111,"shipping_id":2,"dob":"2022-10-30T03:25:03.000Z","country":"India"}' -H "content-type: application/json" "http://192.168.133.239:38246/api/schema/bench/postgres/am_bench/public.inserts_public/save-single-or-multiple"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/postgres/am_bench/public.inserts_public/save-single-or-multiple
    100 connections
    5 workers

    ┌─────────┬───────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼───────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 29 ms │ 33 ms │ 37 ms │ 38 ms │ 32.63 ms │ 2.19 ms │ 49 ms │
    └─────────┴───────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg     │ Stdev   │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤
    │ Req/Sec   │ 2,933   │ 2,933   │ 3,021   │ 3,113   │ 3,017.4 │ 45.29   │ 2,933   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤
    │ Bytes/Sec │ 1.67 MB │ 1.67 MB │ 1.72 MB │ 1.77 MB │ 1.72 MB │ 25.7 kB │ 1.67 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 12           │
    ├────────────┼──────────────┤
    │ 0.01       │ 13           │
    ├────────────┼──────────────┤
    │ 0.1        │ 23           │
    ├────────────┼──────────────┤
    │ 1          │ 28           │
    ├────────────┼──────────────┤
    │ 2.5        │ 29           │
    ├────────────┼──────────────┤
    │ 10         │ 30           │
    ├────────────┼──────────────┤
    │ 25         │ 31           │
    ├────────────┼──────────────┤
    │ 50         │ 33           │
    ├────────────┼──────────────┤
    │ 75         │ 34           │
    ├────────────┼──────────────┤
    │ 90         │ 35           │
    ├────────────┼──────────────┤
    │ 97.5       │ 37           │
    ├────────────┼──────────────┤
    │ 99         │ 38           │
    ├────────────┼──────────────┤
    │ 99.9       │ 45           │
    ├────────────┼──────────────┤
    │ 99.99      │ 47           │
    ├────────────┼──────────────┤
    │ 99.999     │ 49           │
    └────────────┴──────────────┘

    45k requests in 15.02s, 25.7 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l -m POST -b '{"first_name":"BENCH","last_name":"INSERT","phone":1123456789,"last_update":"2006-02-15T04:34:00.330Z","pincode":111111,"shipping_id":2,"dob":"2022-10-30T03:25:03.000Z","country":"India"}' -H "content-type: application/json" "http://192.168.133.239:38246/api/schema/bench/mysql/am_bench/inserts_public/save-single-or-multiple"
    Running 15s test @ http://192.168.133.239:38246/api/schema/bench/mysql/am_bench/inserts_public/save-single-or-multiple
    100 connections
    5 workers

    ┌─────────┬───────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼───────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 34 ms │ 41 ms │ 47 ms │ 49 ms │ 40.92 ms │ 3.38 ms │ 59 ms │
    └─────────┴───────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬────────┬────────┬─────────┬─────────┬──────────┬─────────┬────────┐
    │ Stat      │ 1%     │ 2.5%   │ 50%     │ 97.5%   │ Avg      │ Stdev   │ Min    │
    ├───────────┼────────┼────────┼─────────┼─────────┼──────────┼─────────┼────────┤
    │ Req/Sec   │ 2,281  │ 2,281  │ 2,421   │ 2,507   │ 2,412.87 │ 59.89   │ 2,281  │
    ├───────────┼────────┼────────┼─────────┼─────────┼──────────┼─────────┼────────┤
    │ Bytes/Sec │ 1.3 MB │ 1.3 MB │ 1.38 MB │ 1.43 MB │ 1.37 MB  │ 34.1 kB │ 1.3 MB │
    └───────────┴────────┴────────┴─────────┴─────────┴──────────┴─────────┴────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 3            │
    ├────────────┼──────────────┤
    │ 0.01       │ 8            │
    ├────────────┼──────────────┤
    │ 0.1        │ 23           │
    ├────────────┼──────────────┤
    │ 1          │ 31           │
    ├────────────┼──────────────┤
    │ 2.5        │ 34           │
    ├────────────┼──────────────┤
    │ 10         │ 37           │
    ├────────────┼──────────────┤
    │ 25         │ 39           │
    ├────────────┼──────────────┤
    │ 50         │ 41           │
    ├────────────┼──────────────┤
    │ 75         │ 43           │
    ├────────────┼──────────────┤
    │ 90         │ 45           │
    ├────────────┼──────────────┤
    │ 97.5       │ 47           │
    ├────────────┼──────────────┤
    │ 99         │ 49           │
    ├────────────┼──────────────┤
    │ 99.9       │ 53           │
    ├────────────┼──────────────┤
    │ 99.99      │ 57           │
    ├────────────┼──────────────┤
    │ 99.999     │ 59           │
    └────────────┴──────────────┘

    36k requests in 15.02s, 20.6 MB read
    ```

## 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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l "http://192.168.133.239:38246/api/custom-api/bench/bench_no_db"
    Running 15s test @ http://192.168.133.239:38246/api/custom-api/bench/bench_no_db
    100 connections
    5 workers

    ┌─────────┬──────┬──────┬───────┬───────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%   │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼───────┼─────────┼─────────┼───────┤
    │ Latency │ 3 ms │ 6 ms │ 9 ms  │ 10 ms │ 6.24 ms │ 1.89 ms │ 20 ms │
    └─────────┴──────┴──────┴───────┴───────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬─────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev   │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
    │ Req/Sec   │ 14,335  │ 14,335  │ 14,879  │ 15,063  │ 14,847.2 │ 173.26  │ 14,331  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
    │ Bytes/Sec │ 5.72 MB │ 5.72 MB │ 5.94 MB │ 6.01 MB │ 5.92 MB  │ 68.9 kB │ 5.72 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴─────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 0            │
    ├────────────┼──────────────┤
    │ 0.01       │ 0            │
    ├────────────┼──────────────┤
    │ 0.1        │ 0            │
    ├────────────┼──────────────┤
    │ 1          │ 0            │
    ├────────────┼──────────────┤
    │ 2.5        │ 3            │
    ├────────────┼──────────────┤
    │ 10         │ 4            │
    ├────────────┼──────────────┤
    │ 25         │ 5            │
    ├────────────┼──────────────┤
    │ 50         │ 6            │
    ├────────────┼──────────────┤
    │ 75         │ 8            │
    ├────────────┼──────────────┤
    │ 90         │ 9            │
    ├────────────┼──────────────┤
    │ 97.5       │ 9            │
    ├────────────┼──────────────┤
    │ 99         │ 10           │
    ├────────────┼──────────────┤
    │ 99.9       │ 14           │
    ├────────────┼──────────────┤
    │ 99.99      │ 18           │
    ├────────────┼──────────────┤
    │ 99.999     │ 20           │
    └────────────┴──────────────┘

    223k requests in 15.02s, 88.9 MB read
    ```

**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

    ```text
    $ autocannon -c 100 -d 15 -w 5 -l "http://192.168.133.239:38246/api/custom-api/bench/bench_sandbox_no_db"
    Running 15s test @ http://192.168.133.239:38246/api/custom-api/bench/bench_sandbox_no_db
    100 connections
    5 workers

    ┌─────────┬──────┬──────┬───────┬───────┬────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%   │ Avg    │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼───────┼────────┼─────────┼───────┤
    │ Latency │ 4 ms │ 7 ms │ 11 ms │ 12 ms │ 7.4 ms │ 1.99 ms │ 24 ms │
    └─────────┴──────┴──────┴───────┴───────┴────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬───────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg       │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Req/Sec   │ 12,231  │ 12,231  │ 12,703  │ 13,159  │ 12,667.47 │ 258.15 │ 12,224  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Bytes/Sec │ 5.05 MB │ 5.05 MB │ 5.25 MB │ 5.44 MB │ 5.23 MB   │ 107 kB │ 5.05 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴───────────┴────────┴─────────┘

    Req/Bytes counts sampled once per second.
    # of samples: 75

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 0            │
    ├────────────┼──────────────┤
    │ 0.01       │ 1            │
    ├────────────┼──────────────┤
    │ 0.1        │ 2            │
    ├────────────┼──────────────┤
    │ 1          │ 3            │
    ├────────────┼──────────────┤
    │ 2.5        │ 4            │
    ├────────────┼──────────────┤
    │ 10         │ 5            │
    ├────────────┼──────────────┤
    │ 25         │ 6            │
    ├────────────┼──────────────┤
    │ 50         │ 7            │
    ├────────────┼──────────────┤
    │ 75         │ 9            │
    ├────────────┼──────────────┤
    │ 90         │ 10           │
    ├────────────┼──────────────┤
    │ 97.5       │ 11           │
    ├────────────┼──────────────┤
    │ 99         │ 12           │
    ├────────────┼──────────────┤
    │ 99.9       │ 15           │
    ├────────────┼──────────────┤
    │ 99.99      │ 20           │
    ├────────────┼──────────────┤
    │ 99.999     │ 24           │
    └────────────┴──────────────┘

    190k requests in 15.02s, 78.5 MB read
    ```

## 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.
