Re: Intermittent Performance Problem - What does oninit do?
Posted in 2004
The key component of a database server (any one) is, arguably, the
bunch of processes that provide an interface between the application
and the data. In informix, this job is handled by a series of "oninit"
processes.
The amount of cpu used by oninit is directly proportional to the
"work" it has to do. So, if oninit is gobbling up most of your cpu, it
just means that its got tons of stuff to do. Usually, this is a result
of application requests.
Your first step has to be to figure out WHAT oninit is working on.
Chances are that there are one or more SQL statements that are the
hogs - probably a result of a gradually increasing data set.
Use variants of onstat -u & onstat -g sql to home in on the offending
SQL. The following script could help you.
#!/bin/ksh
# chksql.
# without arguments. indicates active users
# with 1 argument (user). indicates what that user is doing
if [ $# != 0 ]; then
if [ $1 != 'all' ]; then
onstat -g ses $1 | more
exit 0
fifi
onstat - | sed "s:.*Version ::" | sed "s: .*::" | grep -q F
BIT64=$?
if [ $BIT64 = 0 ]; then # 64bit version
if [ $# = 0 ]; then
onstat -u | \\ # Select only those that have at least 1 lock (i.e connected
to some DB)
grep -v '^..........................................................................0'
| \\
# Then remove those with a Y flag
grep -v '^.................Y' | \\
# And other junk rows
grep '^.......................-' | sort -n +2
exit 0
fi
if [ $1 = 'all' ]; then
for SESS in `onstat -u | \\
# Select only those that have at least 1 lock (i.e connected
to some DB)
grep -v '^..........................................................................0'
| \\
# Then remove those with a Y flag
grep -v '^.................Y' | \\
# And other junk rows
grep '^.......................-' | awk '{ print $3 }' | sort
-u`
do
onstat -g ses $SESS | more
done
exit
fielse # 32 bit version
if [ $# = 0 ]; then
onstat -u | \\ # Select only those that have at least 1 lock (i.e connected
to some DB)
grep -v '^..........................................................0'
| \\
# Then remove those with a Y flag
grep -v '^.........Y' | \\
# And other junk rows
grep '^...............-' | sort -n +2
exit 0
fi
if [ $1 = 'all' ]; then
for SESS in `onstat -u | \\
# Select only those that have at least 1 lock (i.e connected
to some DB)
grep -v '^..........................................................0'
| \\
# Then remove those with a Y flag
grep -v '^.........Y' | \\
# And other junk rows
grep '^...............-' | awk '{ print $3 }' | sort -u`
do
onstat -g ses $SESS | more
done
exit
fifi