-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
bloxster
committed
Oct 5, 2024
1 parent
ab90772
commit fa72860
Showing
10 changed files
with
147 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Caplin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Performance Tricks | ||
|
||
|
||
These instructions are designed to improve the performance of Erigon 3, particularly for synchronization and memory management, on cloud drives and other systems with specific performance characteristics. | ||
|
||
|
||
## Increase Sync Speed | ||
|
||
* Set `--sync.loop.block.limit=10_000` and `--batchSize=2g` to speed up the synchronization process. | ||
```bash | ||
--sync.loop.block.limit=10_000 --batchSize=2g | ||
``` | ||
|
||
## Optimize for Cloud Drives | ||
|
||
* Set `SNAPSHOT_MADV_RND=false` to enable the operating system's cache prefetching for better performance on cloud drives with good throughput but bad latency. | ||
```bash | ||
SNAPSHOT_MADV_RND=false | ||
``` | ||
|
||
## Lock Latest State in RAM | ||
|
||
* Use `vmtouch -vdlw /mnt/erigon/snapshots/domain/*bt` to lock the latest state in RAM, preventing it from being evicted due to high historical RPC traffic. | ||
```bash | ||
vmtouch -vdlw /mnt/erigon/snapshots/domain/*bt | ||
``` | ||
|
||
* Run `ls /mnt/erigon/snapshots/domain/*.kv | parallel vmtouch -vdlw` to apply the same locking to all relevant files. | ||
|
||
## Handle Memory Allocation Issues | ||
|
||
* If you encounter issues with memory allocation, run the following to flush any pending write operations and free up memory: | ||
```bash | ||
sync && sudo sysctl vm.drop_caches=3 | ||
``` | ||
|
||
* Alternatively, set: | ||
|
||
```bash | ||
echo 1 > /proc/sys/vm/compact_memory | ||
``` | ||
|
||
to help with memory allocation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,61 @@ | ||
# Default Ports and Firewalls | ||
|
||
Erigon Ports | ||
------------- | ||
|
||
| Component | Port | Protocol | Purpose | Should Expose | | ||
| --------- | ---- | -------- | ------- | -------------- | | ||
| Engine | 9090 | TCP | gRPC Server | Private | | ||
| Engine | 42069 | TCP & UDP | Snap sync (Bittorrent) | Public | | ||
| Engine | 8551 | TCP | Engine API (JWT auth) | Private | | ||
| Sentry | 30303 | TCP & UDP | eth/68 peering | Public | | ||
| Sentry | 30304 | TCP & UDP | eth/67 peering | Public | | ||
| Sentry | 9091 | TCP | incoming gRPC Connections | Private | | ||
| RPCdaemon | 8545 | TCP | HTTP & WebSockets & GraphQL | Private | | ||
| Diagnostics | 8080 | TCP & UDP| Diagnostic Tool | Private | | ||
|
||
Caplin ports | ||
------------ | ||
|
||
| Component | Port | Protocol | Purpose | Should Expose | | ||
| --------- | ---- | -------- | ------- | -------------- | | ||
| Sentinel | 4000 | UDP | Peering | Public | | ||
| Sentinel | 4001 | TCP | Peering | Public | | ||
|
||
Shared ports | ||
------------ | ||
|
||
| Component | Port | Protocol | Purpose | Should Expose | | ||
| --------- | ---- | -------- | ------- | -------------- | | ||
| All | 6060 | TCP | pprof | Private | | ||
| All | 6060 | TCP | metrics | Private | | ||
|
||
Optional flags can be enabled that enable pprof or metrics (or both) - however, they both run on 6060 by default, so you'll have to change one if you want to run both at the same time. | ||
|
||
Other ports | ||
------------ | ||
|
||
* gRPC ports: 9092 consensus engine, 9093 snapshot downloader, 9094 TxPool | ||
|
||
Hetzner firewall rules | ||
---------------------- | ||
|
||
* `0.0.0.0/8`: "This" Network (RFC 1122, Section 3.2.1.3) | ||
* `10.0.0.0/8`: Private-Use Networks (RFC 1918) | ||
* `100.64.0.0/10`: Carrier-Grade NAT (CGN) (RFC 6598, Section 7) | ||
* `127.16.0.0/12`: Private-Use Networks (RFC 1918) | ||
* `169.254.0.0/16`: Link Local (RFC 3927) | ||
* `172.16.0.0/12`: Private-Use Networks (RFC 1918) | ||
* `192.0.0.0/24`: IETF Protocol Assignments (RFC 5736) | ||
* `192.0.2.0/24`: TEST-NET-1 (RFC 5737) | ||
* `192.88.99.0/24`: 6to4 Relay Anycast (RFC 3068) | ||
* `192.168.0.0/16`: Private-Use Networks (RFC 1918) | ||
* `198.18.0.0/15`: Network Interconnect Device Benchmark Testing (RFC 2544) | ||
* `198.51.100.0/24`: TEST-NET-2 (RFC 5737) | ||
* `203.0.113.0/24`: TEST-NET-3 (RFC 5737) | ||
* `224.0.0.0/4`: Multicast (RFC 3171) | ||
* `240.0.0.0/4`: Reserved for Future Use (RFC 1112, Section 4) | ||
* `255.255.255.255/32`: Limited Broadcast (RFC 919, Section 7) | ||
* `255.255.255.255/32`: RFC 922, Section 7 | ||
|
||
Same in [IpTables](https://ethereum.stackexchange.com/questions/6386/how-to-prevent-being-blacklisted-for-running-an-ethereum-client/13068#13068) syntax. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Tips for faster syncing | ||
|
||
* **Optimize for Low Latency**: Use a machine with low latency (not throughput) disk and RAM for faster initial sync. | ||
* **Memory Optimized Nodes**: Consider using memory-optimized nodes for faster sync, such as *AWS EC2 r5* or *r6* series instances. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters