Last active
November 28, 2023 11:19
-
-
Save linuskendall/989ba64b0298df0f9cfb5aa057b3e4ff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
XDG_RUNTIME_DIR="/run/user/$(id -u solana)" | |
set -o errexit | |
set -o nounset | |
set -o pipefail | |
PID=$(pidof solana-validator) | |
if [[ -z "${PID}" ]]; then | |
echo "Solana not running it seems. Could not find solana-validator pid." | |
exit 1 | |
fi | |
for thread_proc in /proc/${PID}/task/* | |
do | |
if [ -d "${thread_proc}" ]; then | |
TID=$(basename "$thread_proc") | |
THREAD_NAME=$(<"${thread_proc}/comm") | |
echo "${THREAD_NAME} ${TID}" | |
if [[ "${THREAD_NAME}" == "solana-poh-serv" ]]; then | |
# realtime priority: | |
# chrt -r -p 20 ${TID} | |
# set core | |
# taskset -pc 2 ${TID} | |
renice -n -10 -p "${TID}" | |
else | |
renice -n -5 -p "${TID}" | |
fi | |
fi | |
done | |
renice -n -5 -p "${PID}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think, this line
if [[ "${THREAD_NAME}" == "solana-poh-serv" ]]; then
can be modified to
if [[ "${THREAD_NAME,,}" == *"poh"* ]]; then
Because. the latest thread names are
ps -A -L -o pid,tid,ni,comm | grep -i poh 31780 31874 0 solPohTimingRpt 31780 32764 0 solPohTickProd
I think, we can renice only
solPohTickProd