Skip to content

Commit

Permalink
Syncing local with upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
0x19 committed Sep 16, 2024
1 parent 8319eb8 commit 0880207
Show file tree
Hide file tree
Showing 49 changed files with 3,010 additions and 623 deletions.
Empty file added Dockerfile
Empty file.
81 changes: 61 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ sysctl -w net.core.rmem_max=7500000
sysctl -w net.core.wmem_max=7500000
```

## TODO

- Due to changes in the entire logic now unit tests are broken.

## IDEAS

- P2P Sync... (Supervisors vs. Readers a.k.a. validators vs clients)
Expand All @@ -107,13 +111,13 @@ sysctl -w net.core.wmem_max=7500000
### Certificates and co.

```
make build && ./build/fdb certs --cert-output=./data/certs/cert.pem --key-output=./data/certs/key.pem
make build && ./build/fdb certs --cert=./data/certs/cert.pem --key=./data/certs/key.pem
```

### Benchmark

```
make build && ./build/fdb benchmark --suite-type quic --clients=1 --messages=1000
make build && ./build/fdb benchmark --suite quic --clients 5 --messages 1000 --type write
```

## Benchmarks
Expand All @@ -123,10 +127,6 @@ use that one as a baseline for any other benchmark.

```
make build && ./build/fdb benchmark --suite-type dummy
Starting benchmark...
Dummy server started successfully
2024/09/16 09:26:54 UDS Server started on udp://127.0.0.1:4434
2024/09/16 09:26:54 Dummy Server is listening on 127.0.0.1:4434
--- Benchmark Report ---
Total Clients: 10
Expand All @@ -143,27 +143,68 @@ Dummy server stopped successfully

With 10 clients, throughput should be ~ *6,702,1269* m/s

### QUIC

### TCP


Write without ACK

```
make build && ./build/fdb benchmark --suite-type quic --clients=1 --messages=1000
Starting benchmark...
2024/09/15 20:55:18 QUIC Server started on 127.0.0.1:4433
QUIC server started successfully
--- Benchmark Report ---
Total Clients: 50
Messages per Client: 1000000
Total Messages: 50000000
Success Messages: 50000000
Failed Messages: 0
Total Duration: 7.17357253s
Average Latency: 3.358µs
P50 Latency: 2.42µs
P90 Latency: 2.77µs
P99 Latency: 6.5µs
Throughput: 6,970,027 messages/second
Memory Used: 10.20 MB
Latency Jitter (StdDev): 30.940890µs
```

With ACK

```
--- Benchmark Report ---
Total Clients: 0
Total Messages: 1000
Success Messages: 1000
Total Clients: 50
Messages per Client: 200000
Total Messages: 10000000
Success Messages: 10000000
Failed Messages: 0
Total Duration: 3.135008519s
Average Latency: 3.130208ms
Throughput: 318.98 messages/second
Memory Used: 0 bytes
QUIC server stopped successfully
Total Duration: 17.935868899s
Average Latency: 83.1µs
P50 Latency: 64.572µs
P90 Latency: 122.153µs
P99 Latency: 304.218µs
Throughput: 557,541 messages/second
Memory Used: 667.91 MB
Latency Jitter (StdDev): 148.417551µs
```

### QUIC

```
make build && ./build/fdb benchmark --suite quic --clients 50 --messages 100000 --type write --timeout 120
^ This piece of shit is slow as you can see but at least came to the point where I can start doing optimizations.
--- Benchmark Report ---
Total Clients: 50
Messages per Client: 100000
Total Messages: 5000000
Success Messages: 5000000
Failed Messages: 0
Total Duration: 54.655111416s
Average Latency: 543.478µs
P50 Latency: 521.064µs
P90 Latency: 945.644µs
P99 Latency: 1.603621ms
Throughput: 91,482 messages/second
Memory Used: 17260.96 MB
Latency Jitter (StdDev): 319.379812µs
```

## For Developers

Expand Down
47 changes: 47 additions & 0 deletions benchmark.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
logger:
enabled: true
environment: development
level: debug

mdbx:
enabled: true
nodes:
- name: benchmark
path: /tmp/
maxReaders: 4096
maxSize: 1024 # Maximum database size (1 TB)
minSize: 1 # Minimum database size (1 MB)
growthStep: 4096 # Growth step size (4 KB)
filePermissions: 0600 # File permissions for the database

transports:
- type: dummy
enabled: true
config:
ipv4: 127.0.0.1
port: 4434

- type: quic
enabled: true
config:
ipv4: 127.0.0.1
port: 4433
tls:
insecure: true
key: ./data/certs/key.pem
cert: ./data/certs/cert.pem

- type: uds
enabled: true
config:
socket: "/tmp/fdb.sock"

- type: tcp
enabled: true
config:
ipv4: 127.0.0.1
port: 5011
tls:
insecure: true
key: ./data/certs/key.pem
cert: ./data/certs/cert.pem
Loading

0 comments on commit 0880207

Please sign in to comment.