Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Who have used vmtune and schedtune on AIX ?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi: Who have used vmtune and schedtune on AIX to tune performance on Oracle ? does it helpful? Solaris and HP-UX have similar tools ? Thanks !!
 
I have used vmtune and schedtune and have achieved improvements in a database. It depends on the database and its needs, and the kind of AIX box you are on: what kinds of devices (SSA disks vs JBODS, for example), memory, CPUs, etc. It took several days of making changes with vmtune and in the database to strike the right balance and get the improvement we wanted. I worked closely with our DBA. I made changes to maxppgahead, minfree, maxfree, maxrandwrt, and numclust.

Oracle has a manual on tuning with a section on changes that can be made for performance improvement on an AIX system.

Once you reach the parms you want, you have to make sure they are established each time the system boots, because the system goes back to the defaults unless reset at boot time.

I made a change in schedtune, but performance didn't improve.

With HP and Solaris, similar changes are achieved by making changes to the kernel parameters (in HP, through SAM, although you can do it manually, and then booting; in Solaris SPARC, making changes in /etc/system and then booting).

 
Hi,

What I did was running a certain "benchmark" command/script in loop,while changing vmtune/schdtune params and recording the timex output.

I worked well - we have found 2 vmtune and 1 schedtune param that needed a change.
Then we loaded these changed on every boot via initab.
The performance tuning script was:

===============================
#!/bin/ksh
#The scripts runs the performance benchmark,while changing vmtune and other parameters,one at a time.It prints the vmtune params and the related benchmarks results into a log file.
#It activates the "benchmark" as a main benchmark
#Default vmtune values loaded on boot:
#/scitex/version/utils/admin/sci_admin: /usr/samples/kernel/vmtune -p 10 -P 30 -c 1 -R 64 -f 120 -F 184"

SCI_TEMP="/scitex/version/temp"
PERFTUNE_LOG="/$SCI_LOGS/perftune.log"
BENCHMARK_LOG="/scitex/version/logs/BENCHMARK.log"

HOSTNAME=`hostname`
MEMORY=`bootinfo -r`
MODELNAME=`lsattr -El sys0 | grep modelname |awk '{ print $2 }'`
VERSION=`lslpp -l | grep RiproOutput | awk '{ print $2 }' | sort -ru`
PAGINGSPACE=`lsps -a -s | grep MB |awk '{ print $1 }'`
DATE=`date`
NOOFPROCS=`lscfg | grep proc | wc -l|awk '{ print $1 }'`
integer PERCENT=0
integer DEFAULT=5000
integer AVERAGE=0

RESET_VMTUNE ()
{
#reset to default vmtune params:
/usr/samples/kernel/vmtune -p 10 -P 30 -c 1 -R 64 -f 120 -F 184 -r 2 -b 93 >/dev/null
}

RESET_SCHEDTUNE ()
{
#reset to default vmtune params:
/usr/samples/kernel/schedtune -D >/dev/null
}

#Initialize variables:
RESET_VMTUNE
RESET_SCHEDTUNE
RESTART_CS
VMTUNE=`/usr/samples/kernel/vmtune`
SCHEDTUNE=`/usr/samples/kernel/schedtune`
TIMEX_LOG='/tmp/timex.log'
touch $BENCHMARK_LOG

RUN_BENCHMARK ()
{
#Runs each eteration 3 times and averages the result,displaying percentage relevant to Default values run
COUNT=3
AVERAGE=0
while (( $COUNT != 0 ))
do
timex "benchmark" 0 2>$TIMEX_LOG
#keep all benchmark logs in one file
cat /scitex/version/logs/JTLog/*.log >> $BENCHMARK_LOG

#Get the run time
integer REAL=`grep real $TIMEX_LOG |awk '{ print $2 }'`
#Decrease 180 Seconds (restart dead time) for every run
REAL=$REAL-180
echo "|$REAL\c" >> $PERFTUNE_LOG
AVERAGE=$AVERAGE+$REAL
COUNT=$COUNT-1

done
#Calculate the average of the 3 runs and it's percentage versus the default run
AVERAGE=$AVERAGE/3
#Set PERCENT to 100 for the default run
if [[ $PERCENT -ne 0 ]]
then
PERCENT=`echo "scale=4;$AVERAGE*100/$DEFAULT"|bc`
else
PERCENT=100
fi
#Establish the used paging space
usedPS=`lsps -a|grep rootvg|awk '{ print $5 }'`

echo "|| Average time = $AVERAGE seconds ,$PERCENT%", Used PS=$usedPS%>> $PERFTUNE_LOG
RESET_VMTUNE
RESET_SCHEDTUNE
}

#copy the last log file to xx.001
cp $PERFTUNE_LOG $PERFTUNE_LOG.001
echo "===========================" > $PERFTUNE_LOG
echo "$HOSTNAME , $MODELNAME , No of PROCS = $NOOFPROCS , Memory =$MEMORY , VER=$VERSION" , PAGINGSPACE=$PAGINGSPACE , $DATE >> $PERFTUNE_LOG
echo "-----------" >> $PERFTUNE_LOG
echo "VMTUNE DEFAULT PARAMETERS:" >> $PERFTUNE_LOG
echo "-----------" >> $PERFTUNE_LOG
echo "$VMTUNE" >> $PERFTUNE_LOG
echo "-----------" >> $PERFTUNE_LOG

#Running with a default values:
RESET_VMTUNE
RESET_SCHEDTUNE
echo "-----------" >> $PERFTUNE_LOG
echo "##########################################" >> $PERFTUNE_LOG
echo " Running with a default values" >> $PERFTUNE_LOG
echo "-----------" >> $PERFTUNE_LOG
printf " %-3s %-3s " ' ' ' ' >> $PERFTUNE_LOG
RUN_BENCHMARK
#keep the Default time (run with default params) for percentage calculation
DEFAULT=$AVERAGE
echo "##########################################" >> $PERFTUNE_LOG

#Changing -P = maxperm values:
echo "##########################################" >> $PERFTUNE_LOG
echo " Changing -P=maxperm values in range 40/60/80%" >> $PERFTUNE_LOG
echo "-----------" >> $PERFTUNE_LOG
for P in 40 60 80
do
printf " %-3s %-3s " "-P=" "$P" >> $PERFTUNE_LOG
/usr/samples/kernel/vmtune -P $P >/dev/null
RUN_BENCHMARK
done

#Changing -r = minpgahead values:
echo "##########################################" >> $PERFTUNE_LOG
echo " Changing -r = minpgahead values in range 8/16/32 " >> $PERFTUNE_LOG
echo "-----------" >> $PERFTUNE_LOG
for r in 8 16 32
do
printf " %-3s %-3s " "-r=" "$r" >> $PERFTUNE_LOG
/usr/samples/kernel/vmtune -r $r >/dev/null
RUN_BENCHMARK
done

#Changing -R = maxpgahead values:
echo "##########################################" >> $PERFTUNE_LOG
echo " Changing -R= maxpgahead values in range 16/32/128 " >> $PERFTUNE_LOG
echo "-----------" >> $PERFTUNE_LOG
for R in 16 32 128
do
printf " %-3s %-3s " "-R=" "$R" >> $PERFTUNE_LOG
/usr/samples/kernel/vmtune -R $R >/dev/null
RUN_BENCHMARK
done

#Changing -f = minfree values:
echo "##########################################" >> $PERFTUNE_LOG
echo " Changing -f = minfree values in range 90/150/180 " >> $PERFTUNE_LOG
echo "-----------" >> $PERFTUNE_LOG
for f in 90 150 180
do
printf " %-3s %-3s " "-f=" "$f" >> $PERFTUNE_LOG
/usr/samples/kernel/vmtune -f $f >/dev/null
RUN_BENCHMARK
done

#Changing -F = maxfree values:
echo "##########################################" >> $PERFTUNE_LOG
echo " Changing -F = maxfree values in range 160/200/220 " >> $PERFTUNE_LOG
echo "-----------" >> $PERFTUNE_LOG
for F in 160 200 220
do
printf " %-3s %-3s " "-F=" "$F" >> $PERFTUNE_LOG
/usr/samples/kernel/vmtune -F $F >/dev/null
RUN_BENCHMARK
done

#Changing -c = numclust values:
echo "##########################################" >> $PERFTUNE_LOG
echo " Changing -c = numclust values in range 0 " >> $PERFTUNE_LOG
echo "-----------" >> $PERFTUNE_LOG
for c in 0
do
printf " %-3s %-3s " "-c=" "$c" >> $PERFTUNE_LOG
/usr/samples/kernel/vmtune -c $c >/dev/null
RUN_BENCHMARK
done

####################################################################################
#Now we change the schedtune parameters:
echo " SCHEDTUNE DEFAULT PARAMETERS:" >> $PERFTUNE_LOG
echo "-----------" >> $PERFTUNE_LOG
echo "$SCHEDTUNE " >> $PERFTUNE_LOG
echo "-----------" >> $PERFTUNE_LOG

#Changing -f = TICKS values:
echo "##########################################" >> $PERFTUNE_LOG
echo " Changing -f = TICKS values in range 20/30/40 " >> $PERFTUNE_LOG
echo "-----------" >> $PERFTUNE_LOG
for f in 20 30 40
do
printf " %-3s %-3s " "-f=" "$f" >> $PERFTUNE_LOG
/usr/samples/kernel/schedtune -f $f >/dev/null
RUN_BENCHMARK
done

#Changing -d = SCHED_D values:
echo "##########################################" >> $PERFTUNE_LOG
echo " Changing -d = SCHED_D values in range 8/32 " >> $PERFTUNE_LOG
echo "-----------" >> $PERFTUNE_LOG
for d in 8 32
do
printf " %-3s %-3s " "-d=" "$d" >> $PERFTUNE_LOG
/usr/samples/kernel/schedtune -d $d >/dev/null
RUN_BENCHMARK
done

#Changing -r = SCHED_R values:
echo "##########################################" >> $PERFTUNE_LOG
echo " Changing -r = TICKS values in range 8/12/20 " >> $PERFTUNE_LOG
echo "-----------" >> $PERFTUNE_LOG
for r in 8 12 20
do
printf " %-3s %-3s " "-r=" "$r" >> $PERFTUNE_LOG
/usr/samples/kernel/schedtune -r $r >/dev/null
RUN_BENCHMARK
done

#Changing -m = MULTI values:
echo "##########################################" >> $PERFTUNE_LOG
echo " Changing -m = MULTI values in range 4/6/8/10 " >> $PERFTUNE_LOG
echo "-----------" >> $PERFTUNE_LOG
for m in 4 6 8 10
do
printf " %-3s %-3s " "-m=" "$m" >> $PERFTUNE_LOG
/usr/samples/kernel/schedtune -m $m >/dev/null
RUN_BENCHMARK
done

#Changing -w = WAIT values:
echo "##########################################" >> $PERFTUNE_LOG
echo " Changing -w = WAIT values in range 2/4 " >> $PERFTUNE_LOG
echo "-----------" >> $PERFTUNE_LOG
for w in 2 4
do
printf " %-3s %-3s " "-w=" "$w" >> $PERFTUNE_LOG
/usr/samples/kernel/schedtune -w $w >/dev/null
RUN_BENCHMARK
done

#Changing -e = GRACE values:
echo "##########################################" >> $PERFTUNE_LOG
echo " Changing -e = GRACE values in range 1/4 " >> $PERFTUNE_LOG
echo "-----------" >> $PERFTUNE_LOG
for e in 1 4
do
printf " %-3s %-3s " "-e=" "$e" >> $PERFTUNE_LOG
/usr/samples/kernel/schedtune -e $e >/dev/null
RUN_BENCHMARK
done

#Changing -t = MULTI values:
echo "##########################################" >> $PERFTUNE_LOG
echo " Changing -t = TIMESLICE values in range 2/4 " >> $PERFTUNE_LOG
echo "-----------" >> $PERFTUNE_LOG
for t in 2 4
do
printf " %-3s %-3s " "-t=" "$t" >> $PERFTUNE_LOG
/usr/samples/kernel/schedtune -t $t >/dev/null
RUN_BENCHMARK
done

mail -s &quot;$MODELNAME- PERFTUNE&quot; user@company.com < $PERFTUNE_LOG


&quot;Long live king Moshiach !&quot;
h
 
For our 6k's that are dedicated to Oracle, we set &quot;vmtune -p 5 -P 15&quot;. With the default values, we were getting 30% to 50% paging space utilization (on machines ranging from 2 to 4 G of ram). Since Oracle does its own caching, we figured reducing AIX's attempt to cache disk data would help. It did, our paging space utilization is under 5%, and database performance is higher.
 
First don't make any change to schedtune, it wouldn't help database performance and chances are that you will run into a performance degradation.
The best option that you have to achieve better database performance is to adjust vmtune parameters.
Lets talk first about maxfree and minfree. These parameters allows you to have the proper number of memory pages in the free list, so that the system will be able to find out memory as soon as it is requested.
minfree = (#CPU's * 120)
maxfree = (#CPU's * 8) + minfree

Now lets talk about minperm and maxperm. These parameters are related to filysystem cache memory. As you know oracle has its own cache area (within the SGA), so that you don't need a larger FS cache memory area. Also it is important to force the FS cache memory to be within those limits by using the strict_maxperm parameter.

vmtune -p 5 -P 20 -h 1 -> for systems with a large SGA
vmtune -p 20 -P 50 -h 1 -> for systems with regular SGA

As you can see it depends sometimes of the type of memory and SGA config that you have, so I would recommend a thoroughly analysis using topas, svmon, ipcs -ma or ps to determine memory allocation.

This kind of analysis has worked perfect to me and I have successfully tuned all our AIX production servers.

Hope it helps...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top