Hardware Requirements: Difference between revisions

From MemCP
Jump to navigation Jump to search
(Refresh MemCP documentation: accuracy, operational guidance, performance profile and maintained API reference)
 
Line 1: Line 1:
MemCP can run on any hardware that is supported by the <code>go</code> compiler.
<!-- Copyright (C) 2026 Carl-Philip Haensch -->


To find the right hardware dimensions, you need to consider the following:
<!-- SPDX-License-Identifier: GPL-3.0-or-later -->


* The process itself needs at least 8 MiB of RAM
<span id="hardware-requirements"></span>
* The size of a 5 GiB MySQL database fits into ~1 GiB of RAM
= Hardware Requirements =
* To have a decent working set, take the RAM requirements x3, so a 5 GiB MySQL database should run on 3 GiB RAM
* MemCP needs at least 1 CPU core, more is better ;)


== Running on Big SMP Machines ==
MemCP requires a platform supported by Go 1.24. The native JIT currently targets x86-64; the interpreter remains the compatibility path where JIT emission is not available.
MemCP runs best on machiens that have a lot of RAM and CPU cores.


We tested on:
Capacity depends on compressed column size, hot working set, indexes, delta volume, query intermediates, concurrency, durability mode, and background rebuilds. Do not size RAM from raw MySQL disk size alone.


* AMD Ryzen (in various forms)
By default the overall cache budget is 50% of physical RAM and the reloadable persisted-data budget is 30%; exact byte overrides are available. Leave memory for the operating system, filesystem/object-store clients, connections, query work, and colocated services. MemCP also responds to system-wide memory pressure.
* HPE Superfome Flex (https://www.hpe.com/us/en/servers/superdome.html)


=== Micro-Benchmark ===
Fast local storage improves cold-column reload, WAL, rebuild, import, and restart time. <code>safe</code> durability latency depends heavily on fsync behavior. S3 and Ceph add network and service latency. More CPU cores help independent shards and branches, but memory bandwidth, selectivity, shard count, and nested fanout limit scaling.
This is measured on AMD Ryzen 9 7900X3D 12-Core Processor over a Gigabit connection:
'''~'''$ ab -n 1000000 -c 1000 '<nowiki>http://192.168.178.108:4321/sql/test/select%20*%20from%20a'</nowiki>
This is ApacheBench, Version 2.3 <$Revision: 1879490 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, <nowiki>http://www.zeustech.net/</nowiki>
Licensed to The Apache Software Foundation, <nowiki>http://www.apache.org/</nowiki>
Benchmarking 192.168.178.108 (be patient)
Completed 100000 requests
Completed 200000 requests
Completed 300000 requests
Completed 400000 requests
Completed 500000 requests
Completed 600000 requests
Completed 700000 requests
Completed 800000 requests
Completed 900000 requests
Completed 1000000 requests
Finished 1000000 requests
Server Software:       
Server Hostname:        192.168.178.108
Server Port:            4321
Document Path:          /sql/test/select%20*%20from%20a
Document Length:        12 bytes
Concurrency Level:      1000
Time taken for tests:  48.842 seconds
Complete requests:      1000000
Failed requests:        0
Non-2xx responses:      1000000
Total transferred:      180000000 bytes
HTML transferred:      12000000 bytes
Requests per second:    20474.09 [#/sec] (mean)
Time per request:      48.842 [ms] (mean)
Time per request:      0.049 [ms] (mean, across all concurrent requests)
Transfer rate:          3598.96 [Kbytes/sec] received
Connection Times (ms)
              min  mean[+/-sd] median  max
Connect:        0  11  6.0    11      32
Processing:    0  38  21.3    33    279
Waiting:        0  33  21.9    27    278
Total:          0  49  21.0    46    287
Percentage of the requests served within a certain time (ms)
  50%    46
  66%    52
  75%    57
  80%    61
  90%    73
  95%    87
  98%    107
  99%    122
  100%    287 (longest request)


== Running on Raspberry Pi ==
Published hardware claims must follow [[Performance_Measurement|Performance Measurement]]. Historical benchmarks that returned only HTTP 401/non-2xx responses are not SQL throughput measurements. They are retained below as raw project history, explicitly separated from product evidence.
These are our recommendations to run MemCP on Raspberry Pi:


* Avoid <code>ENGINE=safe</code>. To have a long life for your flash drive, you should choose <code>ENGINE=sloppy</code>. (<code>ENGINE=logging</code> would be a compromise between <code>safe</code> and <code>sloppy</code>) - for more information see [[Persistency and Performance Guarantees]]
== Capacity-planning procedure ==
* Raspberry Pis have very limited RAM. In most cases, the RAM is sufficient though since most databases only take a few megabytes of RAM. For bigger data, you should wait for MMaped shards, see also: [[Current Status and open issues]]


=== Micro-Benchmark ===
# Import or generate a representative dataset rather than extrapolating only from source database files.
# Run the real query/write mix long enough to create normal shards, compression formats, indexes, and caches.
# Record resident bytes, persisted bytes, index/computed-column memory, delta growth, peak query memory, and cold-reload latency.
# Exercise concurrent users, rebuilds, backups, and remote-backend outages.
# Restart and measure WAL replay/reload time; verify results after recovery.
# Add growth and failure headroom before selecting production limits.


==== Raspberry Pi 3 ====
== Platform profiles ==
Here's a micro benchmark for putting HTTP load on memcp on Raspberry Pi 3: behind a 100 MBit/s ethernet. The request is a rather simple one.
$ ab -n 1000000 -c 1000 '<nowiki>http://192.168.178.73:4321/sql/test/select%20*%20from%20a'</nowiki>
This is ApacheBench, Version 2.3 <$Revision: 1879490 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, <nowiki>http://www.zeustech.net/</nowiki>
Licensed to The Apache Software Foundation, <nowiki>http://www.apache.org/</nowiki>
Benchmarking 192.168.178.73 (be patient)
Completed 100000 requests
Completed 200000 requests
Completed 300000 requests
Completed 400000 requests
Completed 500000 requests
Completed 600000 requests
Completed 700000 requests
Completed 800000 requests
Completed 900000 requests
Completed 1000000 requests
Finished 1000000 requests
Server Software:       
Server Hostname:        192.168.178.73
Server Port:            4321
Document Path:          /sql/test/select%20*%20from%20a
Document Length:        12 bytes
Concurrency Level:      1000
Time taken for tests:  1079.876 seconds
Complete requests:      1000000
Failed requests:        0
Non-2xx responses:      1000000
Total transferred:      180000000 bytes
HTML transferred:      12000000 bytes
Requests per second:    926.03 [#/sec] (mean)
Time per request:      1079.876 [ms] (mean)
Time per request:      1.080 [ms] (mean, across all concurrent requests)
Transfer rate:          162.78 [Kbytes/sec] received
Connection Times (ms)
              min  mean[+/-sd] median  max
Connect:        1  346 404.9    239    7464
Processing:    3  733 574.8    523    8723
Waiting:        3  728 573.5    518    8723
Total:          4 1079 685.0    818    9758
Percentage of the requests served within a certain time (ms)
  50%    818
  66%  1195
  75%  1489
  80%  1612
  90%  1956
  95%  2425
  98%  2920
  99%  3348
  100%  9758 (longest request)
Raspberry Pi manages to do about 1,000 requests per second while modern x86_64 computers are able to serve 12,000 requests and more.


==== Raspberry Pi 4 ====
Small x86-64 or ARM systems can run the interpreter and are useful for development, edge workloads, or reconstructible datasets, but available RAM and storage endurance usually dominate. Server-class x86-64 systems can use the native JIT and more parallel shards; prefer balanced memory channels and NUMA-aware capacity over core count alone. Fast NVMe matters for <code>safe</code> commit latency, cold reload, and rebuild throughput, while S3/Ceph deployments depend on network consistency and backend service limits.
Disclaimer: Those two benchmarks are not comparable. The Raspi 3 benchmark requested a 401 page while this benchmark logs into a database and does a minimal query:
 
$ ab -n 10000 -c 600 -A root:admin '<nowiki>http://192.168.178.189:4321/sql/oppelbi/select%201'</nowiki>
MemCP has historically been exercised on AMD Ryzen systems, HPE Superdome-class SMP hardware and Raspberry Pi 3/4 devices. That breadth illustrates the portability goal, not a current certification matrix. Raspberry Pi deployments should account for limited RAM, slower storage and flash endurance. For reconstructible data, <code>sloppy</code>'s normally 15-minute compressed rebuild cycle avoids a continuously synchronized WAL stream and can reduce SD-card write amplification. Irreplaceable data must remain on <code>safe</code> storage; use more durable media rather than weakening its guarantee merely to protect an SD card.
This is ApacheBench, Version 2.3 <$Revision: 1879490 $>
 
Copyright 1996 Adam Twiss, Zeus Technology Ltd, <nowiki>http://www.zeustech.net/</nowiki>
== Historical measurements ==
Licensed to The Apache Software Foundation, <nowiki>http://www.apache.org/</nowiki>
 
Earlier wiki revisions published the following ApacheBench runs. They used different hosts, networks, authentication and query paths, so they cannot be compared with one another.
Benchmarking 192.168.178.189 (be patient)
 
Completed 1000 requests
The same revisions described an approximately 8 MiB base process and suggested that one particular 5 GiB MySQL dataset compressed to roughly 1 GiB, then multiplied that by three for working-set headroom. Those figures are retained as the origin of the old sizing advice, not as general requirements: process/runtime size has changed and MySQL disk bytes do not predict MemCP RAM without schema, cardinality, indexes, delta state and query intermediates.
Completed 2000 requests
 
Completed 3000 requests
{| class="wikitable" style="width:100%;"
Completed 4000 requests
! Host/run !! Command and result !! Latency percentiles (ms)
Completed 5000 requests
|-
Completed 6000 requests
| AMD Ryzen 9 7900X3D, Gigabit network
Completed 7000 requests
| <code>ab -n 1000000 -c 1000 http://192.168.178.108:4321/sql/test/select%20*%20from%20a</code><br />48.842 s; 20,474.09 requests/s; '''1,000,000 non-2xx responses'''; 12-byte bodies
Completed 8000 requests
| p50 46; p66 52; p75 57; p80 61; p90 73; p95 87; p98 107; p99 122; max 287
Completed 9000 requests
|-
Completed 10000 requests
| Raspberry Pi 3, 100 Mbit/s network
Finished 10000 requests
| <code>ab -n 1000000 -c 1000 http://192.168.178.73:4321/sql/test/select%20*%20from%20a</code><br />1,079.876 s; 926.03 requests/s; '''1,000,000 non-2xx responses'''; 12-byte bodies
| p50 818; p66 1,195; p75 1,489; p80 1,612; p90 1,956; p95 2,425; p98 2,920; p99 3,348; max 9,758
|-
Server Software:      
| Raspberry Pi 4, authenticated <code>SELECT 1</code>
Server Hostname:       192.168.178.189
| <code>ab -n 10000 -c 600 -A root:admin http://192.168.178.189:4321/sql/oppelbi/select%201</code><br />23.173 s; 431.54 requests/s; zero failed requests; 9-byte bodies
Server Port:           4321
| p50 1,110; p66 1,572; p75 1,902; p80 2,143; p90 2,847; p95 3,511; p98 4,329; p99 4,866; max 8,908
|}
Document Path:          /sql/oppelbi/select%201
 
Document Length:        9 bytes
The Ryzen and Raspberry Pi 3 runs measured fast error handling, not SQL execution. The Raspberry Pi 4 run authenticated and executed a minimal query, but still lacks commit/build, server CPU and memory samples, warm-up policy and repeated trials. The old claim that Raspberry Pi handled roughly 1,000 requests/s and x86-64 12,000 or more therefore cannot be used as a current cross-platform comparison.
 
Concurrency Level:      600
The project still aims for high throughput on both compact edge systems and large multicore machines. Reproduce that claim with a successful authenticated workload, current commit, full command, raw samples and CPU/memory/storage context as described in [[Performance Measurement]].
Time taken for tests:  23.173 seconds
 
Complete requests:      10000
There is no fixed minimum row count or universal “cores per table” rule. For a tiny workload, scheduling parallel work can cost more than it saves; for a bandwidth-bound scan, extra cores stop helping before CPU is exhausted.
Failed requests:        0
Total transferred:      1100000 bytes
HTML transferred:      90000 bytes
Requests per second:    431.54 [#/sec] (mean)
Time per request:      1390.375 [ms] (mean)
Time per request:      2.317 [ms] (mean, across all concurrent requests)
Transfer rate:          46.36 [Kbytes/sec] received
Connection Times (ms)
              min  mean[+/-sd] median  max
Connect:        0    3  32.8      1   1024
Processing:    7 1350 1101.9  1109    8906
Waiting:        7 1348 1101.4  1106    8906
Total:          8 1353 1102.9  1110    8908
Percentage of the requests served within a certain time (ms)
  50%  1110
  66%  1572
  75%  1902
  80%  2143
  90%  2847
  95%  3511
  98%  4329
  99%  4866
  100%  8908 (longest request)

Latest revision as of 11:59, 28 August 2026


Hardware Requirements

MemCP requires a platform supported by Go 1.24. The native JIT currently targets x86-64; the interpreter remains the compatibility path where JIT emission is not available.

Capacity depends on compressed column size, hot working set, indexes, delta volume, query intermediates, concurrency, durability mode, and background rebuilds. Do not size RAM from raw MySQL disk size alone.

By default the overall cache budget is 50% of physical RAM and the reloadable persisted-data budget is 30%; exact byte overrides are available. Leave memory for the operating system, filesystem/object-store clients, connections, query work, and colocated services. MemCP also responds to system-wide memory pressure.

Fast local storage improves cold-column reload, WAL, rebuild, import, and restart time. safe durability latency depends heavily on fsync behavior. S3 and Ceph add network and service latency. More CPU cores help independent shards and branches, but memory bandwidth, selectivity, shard count, and nested fanout limit scaling.

Published hardware claims must follow Performance Measurement. Historical benchmarks that returned only HTTP 401/non-2xx responses are not SQL throughput measurements. They are retained below as raw project history, explicitly separated from product evidence.

Capacity-planning procedure

  1. Import or generate a representative dataset rather than extrapolating only from source database files.
  2. Run the real query/write mix long enough to create normal shards, compression formats, indexes, and caches.
  3. Record resident bytes, persisted bytes, index/computed-column memory, delta growth, peak query memory, and cold-reload latency.
  4. Exercise concurrent users, rebuilds, backups, and remote-backend outages.
  5. Restart and measure WAL replay/reload time; verify results after recovery.
  6. Add growth and failure headroom before selecting production limits.

Platform profiles

Small x86-64 or ARM systems can run the interpreter and are useful for development, edge workloads, or reconstructible datasets, but available RAM and storage endurance usually dominate. Server-class x86-64 systems can use the native JIT and more parallel shards; prefer balanced memory channels and NUMA-aware capacity over core count alone. Fast NVMe matters for safe commit latency, cold reload, and rebuild throughput, while S3/Ceph deployments depend on network consistency and backend service limits.

MemCP has historically been exercised on AMD Ryzen systems, HPE Superdome-class SMP hardware and Raspberry Pi 3/4 devices. That breadth illustrates the portability goal, not a current certification matrix. Raspberry Pi deployments should account for limited RAM, slower storage and flash endurance. For reconstructible data, sloppy's normally 15-minute compressed rebuild cycle avoids a continuously synchronized WAL stream and can reduce SD-card write amplification. Irreplaceable data must remain on safe storage; use more durable media rather than weakening its guarantee merely to protect an SD card.

Historical measurements

Earlier wiki revisions published the following ApacheBench runs. They used different hosts, networks, authentication and query paths, so they cannot be compared with one another.

The same revisions described an approximately 8 MiB base process and suggested that one particular 5 GiB MySQL dataset compressed to roughly 1 GiB, then multiplied that by three for working-set headroom. Those figures are retained as the origin of the old sizing advice, not as general requirements: process/runtime size has changed and MySQL disk bytes do not predict MemCP RAM without schema, cardinality, indexes, delta state and query intermediates.

Host/run Command and result Latency percentiles (ms)
AMD Ryzen 9 7900X3D, Gigabit network ab -n 1000000 -c 1000 http://192.168.178.108:4321/sql/test/select%20*%20from%20a
48.842 s; 20,474.09 requests/s; 1,000,000 non-2xx responses; 12-byte bodies
p50 46; p66 52; p75 57; p80 61; p90 73; p95 87; p98 107; p99 122; max 287
Raspberry Pi 3, 100 Mbit/s network ab -n 1000000 -c 1000 http://192.168.178.73:4321/sql/test/select%20*%20from%20a
1,079.876 s; 926.03 requests/s; 1,000,000 non-2xx responses; 12-byte bodies
p50 818; p66 1,195; p75 1,489; p80 1,612; p90 1,956; p95 2,425; p98 2,920; p99 3,348; max 9,758
Raspberry Pi 4, authenticated SELECT 1 ab -n 10000 -c 600 -A root:admin http://192.168.178.189:4321/sql/oppelbi/select%201
23.173 s; 431.54 requests/s; zero failed requests; 9-byte bodies
p50 1,110; p66 1,572; p75 1,902; p80 2,143; p90 2,847; p95 3,511; p98 4,329; p99 4,866; max 8,908

The Ryzen and Raspberry Pi 3 runs measured fast error handling, not SQL execution. The Raspberry Pi 4 run authenticated and executed a minimal query, but still lacks commit/build, server CPU and memory samples, warm-up policy and repeated trials. The old claim that Raspberry Pi handled roughly 1,000 requests/s and x86-64 12,000 or more therefore cannot be used as a current cross-platform comparison.

The project still aims for high throughput on both compact edge systems and large multicore machines. Reproduce that claim with a successful authenticated workload, current commit, full command, raw samples and CPU/memory/storage context as described in Performance Measurement.

There is no fixed minimum row count or universal “cores per table” rule. For a tiny workload, scheduling parallel work can cost more than it saves; for a bandwidth-bound scan, extra cores stop helping before CPU is exhausted.