* Sync FD limit and max maps to 500k (cherry picked from commit11951eb009
) * Expand system tuning docs (cherry picked from commit5354df8c1c
) Co-authored-by: Trent Nelson <trent@solana.com>
This commit is contained in:
@ -76,7 +76,7 @@ RestartForceExitStatus=SIGPIPE
|
|||||||
TimeoutStartSec=10
|
TimeoutStartSec=10
|
||||||
TimeoutStopSec=0
|
TimeoutStopSec=0
|
||||||
KillMode=process
|
KillMode=process
|
||||||
LimitNOFILE=65536
|
LimitNOFILE=500000
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
@ -8,5 +8,5 @@ source "$HERE"/utils.sh
|
|||||||
ensure_env || exit 1
|
ensure_env || exit 1
|
||||||
|
|
||||||
# Allow more files to be opened by a user
|
# Allow more files to be opened by a user
|
||||||
sed -i 's/^\(# End of file\)/* soft nofile 65535\n\n\1/' /etc/security/limits.conf
|
echo "* - nofile 500000" > /etc/security/limits.d/90-solana-nofiles.conf
|
||||||
|
|
||||||
|
@ -46,10 +46,14 @@ that CUDA is enabled: `"[<timestamp> solana::validator] CUDA is enabled"`
|
|||||||
|
|
||||||
## System Tuning
|
## System Tuning
|
||||||
|
|
||||||
For Linux validators, the solana repo includes a daemon to adjust system settings to optimize
|
### Linux
|
||||||
performance (namely by increasing the OS UDP buffer limits, and scheduling PoH with realtime policy).
|
#### Automatic
|
||||||
|
The solana repo includes a daemon to adjust system settings to optimize performance
|
||||||
|
(namely by increasing the OS UDP buffer limits, and scheduling PoH with realtime policy).
|
||||||
|
|
||||||
The daemon (`solana-sys-tuner`) is included in the solana binary release.
|
The daemon (`solana-sys-tuner`) is included in the solana binary release. Restart
|
||||||
|
it, *before* restarting your validator, after each software upgrade to ensure that
|
||||||
|
the latest recommended settings are applied.
|
||||||
|
|
||||||
To run it:
|
To run it:
|
||||||
|
|
||||||
@ -57,6 +61,53 @@ To run it:
|
|||||||
sudo solana-sys-tuner --user $(whoami) > sys-tuner.log 2>&1 &
|
sudo solana-sys-tuner --user $(whoami) > sys-tuner.log 2>&1 &
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Manual
|
||||||
|
If you would prefer to manage system settings on your own, you may do so with
|
||||||
|
the following commands.
|
||||||
|
|
||||||
|
##### **Increase UDP buffers**
|
||||||
|
```bash
|
||||||
|
sudo bash -c "cat >/etc/sysctl.d/20-solana-udp-buffers.conf <<EOF
|
||||||
|
# Increase UDP buffer size
|
||||||
|
net.core.rmem_default = 134217728
|
||||||
|
net.core.rmem_max = 134217728
|
||||||
|
net.core.wmem_default = 134217728
|
||||||
|
net.core.wmem_max = 134217728
|
||||||
|
EOF"
|
||||||
|
```
|
||||||
|
```bash
|
||||||
|
sudo sysctl -p /etc/sysctl.d/20-solana-udp-buffers.conf
|
||||||
|
```
|
||||||
|
|
||||||
|
##### **Increased memory mapped files limit**
|
||||||
|
```bash
|
||||||
|
sudo bash -c "cat >/etc/sysctl.d/20-solana-mmaps.conf <<EOF
|
||||||
|
# Increase memory mapped files limit
|
||||||
|
vm.max_map_count = 500000
|
||||||
|
EOF"
|
||||||
|
```
|
||||||
|
```bash
|
||||||
|
sudo sysctl -p /etc/sysctl.d/20-solana-mmaps.conf
|
||||||
|
```
|
||||||
|
Add
|
||||||
|
```
|
||||||
|
LimitNOFILE=500000
|
||||||
|
```
|
||||||
|
to the `[Service]` section of your systemd service file, if you use one,
|
||||||
|
otherwise add it to `/etc/systemd/system.conf`.
|
||||||
|
```bash
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
```
|
||||||
|
```bash
|
||||||
|
sudo bash -c "cat >/etc/security/limits.d/90-solana-nofiles.conf <<EOF
|
||||||
|
# Increase process file descriptor count limit
|
||||||
|
* - nofile 500000
|
||||||
|
EOF"
|
||||||
|
```
|
||||||
|
```bash
|
||||||
|
### Close all open sessions (log out then, in again) ###
|
||||||
|
```
|
||||||
|
|
||||||
## Generate identity
|
## Generate identity
|
||||||
|
|
||||||
Create an identity keypair for your validator by running:
|
Create an identity keypair for your validator by running:
|
||||||
|
@ -3288,7 +3288,7 @@ fn adjust_ulimit_nofile() -> Result<()> {
|
|||||||
fn adjust_ulimit_nofile() -> Result<()> {
|
fn adjust_ulimit_nofile() -> Result<()> {
|
||||||
// Rocks DB likes to have many open files. The default open file descriptor limit is
|
// Rocks DB likes to have many open files. The default open file descriptor limit is
|
||||||
// usually not enough
|
// usually not enough
|
||||||
let desired_nofile = 65000;
|
let desired_nofile = 500000;
|
||||||
|
|
||||||
fn get_nofile() -> libc::rlimit {
|
fn get_nofile() -> libc::rlimit {
|
||||||
let mut nofile = libc::rlimit {
|
let mut nofile = libc::rlimit {
|
||||||
|
@ -93,7 +93,7 @@ fn tune_kernel_udp_buffers_and_vmmap() {
|
|||||||
sysctl_write("net.core.wmem_default", "134217728");
|
sysctl_write("net.core.wmem_default", "134217728");
|
||||||
|
|
||||||
// increase mmap counts for many append_vecs
|
// increase mmap counts for many append_vecs
|
||||||
sysctl_write("vm.max_map_count", "1000000");
|
sysctl_write("vm.max_map_count", "500000");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
|
Reference in New Issue
Block a user