1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00
VILLASnode/tools/tune-realtime.sh
Steffen Vogel bc24676138 Use spaces for indention of shell scripts
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 23:18:47 +01:00

23 lines
683 B
Bash
Executable file

#!/usr/bin/env bash
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
dnf -y --refresh install \
tuned-utils \
tuned-profiles-realtime
# Isolate half of the available cores by default
if [ -z "${ISOLATED_CORES}" ]; then
PROC=$(nproc)
ISOLATED_CORES=
if ((PROC > 4)); then
ISOLATED_CORES+=$(seq -s, $((PROC/2)) $((PROC-1)))
fi
fi
echo isolated_cores=${ISOLATED_CORES} >> /etc/tuned/realtime-variables.conf
# Enable dynamic preemption
grubby --update-kernel=ALL --remove-args="preempt=full"
# Select real-time tuned profile
tuned-adm profile realtime