From 53f4c0fdc0fef1282447b549a5076a2b22c3b67e Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Thu, 7 May 2020 11:08:57 -0700 Subject: [PATCH] fix: deprecate old settings and elaborate on tuning (#9542) fixes #9538 --- docs/deployment/kernel-tuning/README.md | 133 +++++++++++-------- docs/deployment/kernel-tuning/disk-tuning.sh | 50 ------- 2 files changed, 75 insertions(+), 108 deletions(-) delete mode 100755 docs/deployment/kernel-tuning/disk-tuning.sh diff --git a/docs/deployment/kernel-tuning/README.md b/docs/deployment/kernel-tuning/README.md index 2975b3d2d..1a62e327f 100644 --- a/docs/deployment/kernel-tuning/README.md +++ b/docs/deployment/kernel-tuning/README.md @@ -1,81 +1,98 @@ # Kernel Tuning for MinIO Production Deployment on Linux Servers [![Slack](https://slack.min.io/slack?type=svg)](https://slack.min.io) [![Docker Pulls](https://img.shields.io/docker/pulls/minio/minio.svg?maxAge=604800)](https://hub.docker.com/r/minio/minio/) -## Tuning Network Parameters +Following are the recommended settings, a copy of this [script](https://github.com/minio/minio/blob/master/docs/deployment/kernel-tuning/sysctl.sh) is available here to be applied on Linux servers. -Following network parameter settings can help ensure optimal MinIO server performance on production workloads. +> NOTE: Although these settings are generally good on Linux servers, users must be careful on any premature tuning. These tunings are generally considered good to have but not mandatory, these settings do not fix any hardware issues and should not be considered as an alternative to boost performance. Under most circumstances this tuning is to be done after performing baseline performance tests for the hardware with expected results. -- *`tcp_fin_timeout`* : A socket left in memory takes approximately 1.5Kb of memory. It makes sense to close the unused sockets preemptively to ensure no memory leakage. This way, even if a peer doesn't close the socket due to some reason, the system itself closes it after a timeout. `tcp_fin_timeout` variable defines this timeout and tells kernel how long to keep sockets in the state FIN-WAIT-2. We recommend setting it to 30. You can set it as shown below - -```sh -sysctl -w net.ipv4.tcp_fin_timeout=30 ``` +#!/bin/bash +cat > sysctl.conf </dev/null); do - iosched_dir=$(echo "${i}" | awk '/iosched/ {print $1}') - [ -z "${iosched_dir}" ] && { - continue - } - ## Change each disk ioscheduler to be "deadline" - ## Deadline dispatches I/Os in batches. A batch is a - ## sequence of either read or write I/Os which are in - ## increasing LBA order (the one-way elevator). After - ## processing each batch, the I/O scheduler checks to - ## see whether write requests have been starved for too - ## long, and then decides whether to start a new batch - ## of reads or writes - path=$(dirname "${iosched_dir}") - [ -f "${path}/scheduler" ] && { - echo "deadline" > "${path}/scheduler" 2>/dev/null || true - } - ## This controls how many requests may be allocated - ## in the block layer for read or write requests. - ## Note that the total allocated number may be twice - ## this amount, since it applies only to reads or - ## writes (not the accumulate sum). - [ -f "${path}/nr_requests" ] && { - echo "256" > "${path}/nr_requests" 2>/dev/null || true - } - ## This is the maximum number of kilobytes - ## supported in a single data transfer at - ## block layer. - [ -f "${path}/max_sectors_kb" ] && { - echo "1024" > "${path}/max_sectors_kb" 2>/dev/null || true - } -done