Rperf script
| Fiche express | |
|---|---|
| Domaine | Script de diagnostic — performance relative CPU |
| Contexte | AIX / POWER |
| Métriques | rPerf · rOLTP |
| Voir aussi | Procs script · Machine type script · Nb cpu script |
rperf (v4) est un script ksh qui restitue l'indice de performance relative d'une machine (ou LPAR) POWER/AIX, en s'appuyant sur deux publications publiques IBM : le System p Performance Report et le System p Facts and Features Document. Il combine le modèle de machine (Machine type script), le nombre de CPU (Nb cpu script) et leur fréquence (Procs script) pour retrouver, dans une table de correspondance intégrée au script, l'indice publié par IBM pour cette configuration exacte.
rPerf vs rOLTP
Deux unités coexistent selon l'ancienneté du modèle :
- rPerf (Relative Performance) : indice utilisé sur les machines POWER4/POWER5/POWER6
et plus récentes.
- rOLTP (Relative OLTP) : indice plus ancien, utilisé sur les modèles antérieurs
(RS64, premières générations POWER).
Il n'existe pas de conversion simple entre les deux : le script affiche l'unité correspondant au modèle trouvé.
Fonctionnement
- Récupère le modèle (
lsattr -El sys0 -a modelname), le nombre de CPU et le type/fréquence
processeur (mêmes méthodes que Machine type script, Nb cpu script et Procs script).
- Construit une clé de recherche
modèle_fréquence-arrondie_nbcpu. - Cherche la clé exacte dans la table intégrée (
caseksh) ; si le nombre de CPU de la
machine ne correspond à aucune entrée exacte mais est inférieur à une configuration connue,
estime le ratio proportionnellement (marqué estimated dans la sortie —
l'estimation est alors une valeur plancher, pas un chiffre officiel).
- Si aucune correspondance n'est trouvée, affiche
unknown.
Script
#!/usr/bin/ksh93
# rperf version 4
# Diffusion libre, sans garantie.
machine=`lsattr -El sys0 -a modelname -F value`
cpus=`lsdev -Cc processor | grep Available | wc -l | sed 's/ //g'`
procstr=`lsdev -Cc processor | head -1 | cut -d' ' -f1`
proctype=`lsattr -El $procstr | awk '/^type/ {print $2}'`
Hz=`lsattr -El ${procstr%% *} -a frequency -F value`
if [[ ! -z $Hz ]]
then
if (( ($Hz%1000000) >= 500000 ))
then
(( MHz=($Hz/1000000) + 1 ))
else
(( MHz=($Hz/1000000) ))
fi
else
echo "MHz rating is not available, exiting"
exit 2
fi
dd=${MHz:0:2}
ff=${MHz:2:9}
if (( $ff < 10 )); then
ff=${ff//[0-9]/0}
elif (( $ff > 90 )); then
ff=${ff//[0-9]/0}
let dd=$dd+1
elif (( $ff > 40 )); then
if (( $ff < 60 )); then
ff=50
fi
fi
roundedMHz=$dd$ff
lookup=${machine}_${roundedMHz}_${cpus}
units=rPerf
lookup1()
{
[ "$1" == "" ] && return
if (( cpus==$1 )); then
rating=$2
return
fi
if (( cpus<$1 )); then
let rating=$2/$1*$cpus
estimated="estimated"
fi
}
matchup()
{
rating=0
(( $#>=2 )) && lookup1 $1 $2; (( rating != 0 )) && return
(( $#>=4 )) && lookup1 $3 $4; (( rating != 0 )) && return
(( $#>=6 )) && lookup1 $5 $6; (( rating != 0 )) && return
(( $#>=8 )) && lookup1 $7 $8; (( rating != 0 )) && return
(( $#>=10 )) && lookup1 $9 $10; (( rating != 0 )) && return
(( $#>=12 )) && lookup1 $11 $12; (( rating != 0 )) && return
(( $#>=14 )) && lookup1 $13 $14
}
case $lookup in
IBM,7043-150_250_1) rating=0.18;;
IBM,7043-150_375_1) rating=0.26;;
IBM,7043-260_200_1) rating=10.5; units=roltp ;;
IBM,7043-260_200_2) rating=21.0; units=roltp ;;
IBM,7044-170_333_1) rating=0.58 ;;
IBM,7044-170_400_1) rating=0.73 ;;
IBM,7044-170_450_1) rating=0.79 ;;
IBM,7044-270_375_1) rating=1.00 ;;
IBM,7044-270_375_2) rating=1.92 ;;
IBM,7044-270_375_3) rating=2.55 ;;
IBM,7044-270_375_4) rating=3.47 ;;
IBM,7044-270_450_2) rating=2.27 ;;
IBM,7044-270_450_4) rating=4.01 ;;
IBM,7025-F80_450_1) rating=23.0; units=roltp ;;
IBM,7025-F80_450_2) rating=50.0; units=roltp ;;
IBM,7025-F80_450_4) rating=87.7; units=roltp ;;
IBM,7025-F80_500_6) rating=191.2; units=roltp ;;
IBM,7025-F80_600_1) rating=32.3; units=roltp ;;
IBM,7025-F80_600_2) rating=69.0; units=roltp ;;
IBM,7025-F80_600_4) rating=117.0; units=roltp ;;
IBM,7025-6F0_450_1) rating=0.93 ;;
IBM,7025-6F0_450_2) rating=2.02 ;;
IBM,7025-6F0_450_4) rating=3.55 ;;
IBM,7025-6F0_600_1) rating=1.26 ;;
IBM,7025-6F0_600_2) rating=2.69 ;;
IBM,7025-6F0_600_4) rating=4.57 ;;
IBM,7025-6F0_750_1) rating=1.91 ;;
IBM,7025-6F0_750_2) rating=3.49 ;;
IBM,7025-6F0_750_4) rating=5.85 ;;
IBM,7025-6F1_450_1) rating=0.93 ;;
IBM,7025-6F1_450_2) rating=2.02 ;;
IBM,7025-6F1_450_4) rating=3.55 ;;
IBM,7025-6F1_600_1) rating=1.26 ;;
IBM,7025-6F1_600_2) rating=2.69 ;;
IBM,7025-6F1_600_4) rating=4.57 ;;
IBM,7025-6F1_668_6) rating=7.46 ;;
IBM,7025-6F1_750_1) rating=1.91 ;;
IBM,7025-6F1_750_2) rating=3.49 ;;
IBM,7025-6F1_750_4) rating=5.85 ;;
IBM,7025-6F1_750_6) rating=8.23 ;;
IBM,7017-S80_450_6) rating=161.7; units=roltp ;;
IBM,7017-S80_450_12) rating=306.7; units=roltp ;;
IBM,7017-S80_450_18) rating=428.7; units=roltp ;;
IBM,7017-S80_450_24) rating=533.3; units=roltp ;;
IBM,7017-S80_600_6) rating=219.0; units=roltp ;;
IBM,7017-S80_600_12) rating=416.0; units=roltp ;;
IBM,7017-S80_600_18) rating=583.3; units=roltp ;;
IBM,7017-S80_600_24) rating=736.0; units=roltp ;;
IBM,7040-671_1500_*) matchup 4 13.66 8 24.18 16 46.79 ;;
IBM,7040-681_1100_*) matchup 8 18.02 16 34.66 24 48.11 32 60.66 ;;
IBM,7040-681_1300_*) matchup 8 21.20 16 40.92 24 56.46 32 71.44 ;;
IBM,7040-681_1500_*) matchup 8 24.18 16 46.79 24 64.99 32 81.95 ;;
IBM,7040-681_1700_*) matchup 8 27.11 16 52.45 24 72.86 32 92.19 ;;
IBM,7040-681_1900_*) matchup 8 30.63 16 59.26 24 82.32 32 104.17 ;;
IBM,9115-505_1500_2) rating=9.13 ;;
IBM,9115-505_1650_1) let rating=9.86/2; estimated="estimated - hypothèse : LPAR 1 VP, pas le modèle mono-CPU sans cache L2" ;;
IBM,9115-505_1650_*) matchup 2 9.86 4 20.25 ;;
IBM,9115-505_1900_*) matchup 1 4.10 2 11.49 ;;
IBM,9115-505_2100_*) lookup1 2 12.46 ;;
IBM,9110-51A_1500_*) matchup 1 3.25 2 9.13 4 18.75 ;;
IBM,9110-510_1650_*) matchup 1 5.24 2 9.86 4 20.25 ;;
IBM,9110-51A_1900_*) lookup1 1 6.11 ;;
IBM,9110-51A_2100_*) matchup 1 6.63 2 12.46 ;;
IBM,9111-520_1500_*) matchup 1 3.25 2 9.13 ;;
IBM,9111-520_1650_*) lookup1 2 9.86 ;;
IBM,9131-52A_1650_*) matchup 1 3.62 2 10.15 4 20.25 ;;
IBM,9131-52A_1500_*) matchup 2 11.16 4 18.75 ;;
IBM,9131-52A_2100_*) matchup 1 6.63 2 12.46 ;;
IBM,9133-55A_1500_*) matchup 4 18.20 8 34.46 ;;
IBM,9133-55A_1650_*) matchup 2 10.15 4 20.25 8 38.34 ;;
IBM,9133-55A_1900_*) matchup 2 11.16 4 22.26 ;;
IBM,9133-55A_2100_*) matchup 2 12.46 4 24.86 ;;
IBM,9113-550_1500_*) matchup 1 3.25 2 9.13 4 18.20 ;;
IBM,9113-550_1650_*) matchup 2 9.86 4 19.66 ;;
IBM,9116-561_1500_*) matchup 4 18.75 8 35.50 16 65.24 ;;
IBM,9116-561_1800_*) matchup 4 21.72 8 41.12 16 75.58 ;;
IBM,9117-570_1500_*) matchup 2 9.13 4 18.20 8 34.46 ;;
IBM,9117-570_1650_*) matchup 2 9.86 4 19.66 8 37.22 12 53.43 16 68.40 ;;
# POWER5 et POWER5+ partagent la même fréquence sur ce modèle : distinction par proctype
IBM,9117-570_1900_*)
if [ $proctype == "POWER5+" ]
then
matchup 2 12.27 4 24.18 8 46.36 12 66.55 16 95.96
else
matchup 2 11.16 4 22.26 8 42.14 12 60.50 16 77.45
fi ;;
IBM,9117-570_2100_*) matchup 2 13.83 4 27.58 8 52.21 12 74.95 16 95.96 ;;
IBM,9119-590_1650_*) matchup 8 41.68 16 80.86 24 116.29 32 151.72 ;;
IBM,9119-590_2100_*) matchup 8 55.74 16 108.13 24 155.51 32 202.88 ;;
IBM,9119-595_1650_*) matchup 16 80.86 24 116.29 32 151.72 40 182.07 48 212.41 56 242.76 64 273.10 ;;
IBM,9119-595_1900_*) matchup 16 90.67 24 130.39 32 170.11 40 204.14 48 238.16 56 272.18 64 306.21 ;;
IBM,9119-595_2100_*) matchup 16 108.13 24 155.51 32 202.88 40 243.46 48 284.04 56 324.61 64 365.19 ;;
IBM,9119-595_2300_*) matchup 16 116.13 24 167.58 32 218.64 40 262.37 48 306.10 56 349.83 64 393.55 ;;
# Blades JS21
IBM,7988-J21_2700_*) matchup 2 5.31 ;;
IBM,7988-J21_2500_*) matchup 4 8.72 ;;
# POWER6 - JS12/JS22
IBM,7998-60X_3800_*) matchup 2 14.71 ;;
IBM,7998-61X_4000_*) matchup 4 30.26 ;;
# POWER6 - 520
IBM,8203-E4A_4200_*) matchup 1 8.39 2 15.95 4 31.48 ;;
# POWER6 - 550
IBM,8204-E8A_3500_*) matchup 2 15.85 4 31.27 6 45.04 8 58.80 ;;
IBM,8204-E8A_4200_*) matchup 2 18.38 4 36.28 6 52.24 8 68.20 ;;
# POWER6 - 570
IBM,9117-MMA_3500_*) matchup 2 15.85 4 31.69 8 58.95 12 83.35 16 105.75 ;;
IBM,9117-MMA_4200_*) matchup 2 18.38 4 36.76 8 68.38 12 96.68 16 122.67 ;;
IBM,9117-MMA_4700_*) matchup 2 20.13 4 40.26 8 74.89 12 105.89 16 134.35 ;;
# POWER6 - 595
IBM,9119-FHA_4200_*) matchup 8 75.58 16 142.90 32 266.51 48 373.60 64 479.89 ;;
IBM,9119-FHA_5000_*) matchup 8 87.10 16 164.67 32 307.12 48 430.53 64 553.01 ;;
*) rating=unknown; units=unknown ;;
esac
(( $rating == 0 )) && { rating=unknown; units=unknown; }
printf "%.2f %s %s\n" $rating $units $estimated
Utilisation
- Sans argument : affiche la note de performance de la machine locale.
-v: mode verbeux, affiche le détail des valeurs utilisées (modèle, fréquence,
fréquence arrondie, nombre de CPU, type de processeur, clé de recherche).
-?: aide.
(à vérifier) : la table ci-dessus couvre des générations POWER4 à POWER6 (jusqu'aux
modèles 570/595/FHA). Sur des machines POWER7 et plus récentes, aucune correspondance n'est
trouvée et le script retourne unknown — il faudrait étendre le case
avec les valeurs rPerf publiées pour ces générations.