mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-26 14:45:50 +00:00
Merge pull request #476 from jhaaaa/hw-reqs
Improve documentation of rippled hardware requirements
This commit is contained in:
@@ -1,77 +1,114 @@
|
||||
# Capacity Planning
|
||||
|
||||
This section describes some of the challenges related to scaling `rippled` servers for testing and production deployments. Additionally, it describes how hardware and configuration settings relate to those challenges. Finally, this section offers recommendations to assist you in properly setting up `rippled` to meet the goals for the use case of your deployment.
|
||||
This section describes configuration, network, and hardware recommendations that you can use to tune and optimize the performance of your `rippled` server. Being aware of these considerations can help you ensure that your `rippled` server is ready to handle XRP Ledger network capacity today and in the near future.
|
||||
|
||||
Even the most minimally functional `rippled` server must contain the most recently validated ledger versions to submit transactions to the network and verify the integrity of the XRP Ledger. Beyond these requirements, consider the following possible business needs:
|
||||
|
||||
- Handling ever-increasing transaction volume
|
||||
- Servicing transaction reporting information to clients
|
||||
- Maintaining varying amounts of historical data
|
||||
|
||||
To meet your `rippled` capacity requirements, you must address these technical factors:
|
||||
|
||||
- The [configuration settings](#configuration-settings) that affect resource utilization
|
||||
- The [network and hardware](#network-and-hardware) requirements to achieve consistent, good performance across the XRP Ledger network
|
||||
|
||||
## Configuration Settings
|
||||
|
||||
Ripple recommends the following guidelines to improve performance. You can set the following parameters in the `rippled.cfg` file to improve performance for your `rippled` server.
|
||||
Ripple recommends using these configuration guidelines to optimize resource utilization and performance of your `rippled` server.
|
||||
|
||||
You can set the following parameters in the `rippled.cfg` file used for your `rippled` server. You can access an example configuration file, `rippled-example.cfg`, in the [`cfg` directory](https://github.com/ripple/rippled/blob/develop/cfg/rippled-example.cfg) in the `rippled` GitHub repo.
|
||||
|
||||
|
||||
### Node Size
|
||||
|
||||
The `node_size` parameter determines the size of database caches. Larger database caches decrease disk I/O requirements at a cost of higher memory requirements. Ripple recommends you always use the largest database cache your available memory can support. See the following table for recommended settings.
|
||||
Set the `node_size` based on your server's expected load and the amount of memory you can make available to `rippled`.
|
||||
|
||||
Ripple recommends you always use the largest node size your available RAM can support. See the following table for recommended settings.
|
||||
|
||||
#### Recommendation
|
||||
|
||||
| Available RAM for `rippled` | `node_size` value | Notes |
|
||||
|:----------------------------|:------------------|:-----------------------------------|
|
||||
| < 8GB | `tiny` | Not recommended |
|
||||
| 8GB | `small` | |
|
||||
| 16GB | `medium` | |
|
||||
| 32GB | `huge` | Recommended for production servers |
|
||||
Each `node_size` has a corresponding requirement for available RAM. For example, if you set `node_size` to `huge`, you should have at least 32GB of available RAM to help ensure that `rippled` can run smoothly.
|
||||
|
||||
To tune your server, it may be useful to start with `tiny` and increase the size to `small`, `medium`, and so on as you refine the requirements for your use case.
|
||||
|
||||
| RAM available for `rippled` | `node_size` value | Notes |
|
||||
|:----------------------------|:------------------|:---------------------------|
|
||||
| < 8GB | `tiny` | Not recommended for testing or production servers. This is the default value if you don't specify a value in `rippled.cfg`. |
|
||||
| 8GB | `small` | Recommended for test servers. |
|
||||
| 16GB | `medium` | The `rippled-example.cfg` file uses this value. |
|
||||
| 32GB | `huge` | Recommended for production servers. |
|
||||
|
||||
Although `large` is also a legal value for `[node_size]`, in practice it performs worse than `huge` in most circumstances. Ripple recommends always using `huge` instead of `large`.
|
||||
|
||||
If you set the `node_size` parameter to an invalid value, the [server fails to start](server-wont-start.html#bad-node-size-value).
|
||||
|
||||
|
||||
### Node DB Type
|
||||
|
||||
The `type` field in the `node_db` section of the `rippled.cfg` file sets the type of key-value store that `rippled` uses to persist the XRP Ledger in the ledger store. You can set the value to either `rocksdb` or `nudb`.
|
||||
The `type` field in the `[node_db]` stanza of the `rippled.cfg` file sets the type of key-value store that `rippled` uses to hold the ledger store.
|
||||
|
||||
`rippled` offers a history sharding feature that allows you to store a randomized range of ledgers in a separate shard store. You may want to configure the shard store to use a different type of key-value store than the ledger store. For more information about how to use this feature, see [History Sharding](https://ripple.com/build/history-sharding/#shard-store-configuration).
|
||||
This setting does not directly configure RAM settings, but the choice of key-value store has important implications for RAM usage because of the different ways these technologies cache and index data for fast lookup.
|
||||
|
||||
You can set the value to either `RocksDB` or `NuDB`.
|
||||
|
||||
#### RocksDB vs NuDB
|
||||
RocksDB requires approximately one-third less disk storage than NuDB and provides a corresponding improvement in I/O latency. However, this comes at a cost of increased memory utilization as storage size grows. NuDB, on the other hand, has nearly constant performance and memory footprint regardless of [storage](#storage).
|
||||
- If your server is a validator, it only needs a small amount of history, so use `RocksDB` for best performance. [Learn more](#more-about-using-rocksdb)
|
||||
|
||||
`rippled` servers that operate as validators should keep only a few days' worth of data or less. Ripple recommends using RocksDB for validators. For all other uses, Ripple recommends using NuDB for the ledger store.
|
||||
- For most cases, use `NuDB` because its performance is constant even with large amounts of data on disk. A fast SSD is required. [Learn more](#more-about-using-nudb)
|
||||
|
||||
RocksDB has performance-related configuration options you can modify to achieve maximum transaction processing throughput. (NuDB does not have performance-related configuration options.) Here is an example of the recommended configuration for a `rippled` server using RocksDB:
|
||||
- If you are using rotational disks (not recommended) or even just a slow SSD, use `RocksDB`. [Learn more](#more-about-using-rocksdb)
|
||||
|
||||
The example `rippled-example.cfg` file has the `type` field in the `[node_db]` stanza set to `RocksDB`.
|
||||
|
||||
#### More About Using RocksDB
|
||||
|
||||
[RocksDB](https://rocksdb.org/docs/getting-started.html) is an embeddable persistent key-value store that is optimized for rotational disks.
|
||||
|
||||
RocksDB requires approximately one-third less disk [storage](#storage) than NuDB and provides better I/O latency. However, the better I/O latency comes as result of the large amount of RAM RocksDB requires to store data indexes.
|
||||
|
||||
Validators should be configured to use RocksDB and to store no more than about 300,000 ledgers (approximately two weeks' worth of [historical data](#historical-data)) in the ledger store.
|
||||
|
||||
RocksDB has performance-related configuration options that you can set in `rippled.cfg` to achieve maximum transaction processing throughput. Here is the recommended configuration for a `rippled` server using RocksDB:
|
||||
|
||||
```
|
||||
[node_db]
|
||||
type=rocksdb
|
||||
type=RocksDB
|
||||
path={path_to_ledger_store}
|
||||
open_files=512
|
||||
file_size_mb=64
|
||||
file_size_mult=2
|
||||
filter_bits=12
|
||||
cache_mb=512
|
||||
path={path_to_ledger_store}
|
||||
file_size_mb=64
|
||||
file_size_mult=2
|
||||
```
|
||||
|
||||
#### More About Using NuDb
|
||||
|
||||
[NuDB](https://github.com/vinniefalco/nudb#introduction) is an append-only key-value store that is optimized for SSD drives.
|
||||
|
||||
NuDB has nearly constant performance and memory footprints regardless of the amount of data being [stored](#storage). NuDB _requires_ a solid-state drive, but uses much less RAM than RocksDB to access a large database.
|
||||
|
||||
Non-validator production servers should be configured to use NuDB and to store the amount of historical data required for the use case.
|
||||
|
||||
NuDB does not have performance-related configuration options available in `rippled.cfg`.
|
||||
|
||||
#### History Sharding
|
||||
|
||||
`rippled` offers a history sharding feature that allows you to store a randomized range of ledgers in a separate shard store. You can use the `[shard_db]` stanza to configure the shard store to use a different type of key-value store than the one you defined for the ledger store using the `[node_db]` stanza. For more information about how to use this feature, see [History Sharding](history-sharding.html).
|
||||
|
||||
|
||||
### Historical Data
|
||||
|
||||
The amount of historical data that a `rippled` server keeps online is a major contributor to required storage space. At the time of writing (2018-10-29), a `rippled` server stores about 12GB of data per day and requires 8.4TB to store the full history of the XRP Ledger. You can expect this amount to grow as transaction volume increases across the XRP Ledger network. You can control how much data you keep with the `online_delete` and `advisory_delete` fields.
|
||||
|
||||
Online deletion enables pruning of `rippled` ledgers from databases without any disruption of service. It only removes records that are not part of the current ledgers. Without online deletion, those databases grow without bounds. Freeing disk space requires stopping the process and manually removing database files.
|
||||
Online deletion enables the purging of `rippled` ledgers from databases without any disruption of service. It removes only records that are not part of the current ledgers. Data in current ledgers means any data that's used by ledger versions that are new enough not to be deleted. Without online deletion, those databases grow without bounds. Freeing disk space requires stopping the process and manually removing database files. For more information, see [`[node_db]`: `online_delete`](https://github.com/ripple/rippled/blob/develop/cfg/rippled-example.cfg#L832).
|
||||
|
||||
<!-- {# ***TODO***: Add link to online_delete section, when complete, per https://ripplelabs.atlassian.net/browse/DOC-1313 #} -->
|
||||
|
||||
### Log Level
|
||||
|
||||
The default `rippled.cfg` file sets the logging verbosity to `warning`. This setting greatly reduces disk space and I/O requirements over more verbose logging. However, more verbose logging provides increased visibility for troubleshooting.
|
||||
The example `rippled-example.cfg` file sets the logging verbosity to `warning` in the `[rpc_startup]` stanza. This setting greatly reduces disk space and I/O requirements over more verbose logging. However, more verbose logging provides increased visibility for troubleshooting.
|
||||
|
||||
**Caution:** If you omit the `log_level` command from the `[rpc_startup]` stanza, `rippled` writes logs to disk at the `debug` level and outputs `warning` level logs to the console. `debug` level logging requires several more GB of disk space per day than `warning` level, depending on transaction volumes and client activity.
|
||||
|
||||
|
||||
|
||||
## Network and Hardware
|
||||
|
||||
Each `rippled` server in the XRP Ledger network performs all of the transaction processing work of the network. It is unknown when volumes will approach maximum network capacity. Therefore, the baseline hardware for production `rippled` servers should be similar to that used in Ripple's [performance testing](https://ripple.com/dev-blog/demonstrably-scalable-blockchain/).
|
||||
Each `rippled` server in the XRP Ledger network performs all of the transaction processing work of the network. Therefore, the baseline hardware for production `rippled` servers should be similar to that used in Ripple's [performance testing](https://ripple.com/dev-blog/demonstrably-scalable-blockchain/).
|
||||
|
||||
Ensuring that your `rippled` server meets these network and hardware requirements helps achieve consistent, good performance across the XRP Ledger network.
|
||||
|
||||
|
||||
### Recommendation
|
||||
|
||||
@@ -79,39 +116,53 @@ For best performance in enterprise production environments, Ripple recommends ru
|
||||
|
||||
- Operating System: Ubuntu 16.04+
|
||||
- CPU: Intel Xeon 3+ GHz processor with 4 cores and hyperthreading enabled
|
||||
- Disk: SSD
|
||||
- RAM:
|
||||
- For testing: 8GB+
|
||||
- For production: 32GB
|
||||
- Disk: SSD (7000+ writes/second, 10,000+ reads/second)
|
||||
- RAM: 32GB
|
||||
- Network: Enterprise data center network with a gigabit network interface on the host
|
||||
|
||||
#### SSD Storage
|
||||
|
||||
SSD storage should support several thousand of both read and write IOPS. The maximum reads and writes per second that Ripple engineers have observed are over 10,000 reads per second (in heavily-used public server clusters), and over 7,000 writes per second (in dedicated performance testing).
|
||||
|
||||
#### CPU Utilization and Virtualization
|
||||
Ripple performance engineering has determined that bare metal servers achieve maximum throughput. However, it is likely that hypervisors cause minimal degradation in performance.
|
||||
|
||||
#### Network
|
||||
|
||||
Any enterprise or carrier-class data center should have substantial network bandwidth to support running `rippled` servers. The minimum requirements are roughly 2Mbps transmit and 2Mbps receive for current transaction volumes. However, these can burst up to 100MBps transmissions when serving historical ledger and transaction reports. When a `rippled` server initially starts up, it can burst to over 20Mbps receive.
|
||||
You'll get the best performance on bare metal, but virtual machines can perform nearly as well as long as the host hardware has high enough specs.
|
||||
|
||||
#### Storage
|
||||
|
||||
Ripple recommends estimating storage sizing at roughly 12GB per day of data kept online with NuDB. RocksDB requires around 8GB per day. However, the data per day changes with activity in the network. You should provision extra capacity to prepare for future growth. At the time of writing (2018-10-29), a server with all XRP Ledger history requires 8.4TB.
|
||||
Here are some estimated `rippled` storage requirements:
|
||||
|
||||
- RocksDB stores around 8GB per day
|
||||
- NuDB stores around 12GB per day
|
||||
|
||||
The amount of data stored per day changes with activity in the network.
|
||||
|
||||
You should provision extra storage capacity to prepare for future growth. At the time of writing (2018-10-29), a `rippled` server storing the full history of the XRP Ledger required 8.4TB.
|
||||
|
||||
<!-- {# ***TODO: Update the dated storage consideration above, as needed. ***#} -->
|
||||
<!-- {# ***TODO: DOC-1331 tracks: Create historic metrics that a user can use to derive what will be required. For ex, a chart with 1TB in 2014, 3TB in 2015, 7TB in 2018 ***#} -->
|
||||
|
||||
#### Memory
|
||||
SSD storage should support several thousand of both read and write IOPS. Ripple engineers observed the following maximum reads and writes per second:
|
||||
|
||||
Memory requirements are mainly a function of the `node_size` configuration setting and the amount of client traffic retrieving historical data. As mentioned, production servers should maximize performance and set this parameter to `huge`.
|
||||
You can set the `node_size` parameter lower to use less memory, but you should only do this for testing. With a `node_size` of `medium`, a `rippled` server can be reasonably stable in a test Linux system with as little as 8GB of RAM.
|
||||
- Over 10,000 reads per second (in heavily-used public server clusters)
|
||||
- Over 7,000 writes per second (in dedicated performance testing)
|
||||
|
||||
#### Amazon Web Services
|
||||
##### Amazon Web Services
|
||||
|
||||
Amazon Web Services (AWS) is a popular virtualized hosting environment. You can run rippled in AWS, but Ripple does not recommend using Elastic Block Storage (EBS). Elastic Block Storage's maximum number of IOPS (5,000) is insufficient for `rippled`'s heaviest loads, despite being very expensive.
|
||||
Amazon Web Services (AWS) is a popular virtualized hosting environment. You can run `rippled` in AWS, but Ripple does not recommend using Elastic Block Storage (EBS). Elastic Block Storage's maximum number of IOPS (5,000) is insufficient for `rippled`'s heaviest loads, despite being very expensive.
|
||||
|
||||
AWS instance stores (`ephemeral` storage) do not have these constraints. Therefore, Ripple recommends deploying `rippled` servers with host types such as `M3` that have instance storage. The `database_path` and `node_db` path should each reside on instance storage.
|
||||
|
||||
**Caution:** AWS instance storage is not guaranteed to provide durability in the event of hard drive failure. Further, data that is lost when the instance stops and restarts (but not when just rebooted). This loss can be acceptable for a `rippled` server because an individual server can usually re-acquire that data from its peer servers.
|
||||
**Caution:** AWS instance storage is not guaranteed to provide durability in the event of hard drive failure. You also lose data when you stop/start or reboot the instance. The latter type of data loss can be acceptable for a `rippled` server because an individual server can usually re-acquire the lost data from its peer servers.
|
||||
|
||||
#### RAM/Memory
|
||||
|
||||
Memory requirements are mainly a function of the `node_size` configuration setting and the amount of client traffic retrieving historical data. For more information about memory requirements, see [Node Size](#node-size).
|
||||
|
||||
#### Network
|
||||
|
||||
Any enterprise or carrier-class data center should have substantial network bandwidth to support running `rippled` servers.
|
||||
|
||||
Here are examples of observed network bandwidth use for common `rippled` tasks:
|
||||
|
||||
| Task | Transmit/Receive |
|
||||
|:------------------------------------------------|:---------------------------|
|
||||
| Process current transaction volumes | 2Mbps transmit, 2 Mbps receive |
|
||||
| Serve historical ledger and transaction reports | 100Mbps transmit |
|
||||
| Start up `rippled` | 20Mbps receive |
|
||||
|
||||
@@ -155,7 +155,7 @@ An error such as the following indicates that the `rippled.cfg` file has an impr
|
||||
Terminating thread rippled: main: unhandled N5beast14BadLexicalCastE 'std::bad_cast'
|
||||
```
|
||||
|
||||
Valid parameters for the `node_size` field are `tiny`, `small`, `medium`, or `huge`. For more information see [Node Size](capacity-planning.html#node-size).
|
||||
Valid parameters for the `node_size` field are `tiny`, `small`, `medium`, `large`, or `huge`. For more information see [Node Size](capacity-planning.html#node-size).
|
||||
|
||||
|
||||
## Shard path missing
|
||||
|
||||
Reference in New Issue
Block a user