Re: Processor Affinity
Posted in 1999
Topics: Platform-Specific Issues
Mike, I tried to do this on an AIX system and it did not support it. I found out that some versions of Solaris did. My experience is that this is more of a programming capability. Where you can kick off threaded processes and bind them to a processor. Because of this (for some reason), it is only available on specific platforms. I think you have to check release information. I did this a year or so back so I may not be 100 on this. I was doing alot of threaded process programming and we wanted to see how hard we could push the processor. David Meyer Mike Segel wrote in message <36C83475.508F7981@KING.OF.MY.DOMAIN.Segel.com>... >Processor Affinity isn't a good idea. >It defeats the purpose of SMP and while some may say its the greatest >thing since sliced bread, its like stored proceedures. Use it when >necessary. > >The question is really one of scheduling. >Does SunOS (Solaris) give a scheduling preference to a process thats >been assigned to a specific processor? > >-Mikey >
David Meyer wrote:
>
> Mike,
>
> I tried to do this on an AIX system and it did not
> support it. I found out that some versions of Solaris
On AIX you have to do it by hand (or by script) after IDS has been
started. Look into the bindprocessor command. The following script works
for us:
#!/usr/bin/ksh
. /usr/local/bin/setinformix
MAXCPU=0
/usr/sbin/bindprocessor -q | read rest
while [ "$rest" <> " " ]; do
echo $rest|read MAXCPU rest
done
MAXCPU=`expr $MAXCPU \\+ 1`
echo "Number of CPU's: $MAXCPU"
onstat -g sch | grep cpu | wc | read CPUVPS restecho "Number of CPUVP's: $CPUVPS"
CPUVPS=`expr $CPUVPS \\/ $MAXCPU \\* $MAXCPU`
echo "CPUVP'S to bind: $CPUVPS"
CPU=0
onstat -g sch | grep cpu |while read vp pid rest; do
if [ $CPU -eq $MAXCPU ]; then
CPU=0
fi
if [ $CPUVPS -gt 0 ]; then
echo "binding cpuvp $vp (pid=$pid) to cpu $CPU"
/usr/sbin/bindprocessor $pid $CPU
CPU=`expr $CPU \\+ 1`
CPUVPS=`expr $CPUVPS \\- 1`
fi
done
onstat -g glo | grep cpu
ps -e -o "pid bnd comm" | grep 'oninit' | grep -v -- '- oninit'
> did. My experience is that this is more of a programming
> capability. Where you can kick off threaded processes and
> bind them to a processor. Because of this (for some reason),
> it is only available on specific platforms. I think you have to
> check release information. I did this a year or so back so
> I may not be 100 on this. I was doing alot of threaded process
> programming and we wanted to see how hard we could push
> the processor.
>
> David Meyer
>
> Mike Segel wrote in message
> <36C83475.508F7981@KING.OF.MY.DOMAIN.Segel.com>...
> >Processor Affinity isn't a good idea.
> >It defeats the purpose of SMP and while some may say its the greatest
> >thing since sliced bread, its like stored proceedures. Use it when
> >necessary.
> >
> >The question is really one of scheduling.
> >Does SunOS (Solaris) give a scheduling preference to a process thats
> >been assigned to a specific processor?
> >
> >-Mikey
> >
________________________________________________________________
John H. Frantz Power-4gl: Extending Informix-4gl
john@rl.is http://www.rl.is/~john/pow4gl.html