# API Maker benchmark : 8 vCPU, 32 GB RAM (Linode shared CPU)

> API Maker on 8 shared vCPUs, 32 GB (Linode) : 11,002 req/s get all, 44,564 cached, on MongoDB, PostgreSQL and MySQL, with memory and autocannon output.

Source: https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html

<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

**8 vCPU, 32 GB RAM : 11,002 to 13,816 requests per second for a whole table.**

API Maker 4.0.0 on a Linode 32 GB (g6-standard-8) : 8 shared vCPUs and 32 GB of RAM at $192 a month, its databases on the same machine. Every API was loaded for 15 seconds by autocannon from a second server, two times, on MongoDB, PostgreSQL and MySQL, public and with two tokens, while the server sampled the memory and CPU of every part each second.

Get all · MongoDB

11,002req/s

PostgreSQL 13,054 · MySQL 13,816

Get by id, cached

44,564req/s

answered from Redis · PostgreSQL 43,050 · MySQL 43,160

Custom API · MongoDB

8,062req/s

TypeScript, lean : run in the server · in the sandbox 7,636

API Maker memory

112MB

at rest · 154 MB at most under load

## The server

| | |
|---|---|
| Server | Linode (Akamai Cloud), Linode 32 GB (g6-standard-8), shared cpu, $192 / month |
| CPU | AMD EPYC 7642 48-Core Processor, 8 shared vCPUs (KVM)<br>KVM guest, 1 thread per core · L1d 512 KiB (8 instances) · L2 4 MiB (8 instances) · L3 128 MiB (8 instances) · BogoMIPS 4600.00 |
| Memory | 32 GB (32,095 MB usable), swap 8.5 GB (496 MB of Linode + 8 GB made by the installer) |
| Disk, region | 640 GB SSD, Mumbai, India (ap-west) |
| System | Ubuntu 24.04.4 LTS, Linux 6.8.0-134, Docker 29.9.0 |
| API Maker | 4.0.0 : release build of api_maker_be_rust 864bb64 (opt-level 3, fat LTO), installed by its installer (https://apimaker.dev/v4/install.sh), no reverse proxy |
| Settings | the defaults of the installer (lean code of the account runs in the server with QuickJS : sandbox.codeInServer), and the sandboxes kept running for the whole run (removeSandboxInactiveSinceMinutes 1440) |
| Databases | MongoDB 8.0.10 (the MongoDB of API Maker, a replica set of one member, in Docker) · Redis 7.0.5 (the Redis of API Maker, in Docker) · PostgreSQL 18.6 (official image postgres:18, max_connections 500) · MySQL 8.4.11 (official image mysql:8.4, max_connections 500) : all on the same server |
| Sandboxes | TypeScript on Node.js 24.21.0 (an image of 403 MB built by API Maker), 2 sandboxes of the account (sandboxCountForAdmin 2, the default), each opening up to 8 runners when it is busy (one per vCPU) |
| Load generator | Dedicated 64 GB (g6-dedicated-32) : AMD EPYC 7642 48-Core Processor, 32 dedicated vCPUs, Ubuntu 24.04.4 LTS, Node.js 24.21.0, autocannon 8.0.0 with 20 worker threads |
| Network | Private network of the same data centre, round trip 0.37 ms (ping) |
| Host | A strict anti-affinity placement group kept the three shared CPU servers (2, 4 and 8 vCPUs) on three different hosts. All seven servers were measured at the same time, each by a load generator of its own. |
| Date | 12 October 2026, 05:30 to 06:44 UTC |

Only what a database needs was running while it was measured : API Maker and its two sandboxes, its MongoDB and Redis (API Maker always needs them) and the database under test. The other benchmark databases were stopped, API Maker was restarted and the swap emptied back into memory before each database, when it fitted there. How every number was taken : [How API Maker is benchmarked](https://docs.apimaker.dev/v4/docs/benchmarks/methodology.html). Every server side by side : [All results](https://docs.apimaker.dev/v4/docs/benchmarks/summary.html).

## The data

Every table holds the ten rows of the [API Maker benchmark dataset](https://apimaker.dev/json/benchmark_dataset.json) : `https://apimaker.dev/json/benchmark_dataset.json`. Ten customers, ten columns each ; a *get all* answers all ten (2,418 bytes of JSON on MongoDB), a *get by id* one of them.

| `_id` | `customer_id` | `first_name` | `last_name` | `phone` | `last_update` | `pincode` | `shipping_id` | `dob` | `country` |
|---|---|---|---|---|---|---|---|---|---|
| 60ae2488c37cd955cc144161 | 2 | NICK | WAHLBERG | 1123456789 | 2006-02-15T04:34:00.330Z | 111111 | 2 | 2022-10-30T03:25:03.000Z | India |
| 60ae24c8c37cd955cc144162 | 1 | PENELOPE | GUINESS | 123456789 | 2006-02-15T04:34:00.330Z | 100050 | 1 | 2022-10-30T03:25:03.000Z | India |
| 60ae247ac37cd955cc144160 | 3 | ED | CHASE | 2123456789 | 2006-02-15T04:34:00.330Z | 222222 | 3 | 2022-10-30T03:25:03.000Z | India |
| 60ace1401efc56684403c68c | 4 | JENNIFER | DAVIS | 3123456789 | 2006-02-15T04:34:00.330Z | 100050 | 4 | 2022-10-30T03:25:03.000Z | India |
| 60accda51efc56684403c685 | 5 | JOHNNY | LOLLOBRIGIDA | 4123456789 | 2006-02-15T04:34:00.330Z | 485125 | 1 | 2022-10-30T03:25:03.000Z | India |
| 606b7d364bebce00196eade7 | 6 | JOHNNY | LOLLOBRIGIDA | 5123456789 | 2006-02-15T04:34:00.330Z | 123456 | 2 | 2022-10-30T03:25:03.000Z | India |
| 606b75961055000018fa9d98 | 7 | GRACE | MOSTEL | 6123456789 | 2006-02-15T04:34:00.330Z | 356589 | 3 | 2022-10-30T03:25:03.000Z | India |
| 6064dd02730026001956663e | 8 | MATTHEW | JOHANSSON | 7123456789 | 2006-02-15T04:34:00.330Z | 100050 | 4 | 2022-10-30T03:25:03.000Z | India |
| 6064dcb8730026001956663c | 9 | JOE | SWANK | 8123456789 | 2006-02-15T04:34:00.330Z | 251415 | 1 | 2022-10-30T03:25:03.000Z | India |
| 6064c4c02bafb90018955299 | 10 | CHRISTIAN | GABLE | 9123456789 | 2006-02-15T04:34:00.330Z | 100050 |  | 2022-10-30T03:25:03.000Z | India |

## Results at a glance

Requests per second, the average of two rounds of 15 seconds with 100 connections. *Public* APIs need no token ; *both tokens* means every request carries `x-am-authorization` (the token of an API user, whose groups decide what it may call) and `x-am-user-authorization` (the token of a row of the `customers` table, made by a DB token generator), and API Maker checks both.

**Requests per second · 8 vCPU, 32 GB RAM, shared CPU** · MongoDB · PostgreSQL · MySQL

Get allpublic · 11,002 · 13,054 · 13,816

Get allboth tokens · 11,882 · 12,013 · 12,645

Get all with cachingpublic · 41,093 · 39,947 · 40,335

Get all with cachingboth tokens · 34,364 · 32,966 · 33,000

Get all by streampublic · 10,646 · 12,914 · 12,489

Get all by streamboth tokens · 11,025 · 12,049 · 11,587

Custom API calling get all QuickJS · public · 8,062 · 9,350 · 9,698

Custom API calling get all QuickJS · both tokens · 8,393 · 8,433 · 8,962

Custom API in the sandbox Sandbox · public · 7,636 · 8,682 · 9,181

Get all with a pre hook QuickJS · both tokens · 8,512 · 9,668 · 10,192

Get by idpublic · 12,297 · 13,656 · 14,402

Get by idboth tokens · 12,654 · 12,548 · 13,222

Get by id with cachingpublic · 44,564 · 43,050 · 43,160

Get by id with cachingboth tokens · 36,219 · 34,322 · 34,667

Insert one rowpublic · 4,620 · 5,754 · 3,532

| API | Access | MongoDB | PostgreSQL | MySQL |
|---|---|--:|--:|--:|
| [Get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all) | Public | **11,002** p99 20 ms | **13,054** p99 9 ms | **13,816** p99 8 ms |
| [Get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all) | Both tokens | **11,882** p99 17 ms | **12,013** p99 10 ms | **12,645** p99 10 ms |
| [Get all with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all-with-caching) | Public | **41,093** p99 3 ms | **39,947** p99 3 ms | **40,335** p99 3 ms |
| [Get all with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all-with-caching) | Both tokens | **34,364** p99 4 ms | **32,966** p99 4 ms | **33,000** p99 4 ms |
| [Get all by stream](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all-by-stream) | Public | **10,646** p99 21 ms | **12,914** p99 9 ms | **12,489** p99 10 ms |
| [Get all by stream](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all-by-stream) | Both tokens | **11,025** p99 18 ms | **12,049** p99 10 ms | **11,587** p99 10 ms |
| [Custom API calling get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#custom-api-calling-get-all) QuickJS | Public | **8,062** p99 23 ms | **9,350** p99 13 ms | **9,698** p99 12 ms |
| [Custom API calling get all](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#custom-api-calling-get-all) QuickJS | Both tokens | **8,393** p99 21 ms | **8,433** p99 14 ms | **8,962** p99 14 ms |
| [Custom API in the sandbox](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#custom-api-in-the-sandbox) Sandbox | Public | **7,636** p99 28 ms | **8,682** p99 20 ms | **9,181** p99 19 ms |
| [Get all with a pre hook](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-all-with-a-pre-hook) QuickJS | Both tokens | **8,512** p99 24 ms | **9,668** p99 12 ms | **10,192** p99 13 ms |
| [Get by id](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-by-id) | Public | **12,297** p99 18 ms | **13,656** p99 8 ms | **14,402** p99 8 ms |
| [Get by id](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-by-id) | Both tokens | **12,654** p99 15 ms | **12,548** p99 10 ms | **13,222** p99 9 ms |
| [Get by id with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-by-id-with-caching) | Public | **44,564** p99 3 ms | **43,050** p99 3 ms | **43,160** p99 3 ms |
| [Get by id with caching](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#get-by-id-with-caching) | Both tokens | **36,219** p99 4 ms | **34,322** p99 4 ms | **34,667** p99 4 ms |
| [Insert one row](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#insert-one-row) | Public | **4,620** p99 38 ms | **5,754** p99 19 ms | **3,532** p99 35 ms |
| [Custom API without a database](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#custom-api-without-a-database) | Public | **47,967** p99 3 ms | | |
| [Custom API without a database, in the sandbox](https://docs.apimaker.dev/v4/docs/benchmarks/linode-shared-8-vcpu-32gb.html#custom-api-without-a-database) | Public | **27,302** p99 8 ms | | |

(0 errors) Every one of the **30,678,581 requests** of these runs was answered with status 200 or 201 : no error, no timeout.

## Memory

What each part of the server held, in MB : at rest (the 60 seconds after API Maker and its sandboxes started, before any request) and under load. The bars show the second the whole server held the most memory while its database was loaded, out of the 32,095 MB of the server ; the table gives the most each part held on its own. API Maker is the resident memory of its process ; a container is counted the way `docker stats` counts it.

API Maker · MongoDB of API Maker · Redis · PostgreSQL / MySQL · Sandboxes · Linux, Docker, the rest · Available

MongoDB

at rest

under load

PostgreSQL

at rest

under load

MySQL

at rest

under load

| Part | MongoDB<br>at rest → under load | PostgreSQL<br>at rest → under load | MySQL<br>at rest → under load |
|---|--:|--:|--:|
| **API Maker** (process), in RAM | 112 → **154** | 108 → **151** | 110 → **152** |
| … and in swap | 0 → **0** | 0 → **0** | 0 → **0** |
| MongoDB of API Maker, in RAM | 127 → **352** | 334 → **336** | 334 → **336** |
| … and in swap | 0 → **0** | 0 → **0** | 0 → **0** |
| Redis, in RAM | 3 → **4** | 3 → **4** | 3 → **4** |
| Database under test, in RAM | MongoDB above | 39 → **300** | 421 → **516** |
| … and in swap | MongoDB above | 0 → **0** | 0 → **0** |
| Sandboxes (2 containers), in RAM | 55 → **849** | 55 → **894** | 55 → **875** |
| … and in swap | 0 → **0** | 0 → **0** | 0 → **0** |
| **Whole server**, RAM used | 1102 → **2162** | 1341 → **2508** | 1741 → **2710** |
| Swap used | 0 → **0** | 0 → **0** | 0 → **0** |

## CPU

On 8 vCPUs, API Maker, the database and the sandboxes share the same 8 vCPUs : every request costs the work of all of them. During *get all, public*, the CPU was split this way (average of the 15 seconds, in vCPUs : 8.0 is the whole server ; a process counts its own kernel time) :

| | MongoDB | PostgreSQL | MySQL |
|---|--:|--:|--:|
| API Maker | 2.8 vCPU | 3.3 vCPU | 3.4 vCPU |
| The database | 4.1 vCPU | 1.6 vCPU | 1.5 vCPU |
| MongoDB of API Maker (when it is not the one tested) | – | 0.0 vCPU | 0.0 vCPU |
| Sandboxes (idle : no code runs in get all) | 0.0 vCPU | 0.0 vCPU | 0.0 vCPU |
| Whole server busy (of its 8 vCPUs) | 98 % | 78 % | 78 % |
| … of which kernel time (network, disk), counted in the lines above too | 33 % | 29 % | 30 % |

Steal time (CPU the hypervisor gave to other servers) was 0 % on average, 0 % at most. The load generator, sampled the same way, was never more than 12 % busy over its 32 cores : it was never the limit.

## Get all

The schema API of a table answers all its rows : `GET /api/schema/<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

11,002

173,721 requests in 15 s

Latency p50

8ms

average 8.1 ms

Latency p99

20ms

max 51 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **11,582** · 2 : **10,423** req/s · spread 10.5 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **2.8 vCPU**, **132 MB** RSS · MongoDB **4.1 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **98 %**, of which kernel (network, disk) **33 %** · memory used **1108 MB** of 32095 MB · steal **0 %** · swap not touched

    autocannon · MongoDB · get all, public · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬───────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%   │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼───────┼─────────┼─────────┼───────┤
    │ Latency │ 3 ms │ 8 ms │ 16 ms │ 20 ms │ 8.13 ms │ 3.41 ms │ 51 ms │
    └─────────┴──────┴──────┴───────┴───────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 11,103  │ 11,103  │ 11,615  │ 11,999  │ 11,581.6 │ 279.21 │ 11,098  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 30.4 MB │ 30.4 MB │ 31.8 MB │ 32.8 MB │ 31.7 MB  │ 768 kB │ 30.4 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴────────┴─────────┘

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

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

    174k requests in 15.01s, 475 MB read
    ```

**PostgreSQL**

Requests / second

13,054

201,063 requests in 15 s

Latency p50

7ms

average 7.0 ms

Latency p99

9ms

max 13 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **13,405** · 2 : **12,703** req/s · spread 5.4 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **3.3 vCPU**, **124 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.6 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **78 %**, of which kernel (network, disk) **29 %** · memory used **1379 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · PostgreSQL · get all, public · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬──────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼──────┼─────────┼─────────┼───────┤
    │ Latency │ 6 ms │ 7 ms │ 8 ms  │ 9 ms │ 6.96 ms │ 0.76 ms │ 13 ms │
    └─────────┴──────┴──────┴───────┴──────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬───────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg       │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Req/Sec   │ 13,063  │ 13,063  │ 13,335  │ 14,455  │ 13,404.54 │ 314.78 │ 13,057  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Bytes/Sec │ 31.7 MB │ 31.7 MB │ 32.3 MB │ 35.1 MB │ 32.5 MB   │ 767 kB │ 31.7 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴───────────┴────────┴─────────┘

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

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

    201k requests in 15.01s, 487 MB read
    ```

**MySQL**

Requests / second

13,816

215,068 requests in 15 s

Latency p50

6ms

average 6.5 ms

Latency p99

8ms

max 13 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **14,339** · 2 : **13,294** req/s · spread 7.6 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **3.4 vCPU**, **125 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.5 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **78 %**, of which kernel (network, disk) **30 %** · memory used **1760 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · MySQL · get all, public · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬──────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼──────┼─────────┼─────────┼───────┤
    │ Latency │ 5 ms │ 6 ms │ 8 ms  │ 8 ms │ 6.47 ms │ 0.76 ms │ 13 ms │
    └─────────┴──────┴──────┴───────┴──────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬───────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg       │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Req/Sec   │ 14,103  │ 14,103  │ 14,343  │ 14,679  │ 14,338.94 │ 151.59 │ 14,097  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Bytes/Sec │ 34.2 MB │ 34.2 MB │ 34.8 MB │ 35.6 MB │ 34.8 MB   │ 370 kB │ 34.2 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴───────────┴────────┴─────────┘

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

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

    215k requests in 15.01s, 521 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

11,882

187,751 requests in 15 s

Latency p50

7ms

average 7.5 ms

Latency p99

17ms

max 43 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **12,518** · 2 : **11,246** req/s · spread 10.7 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **3.6 vCPU**, **132 MB** RSS · MongoDB **3.1 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **96 %**, of which kernel (network, disk) **29 %** · memory used **1127 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · MongoDB · get all, both tokens · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬───────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%   │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼───────┼─────────┼─────────┼───────┤
    │ Latency │ 3 ms │ 7 ms │ 15 ms │ 17 ms │ 7.49 ms │ 2.94 ms │ 43 ms │
    └─────────┴──────┴──────┴───────┴───────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 12,119  │ 12,119  │ 12,543  │ 12,839  │ 12,517.6 │ 196.4  │ 12,119  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 33.2 MB │ 33.2 MB │ 34.3 MB │ 35.1 MB │ 34.2 MB  │ 536 kB │ 33.1 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴────────┴─────────┘

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

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

    188k requests in 15.01s, 513 MB read
    ```

**PostgreSQL**

Requests / second

12,013

178,911 requests in 15 s

Latency p50

8ms

average 7.9 ms

Latency p99

10ms

max 16 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **12,098** · 2 : **11,928** req/s · spread 1.4 % · the output below is round 2, the closer to the average

(Server during this run) API Maker **3.8 vCPU**, **137 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.4 vCPU** · sandboxes **0.0 vCPU**, **890 MB** · whole server busy **80 %**, of which kernel (network, disk) **27 %** · memory used **2444 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · PostgreSQL · get all, both tokens · round 2 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬───────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%   │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼───────┼─────────┼─────────┼───────┤
    │ Latency │ 7 ms │ 8 ms │ 9 ms  │ 10 ms │ 7.88 ms │ 0.87 ms │ 16 ms │
    └─────────┴──────┴──────┴───────┴───────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬───────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg       │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Req/Sec   │ 11,767  │ 11,767  │ 11,911  │ 12,095  │ 11,927.74 │ 101.7  │ 11,766  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Bytes/Sec │ 28.5 MB │ 28.5 MB │ 28.9 MB │ 29.3 MB │ 28.9 MB   │ 250 kB │ 28.5 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴───────────┴────────┴─────────┘

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

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

    179k requests in 15.01s, 434 MB read
    ```

**MySQL**

Requests / second

12,645

187,770 requests in 15 s

Latency p50

7ms

average 7.5 ms

Latency p99

10ms

max 14 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **12,773** · 2 : **12,518** req/s · spread 2 % · the output below is round 2, the closer to the average

(Server during this run) API Maker **3.9 vCPU**, **137 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.3 vCPU** · sandboxes **0.0 vCPU**, **874 MB** · whole server busy **82 %**, of which kernel (network, disk) **28 %** · memory used **2649 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · MySQL · get all, both tokens · round 2 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬───────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%   │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼───────┼─────────┼─────────┼───────┤
    │ Latency │ 6 ms │ 7 ms │ 9 ms  │ 10 ms │ 7.49 ms │ 0.86 ms │ 14 ms │
    └─────────┴──────┴──────┴───────┴───────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 12,271  │ 12,271  │ 12,455  │ 12,983  │ 12,517.6 │ 219.39 │ 12,271  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 29.8 MB │ 29.8 MB │ 30.2 MB │ 31.5 MB │ 30.3 MB  │ 531 kB │ 29.7 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴────────┴─────────┘

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

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

    188k requests in 15.01s, 455 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

41,093

634,592 requests in 15 s

Latency p50

2ms

average 1.9 ms

Latency p99

3ms

max 9 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **42,307** · 2 : **39,880** req/s · spread 5.9 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **6.2 vCPU**, **129 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · Redis **0.2 vCPU** · whole server busy **85 %**, of which kernel (network, disk) **27 %** · memory used **1108 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · MongoDB · get all with caching, public · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬──────┬─────────┬─────────┬──────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg     │ Stdev   │ Max  │
    ├─────────┼──────┼──────┼───────┼──────┼─────────┼─────────┼──────┤
    │ Latency │ 1 ms │ 2 ms │ 3 ms  │ 3 ms │ 1.87 ms │ 0.58 ms │ 9 ms │
    └─────────┴──────┴──────┴───────┴──────┴─────────┴─────────┴──────┘
    ┌───────────┬────────┬────────┬────────┬────────┬──────────┬─────────┬────────┐
    │ Stat      │ 1%     │ 2.5%   │ 50%    │ 97.5%  │ Avg      │ Stdev   │ Min    │
    ├───────────┼────────┼────────┼────────┼────────┼──────────┼─────────┼────────┤
    │ Req/Sec   │ 41,439 │ 41,439 │ 42,495 │ 43,071 │ 42,307.2 │ 493.51  │ 41,429 │
    ├───────────┼────────┼────────┼────────┼────────┼──────────┼─────────┼────────┤
    │ Bytes/Sec │ 113 MB │ 113 MB │ 116 MB │ 118 MB │ 116 MB   │ 1.36 MB │ 113 MB │
    └───────────┴────────┴────────┴────────┴────────┴──────────┴─────────┴────────┘

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

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

    635k requests in 15.01s, 1.74 GB read
    ```

**PostgreSQL**

Requests / second

39,947

601,568 requests in 15 s

Latency p50

2ms

average 2.0 ms

Latency p99

3ms

max 9 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **40,101** · 2 : **39,792** req/s · spread 0.8 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **6.2 vCPU**, **125 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · Redis **0.2 vCPU** · whole server busy **86 %**, of which kernel (network, disk) **26 %** · memory used **1349 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · PostgreSQL · get all with caching, public · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬──────┬──────┬─────────┬──────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg  │ Stdev   │ Max  │
    ├─────────┼──────┼──────┼───────┼──────┼──────┼─────────┼──────┤
    │ Latency │ 1 ms │ 2 ms │ 3 ms  │ 3 ms │ 2 ms │ 0.59 ms │ 9 ms │
    └─────────┴──────┴──────┴───────┴──────┴──────┴─────────┴──────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬───────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg       │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Req/Sec   │ 39,231  │ 39,231  │ 40,191  │ 41,055  │ 40,101.34 │ 393.6  │ 39,226  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Bytes/Sec │ 95.2 MB │ 95.2 MB │ 97.5 MB │ 99.6 MB │ 97.3 MB   │ 951 kB │ 95.2 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴───────────┴────────┴─────────┘

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

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

    602k requests in 15.01s, 1.46 GB read
    ```

**MySQL**

Requests / second

40,335

605,248 requests in 15 s

Latency p50

2ms

average 2.0 ms

Latency p99

3ms

max 12 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **40,351** · 2 : **40,319** req/s · spread 0.1 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **6.2 vCPU**, **126 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **57 MB** · Redis **0.2 vCPU** · whole server busy **86 %**, of which kernel (network, disk) **26 %** · memory used **1731 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · MySQL · get all with caching, public · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬──────┬─────────┬────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg     │ Stdev  │ Max   │
    ├─────────┼──────┼──────┼───────┼──────┼─────────┼────────┼───────┤
    │ Latency │ 1 ms │ 2 ms │ 3 ms  │ 3 ms │ 1.99 ms │ 0.6 ms │ 12 ms │
    └─────────┴──────┴──────┴───────┴──────┴─────────┴────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬───────────┬─────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg       │ Stdev   │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼─────────┼─────────┤
    │ Req/Sec   │ 39,487  │ 39,487  │ 40,479  │ 41,119  │ 40,350.94 │ 423.22  │ 39,459  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼─────────┼─────────┤
    │ Bytes/Sec │ 95.7 MB │ 95.7 MB │ 98.2 MB │ 99.7 MB │ 97.9 MB   │ 1.03 MB │ 95.7 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴───────────┴─────────┴─────────┘

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

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

    605k requests in 15.01s, 1.47 GB 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

34,364

511,751 requests in 15 s

Latency p50

2ms

average 2.4 ms

Latency p99

4ms

max 15 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **34,113** · 2 : **34,614** req/s · spread 1.5 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **6.6 vCPU**, **128 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · Redis **0.2 vCPU** · whole server busy **89 %**, of which kernel (network, disk) **23 %** · memory used **1110 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · MongoDB · get all with caching, both tokens · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬──────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼──────┼─────────┼─────────┼───────┤
    │ Latency │ 1 ms │ 2 ms │ 4 ms  │ 4 ms │ 2.43 ms │ 0.71 ms │ 15 ms │
    └─────────┴──────┴──────┴───────┴──────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬───────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg       │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Req/Sec   │ 33,503  │ 33,503  │ 34,111  │ 34,911  │ 34,113.07 │ 356.7  │ 33,499  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Bytes/Sec │ 91.8 MB │ 91.8 MB │ 93.3 MB │ 95.6 MB │ 93.4 MB   │ 963 kB │ 91.7 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴───────────┴────────┴─────────┘

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

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

    512k requests in 15.01s, 1.4 GB read
    ```

**PostgreSQL**

Requests / second

32,966

491,200 requests in 15 s

Latency p50

3ms

average 2.5 ms

Latency p99

4ms

max 10 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **32,746** · 2 : **33,186** req/s · spread 1.3 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **6.6 vCPU**, **125 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · Redis **0.2 vCPU** · whole server busy **89 %**, of which kernel (network, disk) **22 %** · memory used **1350 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · PostgreSQL · get all with caching, both tokens · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬──────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼──────┼─────────┼─────────┼───────┤
    │ Latency │ 1 ms │ 3 ms │ 4 ms  │ 4 ms │ 2.55 ms │ 0.72 ms │ 10 ms │
    └─────────┴──────┴──────┴───────┴──────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬─────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev   │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
    │ Req/Sec   │ 31,823  │ 31,823  │ 32,831  │ 33,855  │ 32,745.6 │ 508.34  │ 31,815  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
    │ Bytes/Sec │ 77.2 MB │ 77.2 MB │ 79.6 MB │ 82.2 MB │ 79.4 MB  │ 1.25 MB │ 77.2 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴─────────┴─────────┘

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

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

    491k requests in 15.01s, 1.19 GB read
    ```

**MySQL**

Requests / second

33,000

494,611 requests in 15 s

Latency p50

3ms

average 2.5 ms

Latency p99

4ms

max 11 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **32,973** · 2 : **33,027** req/s · spread 0.2 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **6.6 vCPU**, **125 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **57 MB** · Redis **0.2 vCPU** · whole server busy **89 %**, of which kernel (network, disk) **22 %** · memory used **1743 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · MySQL · get all with caching, both tokens · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬──────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼──────┼─────────┼─────────┼───────┤
    │ Latency │ 1 ms │ 3 ms │ 4 ms  │ 4 ms │ 2.53 ms │ 0.71 ms │ 11 ms │
    └─────────┴──────┴──────┴───────┴──────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬───────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg       │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Req/Sec   │ 32,479  │ 32,479  │ 33,023  │ 33,439  │ 32,973.34 │ 241.75 │ 32,475  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Bytes/Sec │ 78.8 MB │ 78.8 MB │ 80.2 MB │ 81.1 MB │ 80 MB     │ 580 kB │ 78.8 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴───────────┴────────┴─────────┘

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

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

    495k requests in 15.01s, 1.2 GB 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

10,646

160,081 requests in 15 s

Latency p50

8ms

average 8.9 ms

Latency p99

21ms

max 44 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **10,673** · 2 : **10,620** req/s · spread 0.5 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **3.1 vCPU**, **145 MB** RSS · MongoDB **3.8 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **98 %**, of which kernel (network, disk) **30 %** · memory used **1128 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · MongoDB · get all by stream, public · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬───────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%   │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼───────┼─────────┼─────────┼───────┤
    │ Latency │ 4 ms │ 8 ms │ 18 ms │ 21 ms │ 8.87 ms │ 3.66 ms │ 44 ms │
    └─────────┴──────┴──────┴───────┴───────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 10,439  │ 10,439  │ 10,647  │ 11,015  │ 10,672.8 │ 148.64 │ 10,433  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 30.1 MB │ 30.1 MB │ 30.7 MB │ 31.8 MB │ 30.8 MB  │ 430 kB │ 30.1 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴────────┴─────────┘

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

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

    160k requests in 15.01s, 461 MB read
    ```

**PostgreSQL**

Requests / second

12,914

191,785 requests in 15 s

Latency p50

7ms

average 7.3 ms

Latency p99

9ms

max 14 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **13,042** · 2 : **12,785** req/s · spread 2 % · the output below is round 2, the closer to the average

(Server during this run) API Maker **3.5 vCPU**, **143 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.5 vCPU** · sandboxes **0.0 vCPU**, **890 MB** · whole server busy **79 %**, of which kernel (network, disk) **28 %** · memory used **2483 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · PostgreSQL · get all by stream, public · round 2 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬──────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼──────┼─────────┼─────────┼───────┤
    │ Latency │ 6 ms │ 7 ms │ 9 ms  │ 9 ms │ 7.32 ms │ 0.86 ms │ 14 ms │
    └─────────┴──────┴──────┴───────┴──────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬───────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg       │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Req/Sec   │ 12,239  │ 12,239  │ 12,743  │ 13,407  │ 12,785.34 │ 252.69 │ 12,237  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Bytes/Sec │ 31.5 MB │ 31.5 MB │ 32.8 MB │ 34.5 MB │ 32.9 MB   │ 649 kB │ 31.5 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴───────────┴────────┴─────────┘

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

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

    192k requests in 15.01s, 493 MB read
    ```

**MySQL**

Requests / second

12,489

185,952 requests in 15 s

Latency p50

8ms

average 7.6 ms

Latency p99

10ms

max 15 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **12,580** · 2 : **12,398** req/s · spread 1.5 % · the output below is round 2, the closer to the average

(Server during this run) API Maker **3.9 vCPU**, **151 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.2 vCPU** · sandboxes **0.0 vCPU**, **874 MB** · whole server busy **81 %**, of which kernel (network, disk) **27 %** · memory used **2710 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · MySQL · get all by stream, public · round 2 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬───────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%   │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼───────┼─────────┼─────────┼───────┤
    │ Latency │ 6 ms │ 8 ms │ 9 ms  │ 10 ms │ 7.57 ms │ 0.88 ms │ 15 ms │
    └─────────┴──────┴──────┴───────┴───────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬───────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg       │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Req/Sec   │ 12,223  │ 12,223  │ 12,375  │ 12,799  │ 12,398.14 │ 143.66 │ 12,216  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Bytes/Sec │ 31.4 MB │ 31.4 MB │ 31.8 MB │ 32.9 MB │ 31.9 MB   │ 369 kB │ 31.4 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴───────────┴────────┴─────────┘

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

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

    186k requests in 15.01s, 478 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

11,025

162,260 requests in 15 s

Latency p50

8ms

average 8.7 ms

Latency p99

18ms

max 41 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **11,232** · 2 : **10,818** req/s · spread 3.8 % · the output below is round 2, the closer to the average

(Server during this run) API Maker **3.9 vCPU**, **150 MB** RSS · MongoDB **2.8 vCPU** · sandboxes **0.0 vCPU**, **848 MB** · whole server busy **96 %**, of which kernel (network, disk) **26 %** · memory used **2162 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · MongoDB · get all by stream, both tokens · round 2 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬───────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%   │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼───────┼─────────┼─────────┼───────┤
    │ Latency │ 4 ms │ 8 ms │ 16 ms │ 18 ms │ 8.74 ms │ 3.09 ms │ 41 ms │
    └─────────┴──────┴──────┴───────┴───────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 10,495  │ 10,495  │ 10,791  │ 11,311  │ 10,818.4 │ 199.06 │ 10,492  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 31.3 MB │ 31.3 MB │ 32.2 MB │ 33.7 MB │ 32.3 MB  │ 590 kB │ 31.3 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴────────┴─────────┘

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

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

    162k requests in 15.01s, 484 MB read
    ```

**PostgreSQL**

Requests / second

12,049

180,215 requests in 15 s

Latency p50

8ms

average 7.8 ms

Latency p99

10ms

max 15 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **12,082** · 2 : **12,015** req/s · spread 0.6 % · the output below is round 2, the closer to the average

(Server during this run) API Maker **3.8 vCPU**, **142 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.4 vCPU** · sandboxes **0.0 vCPU**, **890 MB** · whole server busy **80 %**, of which kernel (network, disk) **27 %** · memory used **2508 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · PostgreSQL · get all by stream, both tokens · round 2 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬───────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%   │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼───────┼─────────┼─────────┼───────┤
    │ Latency │ 6 ms │ 8 ms │ 9 ms  │ 10 ms │ 7.82 ms │ 0.91 ms │ 15 ms │
    └─────────┴──────┴──────┴───────┴───────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬────────┬─────────┬───────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%    │ 97.5%   │ Avg       │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼────────┼─────────┼───────────┼────────┼─────────┤
    │ Req/Sec   │ 11,783  │ 11,783  │ 11,991 │ 12,471  │ 12,014.67 │ 162.38 │ 11,777  │
    ├───────────┼─────────┼─────────┼────────┼─────────┼───────────┼────────┼─────────┤
    │ Bytes/Sec │ 31.5 MB │ 31.5 MB │ 32 MB  │ 33.3 MB │ 32.1 MB   │ 435 kB │ 31.5 MB │
    └───────────┴─────────┴─────────┴────────┴─────────┴───────────┴────────┴─────────┘

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

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

    180k requests in 15.01s, 481 MB read
    ```

**MySQL**

Requests / second

11,587

174,277 requests in 15 s

Latency p50

8ms

average 8.1 ms

Latency p99

10ms

max 17 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **11,619** · 2 : **11,556** req/s · spread 0.5 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **4.2 vCPU**, **142 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.2 vCPU** · sandboxes **0.0 vCPU**, **57 MB** · whole server busy **82 %**, of which kernel (network, disk) **26 %** · memory used **1779 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · MySQL · get all by stream, both tokens · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬───────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%   │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼───────┼─────────┼─────────┼───────┤
    │ Latency │ 7 ms │ 8 ms │ 10 ms │ 10 ms │ 8.11 ms │ 0.97 ms │ 17 ms │
    └─────────┴──────┴──────┴───────┴───────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬───────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg       │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Req/Sec   │ 11,367  │ 11,367  │ 11,583  │ 12,151  │ 11,618.94 │ 191.4  │ 11,367  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Bytes/Sec │ 30.4 MB │ 30.4 MB │ 30.9 MB │ 32.5 MB │ 31 MB     │ 511 kB │ 30.4 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴───────────┴────────┴─────────┘

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

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

    174k requests in 15.01s, 466 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

8,062

120,926 requests in 15 s

Latency p50

12ms

average 11.9 ms

Latency p99

23ms

max 39 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **8,062** · 2 : **8,062** req/s · spread 0 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **4.1 vCPU**, **141 MB** RSS · MongoDB **2.9 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **97 %**, of which kernel (network, disk) **25 %** · memory used **1171 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · MongoDB · custom api calling get all, public · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬───────┬───────┬───────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%   │ 97.5% │ 99%   │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼───────┼───────┼───────┼─────────┼─────────┼───────┤
    │ Latency │ 5 ms │ 12 ms │ 20 ms │ 23 ms │ 11.9 ms │ 3.78 ms │ 39 ms │
    └─────────┴──────┴───────┴───────┴───────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬───────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%   │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼───────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 7,971   │ 7,971   │ 8,047 │ 8,223   │ 8,062.27 │ 65.3   │ 7,969   │
    ├───────────┼─────────┼─────────┼───────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 21.8 MB │ 21.8 MB │ 22 MB │ 22.5 MB │ 22 MB    │ 178 kB │ 21.8 MB │
    └───────────┴─────────┴─────────┴───────┴─────────┴──────────┴────────┴─────────┘

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

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

    121k requests in 15.01s, 331 MB read
    ```

**PostgreSQL**

Requests / second

9,350

138,597 requests in 15 s

Latency p50

10ms

average 10.3 ms

Latency p99

13ms

max 17 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **9,240** · 2 : **9,460** req/s · spread 2.4 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **4.9 vCPU**, **139 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.2 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **88 %**, of which kernel (network, disk) **22 %** · memory used **1389 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · PostgreSQL · custom api calling get all, public · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼──────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 9 ms │ 10 ms │ 12 ms │ 13 ms │ 10.32 ms │ 1.04 ms │ 17 ms │
    └─────────┴──────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 9,039   │ 9,039   │ 9,231   │ 9,575   │ 9,239.74 │ 116.74 │ 9,033   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 21.9 MB │ 21.9 MB │ 22.4 MB │ 23.2 MB │ 22.4 MB  │ 284 kB │ 21.9 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴────────┴─────────┘

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

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

    139k requests in 15.01s, 336 MB read
    ```

**MySQL**

Requests / second

9,698

145,990 requests in 15 s

Latency p50

10ms

average 9.8 ms

Latency p99

12ms

max 17 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **9,734** · 2 : **9,662** req/s · spread 0.7 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **4.9 vCPU**, **137 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.0 vCPU** · sandboxes **0.0 vCPU**, **57 MB** · whole server busy **86 %**, of which kernel (network, disk) **22 %** · memory used **1780 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · MySQL · custom api calling get all, public · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬───────┬───────┬───────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%   │ 97.5% │ 99%   │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼───────┼───────┼───────┼─────────┼─────────┼───────┤
    │ Latency │ 8 ms │ 10 ms │ 12 ms │ 12 ms │ 9.77 ms │ 1.08 ms │ 17 ms │
    └─────────┴──────┴───────┴───────┴───────┴─────────┴─────────┴───────┘
    ┌───────────┬───────┬───────┬─────────┬─────────┬──────────┬────────┬───────┐
    │ Stat      │ 1%    │ 2.5%  │ 50%     │ 97.5%   │ Avg      │ Stdev  │ Min   │
    ├───────────┼───────┼───────┼─────────┼─────────┼──────────┼────────┼───────┤
    │ Req/Sec   │ 9,503 │ 9,503 │ 9,671   │ 10,167  │ 9,734.14 │ 179.83 │ 9,500 │
    ├───────────┼───────┼───────┼─────────┼─────────┼──────────┼────────┼───────┤
    │ Bytes/Sec │ 23 MB │ 23 MB │ 23.4 MB │ 24.6 MB │ 23.6 MB  │ 435 kB │ 23 MB │
    └───────────┴───────┴───────┴─────────┴─────────┴──────────┴────────┴───────┘

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

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

    146k requests in 15.01s, 354 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

8,393

127,441 requests in 15 s

Latency p50

11ms

average 11.3 ms

Latency p99

21ms

max 34 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **8,496** · 2 : **8,290** req/s · spread 2.5 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **4.8 vCPU**, **142 MB** RSS · MongoDB **2.1 vCPU** · sandboxes **0.0 vCPU**, **55 MB** · whole server busy **96 %**, of which kernel (network, disk) **21 %** · memory used **1177 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · MongoDB · custom api calling get all, both tokens · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼──────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 5 ms │ 11 ms │ 19 ms │ 21 ms │ 11.27 ms │ 3.41 ms │ 34 ms │
    └─────────┴──────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 8,327   │ 8,327   │ 8,487   │ 8,639   │ 8,496.27 │ 92.05  │ 8,321   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 22.8 MB │ 22.8 MB │ 23.2 MB │ 23.6 MB │ 23.2 MB  │ 251 kB │ 22.8 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴────────┴─────────┘

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

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

    128k requests in 15.01s, 349 MB read
    ```

**PostgreSQL**

Requests / second

8,433

126,032 requests in 15 s

Latency p50

11ms

average 11.4 ms

Latency p99

14ms

max 20 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **8,464** · 2 : **8,402** req/s · spread 0.7 % · the output below is round 2, the closer to the average

(Server during this run) API Maker **5.0 vCPU**, **139 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.0 vCPU** · sandboxes **0.0 vCPU**, **890 MB** · whole server busy **88 %**, of which kernel (network, disk) **21 %** · memory used **2499 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · PostgreSQL · custom api calling get all, both tokens · round 2 of 2, the closer to the average

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

    ┌─────────┬───────┬───────┬───────┬───────┬─────────┬────────┬───────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg     │ Stdev  │ Max   │
    ├─────────┼───────┼───────┼───────┼───────┼─────────┼────────┼───────┤
    │ Latency │ 10 ms │ 11 ms │ 14 ms │ 14 ms │ 11.4 ms │ 1.2 ms │ 20 ms │
    └─────────┴───────┴───────┴───────┴───────┴─────────┴────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬─────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg     │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼────────┼─────────┤
    │ Req/Sec   │ 8,207   │ 8,207   │ 8,375   │ 8,639   │ 8,402.4 │ 101.04 │ 8,207   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼────────┼─────────┤
    │ Bytes/Sec │ 19.9 MB │ 19.9 MB │ 20.3 MB │ 20.9 MB │ 20.4 MB │ 245 kB │ 19.9 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴─────────┴────────┴─────────┘

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

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

    126k requests in 15.01s, 306 MB read
    ```

**MySQL**

Requests / second

8,962

133,707 requests in 15 s

Latency p50

11ms

average 10.7 ms

Latency p99

14ms

max 20 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **8,914** · 2 : **9,010** req/s · spread 1.1 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **5.1 vCPU**, **137 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.0 vCPU** · sandboxes **0.0 vCPU**, **57 MB** · whole server busy **88 %**, of which kernel (network, disk) **21 %** · memory used **1783 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · MySQL · custom api calling get all, both tokens · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼──────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 9 ms │ 11 ms │ 13 ms │ 14 ms │ 10.72 ms │ 1.13 ms │ 20 ms │
    └─────────┴──────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬─────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg     │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼────────┼─────────┤
    │ Req/Sec   │ 8,719   │ 8,719   │ 8,911   │ 9,167   │ 8,914.4 │ 123.29 │ 8,714   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼────────┼─────────┤
    │ Bytes/Sec │ 21.1 MB │ 21.1 MB │ 21.6 MB │ 22.2 MB │ 21.6 MB │ 301 kB │ 21.1 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴─────────┴────────┴─────────┘

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

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

    134k requests in 15.01s, 324 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

7,636

113,499 requests in 15 s

Latency p50

12ms

average 12.7 ms

Latency p99

28ms

max 64 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **7,567** · 2 : **7,705** req/s · spread 1.8 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **1.9 vCPU**, **136 MB** RSS · MongoDB **2.3 vCPU** · sandboxes **3.7 vCPU**, **826 MB** · whole server busy **99 %**, of which kernel (network, disk) **21 %** · memory used **1994 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · MongoDB · custom api in the sandbox, public · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼──────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 5 ms │ 12 ms │ 24 ms │ 28 ms │ 12.72 ms │ 5.03 ms │ 64 ms │
    └─────────┴──────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 7,415   │ 7,415   │ 7,551   │ 7,731   │ 7,567.34 │ 78.3   │ 7,412   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 20.3 MB │ 20.3 MB │ 20.7 MB │ 21.2 MB │ 20.7 MB  │ 215 kB │ 20.3 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴────────┴─────────┘

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

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 1            │
    ├────────────┼──────────────┤
    │ 0.01       │ 2            │
    ├────────────┼──────────────┤
    │ 0.1        │ 2            │
    ├────────────┼──────────────┤
    │ 1          │ 4            │
    ├────────────┼──────────────┤
    │ 2.5        │ 5            │
    ├────────────┼──────────────┤
    │ 10         │ 7            │
    ├────────────┼──────────────┤
    │ 25         │ 9            │
    ├────────────┼──────────────┤
    │ 50         │ 12           │
    ├────────────┼──────────────┤
    │ 75         │ 16           │
    ├────────────┼──────────────┤
    │ 90         │ 19           │
    ├────────────┼──────────────┤
    │ 97.5       │ 24           │
    ├────────────┼──────────────┤
    │ 99         │ 28           │
    ├────────────┼──────────────┤
    │ 99.9       │ 41           │
    ├────────────┼──────────────┤
    │ 99.99      │ 53           │
    ├────────────┼──────────────┤
    │ 99.999     │ 58           │
    └────────────┴──────────────┘

    114k requests in 15.01s, 310 MB read
    ```

**PostgreSQL**

Requests / second

8,682

130,504 requests in 15 s

Latency p50

11ms

average 11.0 ms

Latency p99

20ms

max 32 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **8,702** · 2 : **8,662** req/s · spread 0.5 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **2.3 vCPU**, **133 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.1 vCPU** · sandboxes **3.6 vCPU**, **888 MB** · whole server busy **97 %**, of which kernel (network, disk) **26 %** · memory used **2459 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · PostgreSQL · custom api in the sandbox, public · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼──────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 5 ms │ 11 ms │ 18 ms │ 20 ms │ 10.99 ms │ 3.56 ms │ 32 ms │
    └─────────┴──────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬─────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg     │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼────────┼─────────┤
    │ Req/Sec   │ 8,527   │ 8,527   │ 8,711   │ 8,855   │ 8,701.6 │ 74.03  │ 8,524   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼────────┼─────────┤
    │ Bytes/Sec │ 20.7 MB │ 20.7 MB │ 21.1 MB │ 21.5 MB │ 21.1 MB │ 179 kB │ 20.7 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴─────────┴────────┴─────────┘

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

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

    131k requests in 15.01s, 316 MB read
    ```

**MySQL**

Requests / second

9,181

137,527 requests in 15 s

Latency p50

10ms

average 10.4 ms

Latency p99

19ms

max 32 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **9,169** · 2 : **9,194** req/s · spread 0.3 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **2.4 vCPU**, **133 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.0 vCPU** · sandboxes **3.5 vCPU**, **858 MB** · whole server busy **96 %**, of which kernel (network, disk) **27 %** · memory used **2650 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · MySQL · custom api in the sandbox, public · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬───────┬───────┬───────┬─────────┬────────┬───────┐
    │ Stat    │ 2.5% │ 50%   │ 97.5% │ 99%   │ Avg     │ Stdev  │ Max   │
    ├─────────┼──────┼───────┼───────┼───────┼─────────┼────────┼───────┤
    │ Latency │ 4 ms │ 10 ms │ 17 ms │ 19 ms │ 10.4 ms │ 3.4 ms │ 32 ms │
    └─────────┴──────┴───────┴───────┴───────┴─────────┴────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬─────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg     │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼────────┼─────────┤
    │ Req/Sec   │ 8,975   │ 8,975   │ 9,175   │ 9,351   │ 9,168.8 │ 111.5  │ 8,975   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼────────┼─────────┤
    │ Bytes/Sec │ 21.8 MB │ 21.8 MB │ 22.2 MB │ 22.7 MB │ 22.2 MB │ 271 kB │ 21.8 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴─────────┴────────┴─────────┘

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

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

    138k requests in 15.01s, 333 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

8,512

129,576 requests in 15 s

Latency p50

11ms

average 11.1 ms

Latency p99

24ms

max 55 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **8,639** · 2 : **8,384** req/s · spread 3 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **3.8 vCPU**, **140 MB** RSS · MongoDB **3.2 vCPU** · sandboxes **0.0 vCPU**, **831 MB** · whole server busy **97 %**, of which kernel (network, disk) **25 %** · memory used **2008 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · MongoDB · get all with a pre hook, both tokens · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼──────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 5 ms │ 11 ms │ 21 ms │ 24 ms │ 11.08 ms │ 4.03 ms │ 55 ms │
    └─────────┴──────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 8,463   │ 8,463   │ 8,671   │ 8,735   │ 8,639.21 │ 75.1   │ 8,462   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 23.2 MB │ 23.2 MB │ 23.7 MB │ 23.9 MB │ 23.6 MB  │ 207 kB │ 23.1 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴────────┴─────────┘

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

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

    130k requests in 15.01s, 354 MB read
    ```

**PostgreSQL**

Requests / second

9,668

145,230 requests in 15 s

Latency p50

10ms

average 9.8 ms

Latency p99

12ms

max 21 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **9,682** · 2 : **9,654** req/s · spread 0.3 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **4.4 vCPU**, **138 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.4 vCPU** · sandboxes **0.0 vCPU**, **893 MB** · whole server busy **84 %**, of which kernel (network, disk) **23 %** · memory used **2464 MB** of 32095 MB · steal **0 %** · swap not touched

    autocannon · PostgreSQL · get all with a pre hook, both tokens · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬───────┬───────┬───────┬─────────┬────────┬───────┐
    │ Stat    │ 2.5% │ 50%   │ 97.5% │ 99%   │ Avg     │ Stdev  │ Max   │
    ├─────────┼──────┼───────┼───────┼───────┼─────────┼────────┼───────┤
    │ Latency │ 8 ms │ 10 ms │ 12 ms │ 12 ms │ 9.83 ms │ 1.1 ms │ 21 ms │
    └─────────┴──────┴───────┴───────┴───────┴─────────┴────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 9,415   │ 9,415   │ 9,695   │ 9,951   │ 9,681.87 │ 122.99 │ 9,414   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 22.8 MB │ 22.8 MB │ 23.5 MB │ 24.1 MB │ 23.5 MB  │ 296 kB │ 22.8 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴────────┴─────────┘

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

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

    145k requests in 15.01s, 352 MB read
    ```

**MySQL**

Requests / second

10,192

153,085 requests in 15 s

Latency p50

9ms

average 9.3 ms

Latency p99

13ms

max 22 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **10,208** · 2 : **10,177** req/s · spread 0.3 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **4.4 vCPU**, **136 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.2 vCPU** · sandboxes **0.0 vCPU**, **858 MB** · whole server busy **84 %**, of which kernel (network, disk) **24 %** · memory used **2669 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · MySQL · get all with a pre hook, both tokens · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬───────┬────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%   │ Avg    │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼───────┼────────┼─────────┼───────┤
    │ Latency │ 8 ms │ 9 ms │ 12 ms │ 13 ms │ 9.3 ms │ 1.21 ms │ 22 ms │
    └─────────┴──────┴──────┴───────┴───────┴────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬───────────┬─────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg       │ Stdev   │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼─────────┼─────────┤
    │ Req/Sec   │ 8,775   │ 8,775   │ 10,359  │ 10,583  │ 10,207.74 │ 430.62  │ 8,774   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼─────────┼─────────┤
    │ Bytes/Sec │ 21.3 MB │ 21.3 MB │ 25.1 MB │ 25.7 MB │ 24.7 MB   │ 1.04 MB │ 21.3 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴───────────┴─────────┴─────────┘

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

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

    153k requests in 15.01s, 371 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

12,297

181,380 requests in 15 s

Latency p50

7ms

average 7.8 ms

Latency p99

18ms

max 48 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **12,502** · 2 : **12,093** req/s · spread 3.3 % · the output below is round 2, the closer to the average

(Server during this run) API Maker **3.1 vCPU**, **142 MB** RSS · MongoDB **3.6 vCPU** · sandboxes **0.0 vCPU**, **832 MB** · whole server busy **97 %**, of which kernel (network, disk) **32 %** · memory used **2108 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · MongoDB · get by id, public · round 2 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬───────┬─────────┬────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%   │ Avg     │ Stdev  │ Max   │
    ├─────────┼──────┼──────┼───────┼───────┼─────────┼────────┼───────┤
    │ Latency │ 3 ms │ 7 ms │ 15 ms │ 18 ms │ 7.77 ms │ 3.1 ms │ 48 ms │
    └─────────┴──────┴──────┴───────┴───────┴─────────┴────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬───────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg       │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Req/Sec   │ 11,855  │ 11,855  │ 12,047  │ 12,551  │ 12,092.54 │ 193.08 │ 11,852  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Bytes/Sec │ 7.04 MB │ 7.04 MB │ 7.16 MB │ 7.45 MB │ 7.18 MB   │ 114 kB │ 7.04 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴───────────┴────────┴─────────┘

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

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

    181k requests in 15.01s, 108 MB read
    ```

**PostgreSQL**

Requests / second

13,656

204,840 requests in 15 s

Latency p50

7ms

average 6.8 ms

Latency p99

8ms

max 13 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **13,657** · 2 : **13,655** req/s · spread 0 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **3.1 vCPU**, **138 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.7 vCPU** · sandboxes **0.0 vCPU**, **893 MB** · whole server busy **77 %**, of which kernel (network, disk) **28 %** · memory used **2456 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · PostgreSQL · get by id, public · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬──────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼──────┼─────────┼─────────┼───────┤
    │ Latency │ 6 ms │ 7 ms │ 8 ms  │ 8 ms │ 6.83 ms │ 0.79 ms │ 13 ms │
    └─────────┴──────┴──────┴───────┴──────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 13,303  │ 13,303  │ 13,599  │ 14,247  │ 13,656.8 │ 239.77 │ 13,300  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 7.46 MB │ 7.46 MB │ 7.63 MB │ 7.99 MB │ 7.66 MB  │ 134 kB │ 7.46 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴────────┴─────────┘

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

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

    205k requests in 15.01s, 115 MB read
    ```

**MySQL**

Requests / second

14,402

214,485 requests in 15 s

Latency p50

6ms

average 6.5 ms

Latency p99

8ms

max 13 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **14,299** · 2 : **14,506** req/s · spread 1.4 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **3.4 vCPU**, **135 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.4 vCPU** · sandboxes **0.0 vCPU**, **858 MB** · whole server busy **77 %**, of which kernel (network, disk) **29 %** · memory used **2670 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · MySQL · get by id, public · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬──────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼──────┼─────────┼─────────┼───────┤
    │ Latency │ 5 ms │ 6 ms │ 8 ms  │ 8 ms │ 6.49 ms │ 0.76 ms │ 13 ms │
    └─────────┴──────┴──────┴───────┴──────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬───────────┬─────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg       │ Stdev   │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼─────────┼─────────┤
    │ Req/Sec   │ 14,103  │ 14,103  │ 14,295  │ 14,551  │ 14,298.94 │ 112.23  │ 14,102  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼─────────┼─────────┤
    │ Bytes/Sec │ 7.91 MB │ 7.91 MB │ 8.02 MB │ 8.16 MB │ 8.02 MB   │ 62.5 kB │ 7.91 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴───────────┴─────────┴─────────┘

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

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

    215k requests in 15.01s, 120 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

12,654

189,329 requests in 15 s

Latency p50

7ms

average 7.4 ms

Latency p99

15ms

max 29 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **12,622** · 2 : **12,686** req/s · spread 0.5 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **3.9 vCPU**, **141 MB** RSS · MongoDB **2.6 vCPU** · sandboxes **0.0 vCPU**, **830 MB** · whole server busy **94 %**, of which kernel (network, disk) **27 %** · memory used **1969 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · MongoDB · get by id, both tokens · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬───────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%   │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼───────┼─────────┼─────────┼───────┤
    │ Latency │ 3 ms │ 7 ms │ 13 ms │ 15 ms │ 7.42 ms │ 2.53 ms │ 29 ms │
    └─────────┴──────┴──────┴───────┴───────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 12,359  │ 12,359  │ 12,543  │ 13,591  │ 12,621.6 │ 281.63 │ 12,353  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 7.34 MB │ 7.34 MB │ 7.45 MB │ 8.07 MB │ 7.5 MB   │ 167 kB │ 7.34 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴────────┴─────────┘

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

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

    189k requests in 15.01s, 112 MB read
    ```

**PostgreSQL**

Requests / second

12,548

189,333 requests in 15 s

Latency p50

7ms

average 7.4 ms

Latency p99

10ms

max 17 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **12,623** · 2 : **12,472** req/s · spread 1.2 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **3.4 vCPU**, **138 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **1.6 vCPU** · sandboxes **0.0 vCPU**, **893 MB** · whole server busy **79 %**, of which kernel (network, disk) **26 %** · memory used **2459 MB** of 32095 MB · steal **0 %** · swap not touched

    autocannon · PostgreSQL · get by id, both tokens · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬───────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%   │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼───────┼─────────┼─────────┼───────┤
    │ Latency │ 6 ms │ 7 ms │ 9 ms  │ 10 ms │ 7.42 ms │ 0.97 ms │ 17 ms │
    └─────────┴──────┴──────┴───────┴───────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬───────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg       │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Req/Sec   │ 11,487  │ 11,487  │ 12,743  │ 12,951  │ 12,622.67 │ 355.32 │ 11,483  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Bytes/Sec │ 6.44 MB │ 6.44 MB │ 7.15 MB │ 7.27 MB │ 7.08 MB   │ 200 kB │ 6.44 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴───────────┴────────┴─────────┘

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

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

    189k requests in 15.01s, 106 MB read
    ```

**MySQL**

Requests / second

13,222

201,103 requests in 15 s

Latency p50

7ms

average 7.0 ms

Latency p99

9ms

max 15 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **13,037** · 2 : **13,408** req/s · spread 2.8 % · the output below is round 2, the closer to the average

(Server during this run) API Maker **3.8 vCPU**, **137 MB** RSS · MongoDB **0.0 vCPU** · MySQL **1.3 vCPU** · sandboxes **0.0 vCPU**, **860 MB** · whole server busy **80 %**, of which kernel (network, disk) **27 %** · memory used **2677 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · MySQL · get by id, both tokens · round 2 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬──────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼──────┼─────────┼─────────┼───────┤
    │ Latency │ 6 ms │ 7 ms │ 8 ms  │ 9 ms │ 6.96 ms │ 0.82 ms │ 15 ms │
    └─────────┴──────┴──────┴───────┴──────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬────────┬─────────┬───────────┬────────┬────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%    │ 97.5%   │ Avg       │ Stdev  │ Min    │
    ├───────────┼─────────┼─────────┼────────┼─────────┼───────────┼────────┼────────┤
    │ Req/Sec   │ 13,199  │ 13,199  │ 13,375 │ 13,751  │ 13,407.74 │ 139.12 │ 13,194 │
    ├───────────┼─────────┼─────────┼────────┼─────────┼───────────┼────────┼────────┤
    │ Bytes/Sec │ 7.41 MB │ 7.41 MB │ 7.5 MB │ 7.72 MB │ 7.52 MB   │ 79 kB  │ 7.4 MB │
    └───────────┴─────────┴─────────┴────────┴─────────┴───────────┴────────┴────────┘

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

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

    201k requests in 15.01s, 113 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

44,564

679,518 requests in 15 s

Latency p50

2ms

average 1.7 ms

Latency p99

3ms

max 10 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **45,302** · 2 : **43,826** req/s · spread 3.3 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **6.3 vCPU**, **137 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **830 MB** · Redis **0.2 vCPU** · whole server busy **86 %**, of which kernel (network, disk) **23 %** · memory used **1967 MB** of 32095 MB · steal **0 %** · swap not touched

    autocannon · MongoDB · get by id with caching, public · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬──────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼──────┼─────────┼─────────┼───────┤
    │ Latency │ 1 ms │ 2 ms │ 3 ms  │ 3 ms │ 1.71 ms │ 0.59 ms │ 10 ms │
    └─────────┴──────┴──────┴───────┴──────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬──────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev    │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼──────────┼─────────┤
    │ Req/Sec   │ 43,999  │ 43,999  │ 45,119  │ 47,839  │ 45,302.4 │ 1,135.18 │ 43,999  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼──────────┼─────────┤
    │ Bytes/Sec │ 26.2 MB │ 26.2 MB │ 26.9 MB │ 28.5 MB │ 27 MB    │ 676 kB   │ 26.2 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴──────────┴─────────┘

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

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

    680k requests in 15.01s, 405 MB read
    ```

**PostgreSQL**

Requests / second

43,050

656,296 requests in 15 s

Latency p50

2ms

average 1.8 ms

Latency p99

3ms

max 9 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **43,752** · 2 : **42,348** req/s · spread 3.3 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **6.2 vCPU**, **134 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **824 MB** · Redis **0.2 vCPU** · whole server busy **85 %**, of which kernel (network, disk) **23 %** · memory used **2415 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · PostgreSQL · get by id with caching, public · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬──────┬─────────┬────────┬──────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg     │ Stdev  │ Max  │
    ├─────────┼──────┼──────┼───────┼──────┼─────────┼────────┼──────┤
    │ Latency │ 1 ms │ 2 ms │ 3 ms  │ 3 ms │ 1.79 ms │ 0.6 ms │ 9 ms │
    └─────────┴──────┴──────┴───────┴──────┴─────────┴────────┴──────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬───────────┬──────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg       │ Stdev    │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼──────────┼─────────┤
    │ Req/Sec   │ 41,439  │ 41,439  │ 43,775  │ 45,983  │ 43,751.47 │ 1,462.54 │ 41,435  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼──────────┼─────────┤
    │ Bytes/Sec │ 23.3 MB │ 23.3 MB │ 24.6 MB │ 25.9 MB │ 24.6 MB   │ 825 kB   │ 23.3 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴───────────┴──────────┴─────────┘

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

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

    656k requests in 15.01s, 369 MB read
    ```

**MySQL**

Requests / second

43,160

644,159 requests in 15 s

Latency p50

2ms

average 1.8 ms

Latency p99

3ms

max 10 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **42,947** · 2 : **43,372** req/s · spread 1 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **6.3 vCPU**, **134 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **858 MB** · Redis **0.2 vCPU** · whole server busy **85 %**, of which kernel (network, disk) **23 %** · memory used **2667 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · MySQL · get by id with caching, public · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬──────┬─────────┬────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg     │ Stdev  │ Max   │
    ├─────────┼──────┼──────┼───────┼──────┼─────────┼────────┼───────┤
    │ Latency │ 1 ms │ 2 ms │ 3 ms  │ 3 ms │ 1.84 ms │ 0.6 ms │ 10 ms │
    └─────────┴──────┴──────┴───────┴──────┴─────────┴────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Req/Sec   │ 41,471  │ 41,471  │ 42,975  │ 44,031  │ 42,947.2 │ 764.78 │ 41,442  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼────────┼─────────┤
    │ Bytes/Sec │ 23.3 MB │ 23.3 MB │ 24.2 MB │ 24.8 MB │ 24.2 MB  │ 431 kB │ 23.3 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴────────┴─────────┘

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

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

    644k requests in 15.01s, 363 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

36,219

531,520 requests in 15 s

Latency p50

2ms

average 2.3 ms

Latency p99

4ms

max 10 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **37,002** · 2 : **35,436** req/s · spread 4.3 % · the output below is round 2, the closer to the average

(Server during this run) API Maker **6.6 vCPU**, **138 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **832 MB** · Redis **0.2 vCPU** · whole server busy **89 %**, of which kernel (network, disk) **20 %** · memory used **2141 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · MongoDB · get by id with caching, both tokens · round 2 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬──────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼──────┼─────────┼─────────┼───────┤
    │ Latency │ 1 ms │ 2 ms │ 4 ms  │ 4 ms │ 2.32 ms │ 0.69 ms │ 10 ms │
    └─────────┴──────┴──────┴───────┴──────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬───────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg       │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Req/Sec   │ 34,783  │ 34,783  │ 35,615  │ 36,095  │ 35,435.74 │ 418.19 │ 34,773  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Bytes/Sec │ 20.7 MB │ 20.7 MB │ 21.2 MB │ 21.5 MB │ 21.1 MB   │ 251 kB │ 20.7 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴───────────┴────────┴─────────┘

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

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

    532k requests in 15.01s, 317 MB read
    ```

**PostgreSQL**

Requests / second

34,322

506,698 requests in 15 s

Latency p50

2ms

average 2.5 ms

Latency p99

4ms

max 14 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **33,780** · 2 : **34,864** req/s · spread 3.2 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **6.6 vCPU**, **134 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **824 MB** · Redis **0.2 vCPU** · whole server busy **89 %**, of which kernel (network, disk) **18 %** · memory used **2393 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · PostgreSQL · get by id with caching, both tokens · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬──────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼──────┼─────────┼─────────┼───────┤
    │ Latency │ 1 ms │ 2 ms │ 4 ms  │ 4 ms │ 2.46 ms │ 0.73 ms │ 14 ms │
    └─────────┴──────┴──────┴───────┴──────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬───────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg       │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Req/Sec   │ 32,831  │ 32,831  │ 33,535  │ 35,423  │ 33,780.27 │ 693.44 │ 32,827  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Bytes/Sec │ 18.5 MB │ 18.5 MB │ 18.9 MB │ 19.9 MB │ 19 MB     │ 389 kB │ 18.5 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴───────────┴────────┴─────────┘

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

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

    507k requests in 15.01s, 285 MB read
    ```

**MySQL**

Requests / second

34,667

515,725 requests in 15 s

Latency p50

2ms

average 2.4 ms

Latency p99

4ms

max 10 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **34,382** · 2 : **34,952** req/s · spread 1.6 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **6.6 vCPU**, **134 MB** RSS · MongoDB **0.0 vCPU** · MySQL **0.0 vCPU** · sandboxes **0.0 vCPU**, **858 MB** · Redis **0.2 vCPU** · whole server busy **89 %**, of which kernel (network, disk) **20 %** · memory used **2652 MB** of 32095 MB · steal **0 %** · swap not touched

    autocannon · MySQL · get by id with caching, both tokens · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬──────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼──────┼─────────┼─────────┼───────┤
    │ Latency │ 1 ms │ 2 ms │ 4 ms  │ 4 ms │ 2.41 ms │ 0.72 ms │ 10 ms │
    └─────────┴──────┴──────┴───────┴──────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬───────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg       │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Req/Sec   │ 33,567  │ 33,567  │ 34,239  │ 35,903  │ 34,381.87 │ 634.05 │ 33,551  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Bytes/Sec │ 18.9 MB │ 18.9 MB │ 19.3 MB │ 20.2 MB │ 19.4 MB   │ 359 kB │ 18.9 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴───────────┴────────┴─────────┘

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

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

    516k requests in 15.01s, 290 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

4,620

67,532 requests in 15 s

Latency p50

21ms

average 21.7 ms

Latency p99

38ms

max 62 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **4,737** · 2 : **4,503** req/s · spread 5.1 % · the output below is round 2, the closer to the average

(Server during this run) API Maker **2.1 vCPU**, **143 MB** RSS · MongoDB **4.2 vCPU** · sandboxes **0.0 vCPU**, **830 MB** · whole server busy **91 %**, of which kernel (network, disk) **27 %** · memory used **2124 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · MongoDB · insert one row, public · round 2 of 2, the closer to the average

    ```text
    $ autocannon -c 100 -d 15 -w 20 -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.134:38246/api/schema/bench/mongodb/am_bench/inserts_public/save-single-or-multiple"
    Running 15s test @ http://192.168.133.134:38246/api/schema/bench/mongodb/am_bench/inserts_public/save-single-or-multiple
    100 connections
    20 workers

    ┌─────────┬───────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼───────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 12 ms │ 21 ms │ 34 ms │ 38 ms │ 21.71 ms │ 5.61 ms │ 62 ms │
    └─────────┴───────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬─────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev   │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
    │ Req/Sec   │ 4,419   │ 4,419   │ 4,499   │ 4,603   │ 4,503.07 │ 55.32   │ 4,416   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
    │ Bytes/Sec │ 2.64 MB │ 2.64 MB │ 2.69 MB │ 2.75 MB │ 2.69 MB  │ 32.7 kB │ 2.64 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴─────────┴─────────┘

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

    ┌────────────┬──────────────┐
    │ Percentile │ Latency (ms) │
    ├────────────┼──────────────┤
    │ 0.001      │ 2            │
    ├────────────┼──────────────┤
    │ 0.01       │ 2            │
    ├────────────┼──────────────┤
    │ 0.1        │ 5            │
    ├────────────┼──────────────┤
    │ 1          │ 10           │
    ├────────────┼──────────────┤
    │ 2.5        │ 12           │
    ├────────────┼──────────────┤
    │ 10         │ 15           │
    ├────────────┼──────────────┤
    │ 25         │ 18           │
    ├────────────┼──────────────┤
    │ 50         │ 21           │
    ├────────────┼──────────────┤
    │ 75         │ 25           │
    ├────────────┼──────────────┤
    │ 90         │ 29           │
    ├────────────┼──────────────┤
    │ 97.5       │ 34           │
    ├────────────┼──────────────┤
    │ 99         │ 38           │
    ├────────────┼──────────────┤
    │ 99.9       │ 47           │
    ├────────────┼──────────────┤
    │ 99.99      │ 57           │
    ├────────────┼──────────────┤
    │ 99.999     │ 62           │
    └────────────┴──────────────┘

    68k requests in 15.01s, 40.4 MB read
    ```

**PostgreSQL**

Requests / second

5,754

86,194 requests in 15 s

Latency p50

17ms

average 16.9 ms

Latency p99

19ms

max 35 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **5,747** · 2 : **5,761** req/s · spread 0.3 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **2.3 vCPU**, **138 MB** RSS · MongoDB **0.0 vCPU** · PostgreSQL **2.1 vCPU** · sandboxes **0.0 vCPU**, **823 MB** · whole server busy **72 %**, of which kernel (network, disk) **24 %** · memory used **2408 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · PostgreSQL · insert one row, public · round 1 of 2, the closer to the average

    ```text
    $ autocannon -c 100 -d 15 -w 20 -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.134:38246/api/schema/bench/postgres/am_bench/public.inserts_public/save-single-or-multiple"
    Running 15s test @ http://192.168.133.134:38246/api/schema/bench/postgres/am_bench/public.inserts_public/save-single-or-multiple
    100 connections
    20 workers

    ┌─────────┬───────┬───────┬───────┬───────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg     │ Stdev   │ Max   │
    ├─────────┼───────┼───────┼───────┼───────┼─────────┼─────────┼───────┤
    │ Latency │ 15 ms │ 17 ms │ 19 ms │ 19 ms │ 16.9 ms │ 1.35 ms │ 35 ms │
    └─────────┴───────┴───────┴───────┴───────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬─────────┬───────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg     │ Stdev │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼───────┼─────────┤
    │ Req/Sec   │ 5,603   │ 5,603   │ 5,735   │ 6,003   │ 5,746.8 │ 94.52 │ 5,603   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼───────┼─────────┤
    │ Bytes/Sec │ 3.19 MB │ 3.19 MB │ 3.26 MB │ 3.42 MB │ 3.27 MB │ 54 kB │ 3.19 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴─────────┴───────┴─────────┘

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

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

    86k requests in 15.01s, 49.1 MB read
    ```

**MySQL**

Requests / second

3,532

53,217 requests in 15 s

Latency p50

28ms

average 27.7 ms

Latency p99

35ms

max 42 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **3,515** · 2 : **3,548** req/s · spread 1 % · the output below is round 2, the closer to the average

(Server during this run) API Maker **1.6 vCPU**, **139 MB** RSS · MongoDB **0.0 vCPU** · MySQL **3.2 vCPU** · sandboxes **0.0 vCPU**, **858 MB** · whole server busy **77 %**, of which kernel (network, disk) **21 %** · memory used **2653 MB** of 32095 MB · steal **0 %** · swap not touched

    autocannon · MySQL · insert one row, public · round 2 of 2, the closer to the average

    ```text
    $ autocannon -c 100 -d 15 -w 20 -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.134:38246/api/schema/bench/mysql/am_bench/inserts_public/save-single-or-multiple"
    Running 15s test @ http://192.168.133.134:38246/api/schema/bench/mysql/am_bench/inserts_public/save-single-or-multiple
    100 connections
    20 workers

    ┌─────────┬───────┬───────┬───────┬───────┬──────────┬─────────┬───────┐
    │ Stat    │ 2.5%  │ 50%   │ 97.5% │ 99%   │ Avg      │ Stdev   │ Max   │
    ├─────────┼───────┼───────┼───────┼───────┼──────────┼─────────┼───────┤
    │ Latency │ 23 ms │ 28 ms │ 32 ms │ 35 ms │ 27.67 ms │ 2.52 ms │ 42 ms │
    └─────────┴───────┴───────┴───────┴───────┴──────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg     │ Stdev   │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤
    │ Req/Sec   │ 3,427   │ 3,427   │ 3,527   │ 4,123   │ 3,548.4 │ 161.23  │ 3,426   │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤
    │ Bytes/Sec │ 1.95 MB │ 1.95 MB │ 2.01 MB │ 2.34 MB │ 2.02 MB │ 90.9 kB │ 1.95 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘

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

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

    53k requests in 15.01s, 30.3 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

47,967

708,272 requests in 15 s

Latency p50

2ms

average 1.6 ms

Latency p99

3ms

max 10 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **47,218** · 2 : **48,716** req/s · spread 3.1 % · the output below is round 1, the closer to the average

(Server during this run) API Maker **7.7 vCPU**, **134 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **0.0 vCPU**, **850 MB** · whole server busy **98 %**, of which kernel (network, disk) **22 %** · memory used **2123 MB** of 32095 MB · steal **0 %** · swap not touched

    autocannon · custom API without a database, in the server (lean code) · round 1 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬──────┬─────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg     │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼──────┼─────────┼─────────┼───────┤
    │ Latency │ 0 ms │ 2 ms │ 3 ms  │ 3 ms │ 1.63 ms │ 0.78 ms │ 10 ms │
    └─────────┴──────┴──────┴───────┴──────┴─────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬───────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg       │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Req/Sec   │ 46,015  │ 46,015  │ 47,263  │ 48,415  │ 47,218.14 │ 611.58 │ 46,012  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Bytes/Sec │ 18.4 MB │ 18.4 MB │ 18.9 MB │ 19.3 MB │ 18.8 MB   │ 242 kB │ 18.4 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴───────────┴────────┴─────────┘

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

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

    708k requests in 15.01s, 283 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

27,302

417,159 requests in 15 s

Latency p50

3ms

average 3.1 ms

Latency p99

8ms

max 15 ms

Errors

0

non-2xx, errors, timeouts

(2 rounds of 15 s) 1 : **26,793** · 2 : **27,811** req/s · spread 3.7 % · the output below is round 2, the closer to the average

(Server during this run) API Maker **5.3 vCPU**, **136 MB** RSS · MongoDB **0.0 vCPU** · sandboxes **2.1 vCPU**, **850 MB** · whole server busy **94 %**, of which kernel (network, disk) **23 %** · memory used **2121 MB** of 32096 MB · steal **0 %** · swap not touched

    autocannon · custom API without a database, in the sandbox · round 2 of 2, the closer to the average

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

    ┌─────────┬──────┬──────┬───────┬──────┬────────┬─────────┬───────┐
    │ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg    │ Stdev   │ Max   │
    ├─────────┼──────┼──────┼───────┼──────┼────────┼─────────┼───────┤
    │ Latency │ 1 ms │ 3 ms │ 7 ms  │ 8 ms │ 3.1 ms │ 1.61 ms │ 15 ms │
    └─────────┴──────┴──────┴───────┴──────┴────────┴─────────┴───────┘
    ┌───────────┬─────────┬─────────┬─────────┬─────────┬───────────┬────────┬─────────┐
    │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg       │ Stdev  │ Min     │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Req/Sec   │ 27,359  │ 27,359  │ 27,759  │ 28,687  │ 27,810.67 │ 335.61 │ 27,344  │
    ├───────────┼─────────┼─────────┼─────────┼─────────┼───────────┼────────┼─────────┤
    │ Bytes/Sec │ 11.3 MB │ 11.3 MB │ 11.5 MB │ 11.8 MB │ 11.5 MB   │ 139 kB │ 11.3 MB │
    └───────────┴─────────┴─────────┴─────────┴─────────┴───────────┴────────┴─────────┘

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

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

    417k requests in 15.01s, 172 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 1 ms · p99 2 ms · 7,548

50 connectionsp50 4 ms · p99 10 ms · 10,582

100 connectionsp50 8 ms · p99 21 ms · 10,818

250 connectionsp50 22 ms · p99 36 ms · 10,841

500 connectionsp50 47 ms · p99 61 ms · 10,378

1,000 connectionsp50 97 ms · p99 111 ms · 10,268

| Connections | Requests / second | p50 | p99 | Max | Errors | Server busy | API Maker RSS |
|--:|--:|--:|--:|--:|--:|--:|--:|
| 10 | **7,548** | 1 ms | 2 ms | 7 ms | 0 | 73 % | 134 MB |
| 50 | **10,582** | 4 ms | 10 ms | 21 ms | 0 | 95 % | 137 MB |
| 100 | **10,818** | 8 ms | 21 ms | 61 ms | 0 | 98 % | 142 MB |
| 250 | **10,841** | 22 ms | 36 ms | 72 ms | 0 | 98 % | 155 MB |
| 500 | **10,378** | 47 ms | 61 ms | 90 ms | 0 | 98 % | 170 MB |
| 1,000 | **10,268** | 97 ms | 111 ms | 139 ms | 0 | 98 % | 203 MB |

### Get by id with caching, public, by connections

**Get by id with caching, public, MongoDB : requests per second by connections**

10 connectionsp50 0 ms · p99 0 ms · 16,350

50 connectionsp50 1 ms · p99 2 ms · 38,344

100 connectionsp50 2 ms · p99 3 ms · 42,203

250 connectionsp50 5 ms · p99 9 ms · 44,362

500 connectionsp50 11 ms · p99 15 ms · 43,359

1,000 connectionsp50 22 ms · p99 26 ms · 45,183

| Connections | Requests / second | p50 | p99 | Max | Errors | Server busy | API Maker RSS |
|--:|--:|--:|--:|--:|--:|--:|--:|
| 10 | **16,350** | 0 ms | 0 ms | 4 ms | 0 | 55 % | 139 MB |
| 50 | **38,344** | 1 ms | 2 ms | 6 ms | 0 | 85 % | 139 MB |
| 100 | **42,203** | 2 ms | 3 ms | 10 ms | 0 | 85 % | 143 MB |
| 250 | **44,362** | 5 ms | 9 ms | 27 ms | 0 | 87 % | 155 MB |
| 500 | **43,359** | 11 ms | 15 ms | 34 ms | 0 | 87 % | 164 MB |
| 1,000 | **45,183** | 22 ms | 26 ms | 52 ms | 0 | 87 % | 193 MB |

## Questions

### How many requests per second can API Maker serve on 8 shared vCPUs ?

On this 32 GB server, with the database on the same machine : 11,002 requests per second for a whole table of ten rows on MongoDB (PostgreSQL 13,054 · MySQL 13,816), 12,297 for one row by its id, and 44,564 when the answer is cached in Redis. A custom API in TypeScript which reads the table answers 8,062 requests per second when API Maker runs it itself (lean code), 7,636 when it runs in the sandbox of the account.

### How much memory does API Maker use ?

The API Maker process held 112 MB at rest and 154 MB at most under load on this server, in RAM. The rest of the memory went to the databases (MongoDB, Redis, PostgreSQL or MySQL), the sandboxes which run the code of the account, and Linux itself.

### Do the two tokens slow the APIs down ?

API Maker checks both tokens (x-am-authorization and x-am-user-authorization) and the groups of the API user on every request. Get all with both tokens answered 11,882 requests per second on MongoDB (public : 11,002), 12,013 requests per second on PostgreSQL (public : 13,054), 12,645 requests per second on MySQL (public : 13,816). The checks show most where the database does no work : a cached get all answered 34,364 requests per second with both tokens against 41,093 public on MongoDB.

### What does a pre hook cost ?

A pre hook runs code of the account before the API ; a lean hook like this one runs in the server itself, with QuickJS. Get all with a row scoping pre hook answered 8,512 requests per second on MongoDB, against 11,882 for the same API without the hook. On 8 vCPUs, the API, the hook and the database share the same 8 vCPUs.

### Can I run these benchmarks myself ?

Yes : [How API Maker is benchmarked](https://docs.apimaker.dev/v4/docs/benchmarks/methodology.html) gives the dataset, the settings of every API and the exact autocannon commands.
