mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-21 05:44:44 +00:00
Conserve disk space by raising default SPRP (#3137)
## Proposed Changes Increase the default `--slots-per-restore-point` to 8192 for a 4x reduction in freezer DB disk usage. Existing nodes that use the previous default of 2048 will be left unchanged. Newly synced nodes (with or without checkpoint sync) will use the new 8192 default. Long-term we could do away with the freezer DB entirely for validator-only nodes, but this change is much simpler and grants us some extra space in the short term. We can also roll it out gradually across our nodes by purging databases one by one, while keeping the Ansible config the same. ## Additional Info We ignore a change from 2048 to 8192 if the user hasn't set the 8192 explicitly. We fire a debug log in the case where we do ignore: ``` DEBG Ignoring slots-per-restore-point config in favour of on-disk value, on_disk: 2048, config: 8192 ```
This commit is contained in:
@@ -23,27 +23,39 @@ states to slow down dramatically. A lower _slots per restore point_ value (SPRP)
|
||||
frequent restore points, while a higher SPRP corresponds to less frequent. The table below shows
|
||||
some example values.
|
||||
|
||||
| Use Case | SPRP | Yearly Disk Usage | Load Historical State |
|
||||
| ---------------------- | -------------- | ----------------- | --------------------- |
|
||||
| Block explorer/analysis | 32 | 1.4 TB | 155 ms |
|
||||
| Default | 2048 | 23.1 GB | 10.2 s |
|
||||
| Validator only | 8192 | 5.7 GB | 41 s |
|
||||
| Use Case | SPRP | Yearly Disk Usage | Load Historical State |
|
||||
| ---------------------- | -------------- | ----------------- | --------------------- |
|
||||
| Block explorer/analysis | 32 | 1.4 TB | 155 ms |
|
||||
| Hobbyist (prev. default) | 2048 | 23.1 GB | 10.2 s |
|
||||
| Validator only (default) | 8192 | 5.7 GB | 41 s |
|
||||
|
||||
As you can see, it's a high-stakes trade-off! The relationships to disk usage and historical state
|
||||
load time are both linear – doubling SPRP halves disk usage and doubles load time. The minimum SPRP
|
||||
is 32, and the maximum is 8192.
|
||||
|
||||
The default value is 8192 for databases synced from scratch using Lighthouse v2.2.0 or later, or
|
||||
2048 for prior versions. Please see the section on [Defaults](#defaults) below.
|
||||
|
||||
The values shown in the table are approximate, calculated using a simple heuristic: each
|
||||
`BeaconState` consumes around 18MB of disk space, and each block replayed takes around 5ms. The
|
||||
**Yearly Disk Usage** column shows the approx size of the freezer DB _alone_ (hot DB not included),
|
||||
and the **Load Historical State** time is the worst-case load time for a state in the last slot
|
||||
before a restore point.
|
||||
|
||||
### Defaults
|
||||
|
||||
As of Lighthouse v2.2.0, the default slots-per-restore-point value has been increased from 2048
|
||||
to 8192 in order to conserve disk space. Existing nodes will continue to use SPRP=2048 unless
|
||||
re-synced. Note that it is currently not possible to change the SPRP without re-syncing, although
|
||||
fast re-syncing may be achieved with [Checkpoint Sync](./checkpoint-sync.md).
|
||||
|
||||
### CLI Configuration
|
||||
|
||||
To configure your Lighthouse node's database with a non-default SPRP, run your Beacon Node with
|
||||
the `--slots-per-restore-point` flag:
|
||||
|
||||
```bash
|
||||
lighthouse beacon_node --slots-per-restore-point 8192
|
||||
lighthouse beacon_node --slots-per-restore-point 32
|
||||
```
|
||||
|
||||
## Glossary
|
||||
|
||||
Reference in New Issue
Block a user