cpu time
Posted in 2003
A user on HP-UX (8 CPUs, NUMCPUVPS=7, affinity to 2 processors) saw onstat CPU times heavily skewed toward the lower-numbered CPU VPs and asked how to balance them, or whether to cut NUMCPUVPS to match the affinity count. Respondents explained this is normal: IDS doesn't time-slice or load-balance, and its scheduler wakes the lowest-numbered idle VP first, so low VPs always look busier; poll threads (NETTYPE) running on CPU VPs can add to the skew. It's harmless if the work is handled, and load evens out on busy systems; concern is only warranted if all VPs have non-empty ready queues while total CPU use stays well below NUMCPUVPS, which would be a bug for support. No single fix was adopted.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Platform-Specific Issues
I've been observing a machine with IDS and application on same HP-UX platform. The machine has 8 cpu, Informix affinity to 2 processors and with numcpuvps=7. The total cpu time for 1cpu and 3cpu vp-classes are so much very very high compared to 4cpu-8cpu classes. Is there a way to balance this cpu times to all the cpu vp-classes? Or should I reduce numcpuvps to number of processor affinity?
----- Original Message -----
From: "EML" <edmund.lajara@nokia.com>
To: <ids@iiug.org>
Sent: Tuesday, May 20, 2003 13:46
Subject: cpu time [1180]
> I've been observing a machine with IDS and application on same HP-UX
platform. The machine has 8
cpu, Informix affinity to 2 processors and with numcpuvps=7. The total cpu
time for 1cpu and 3cpu
vp-classes are so much very very high compared to 4cpu-8cpu classes. Is there
a way to balance this
cpu times to all the cpu vp-classes?
I am assuming that you are talking about the output from onstat -g glo
Individual virtual processors:
vp pid class usercpu syscpu total
1 9472 cpu 31989.75 3159.96 35149.71
6 9533 cpu 36517.61 3034.44 39552.05
7 9534 cpu 23462.22 1989.40 25451.62
8 9535 cpu 14229.90 1244.63 15474.53
9 9536 cpu 6024.03 530.89 6554.92
10 9537 cpu 2245.29 237.51 2482.80
11 9538 cpu 828.60 104.20 932.80
I think Informix uses cpu based on how much one cpu is loaded. So cpu2 will
not get job unless
cpu1 is busy at the time of assiging task. similarly cpu3 will not get a job
unless cpu2 is doing
something.
So, one will always find, lower numbered cpuvps to do more task than higher
numbered cpuvps.
I think nothing can be done to balance it.
> Or should I reduce numcpuvps to number of processor affinity?
may be this can be an option.
This may have to do with affinity, but may also have to do with poll threads. Check the NETTYPE config parameter to see how many poll threads you have of the type that is used to connect most often, and to see if they run on CPU VP's. This is the way we have it, and we always see x CPU VP's much more active than the others where x is the number of poll threads we have configured. --John Bejarano. Informix DBA, Shutterfly. --- EML <edmund.lajara@nokia.com> wrote: > I've been observing a machine with IDS and > application on same HP-UX platform. The machine has > 8 cpu, Informix affinity to 2 processors and with > numcpuvps=7. The total cpu time for 1cpu and 3cpu > vp-classes are so much very very high compared to > 4cpu-8cpu classes. Is there a way to balance this > cpu times to all the cpu vp-classes? > > Or should I reduce numcpuvps to number of processor > affinity? >
I have always felt that IDS doesn't attempt to load balance work assigned to CPUVPS (or other VPS for that matter). The observation you are seeing (some CPUVPS "busier" than others) has been true since early v7. We don't do scheduling, pre-emption, or time-slicing. Threads will sit in a ready queue until a yielding thread grabs it off, switches the context(s), and now the new thread runs. Anyone else? HTH - Mark Mark Scranton Principal Consultant/Teacher IBM Denver IBM Software Group - Data Management Office: 303-773-5067 Cell: 303-929-0914 email: mscranto@us.ibm.com
On systems that are not busy this is true. THe "master" process appears to be used by default. This scenario appears to have changed by 9.30. If you only need 1 CPUVP to do most of the work and it can handle it, then it does not matter. In busy systems I have observed the sharing to be more even. MW > -----Original Message----- > From: forum.subscriber@iiug.org [mailto:forum.subscriber@iiug.org]On > Behalf Of Mark Scranton > Sent: Thursday, 22 May 2003 3:04 a.m. > To: ids@iiug.org > Subject: Re: cpu time [1196] > > > I have always felt that IDS doesn't attempt to load balance > work assigned > to CPUVPS (or other VPS for that matter). The observation you > are seeing > (some CPUVPS "busier" than others) has been true since early > v7. We don't > do scheduling, pre-emption, or time-slicing. Threads will sit > in a ready > queue until a yielding thread grabs it off, switches the > context(s), and > now the new thread runs. > > Anyone else? > > HTH - > Mark > > Mark Scranton > Principal Consultant/Teacher > IBM Denver > > IBM Software Group - Data Management > Office: 303-773-5067 > Cell: 303-929-0914 > email: mscranto@us.ibm.com > > > >
I don't
think this has changed in 7.3. Ifxmaillist@quanta.co.nz do you
have any indication for that?.
It's perfectly normal and I think it's even desirable. If less oninit
processes can handle the workload, the os and memory cache overhead may
be less.
Don't forget that vps are processes, not physical cpus. Even if you bind
vps to cpus, this does (hopefully, may depend on how it's done) not mean
that the cpu does not run anything else even if it's bound oninit goes idle.
The reason for this behavior is the scheduling algorithm used by online.
If a thread becomes runnable and some vps are idle, the scheduler tends
to wake up the vp with the lowest number.
What I think is critical in this context is a situation where all vps
are busy with non empty ready queues, but the overall usage per second
is much less then NUMCPUVPS seconds (if you have external poll vps etc.
with a high cpu usage you have to count these too). This should not
happen (but it has). If it does, you can add more cpu vps than you have
cpus. But you also should talk to support because its a performance bug.
Michael
Mark Scranton wrote:
> I have always felt that IDS doesn't attempt to load balance work assigned
> to CPUVPS (or other VPS for that matter). The observation you are seeing
> (some CPUVPS "busier" than others) has been true since early v7. We don't
> do scheduling, pre-emption, or time-slicing. Threads will sit in a ready
> queue until a yielding thread grabs it off, switches the context(s), and
> now the new thread runs.
>
> Anyone else?
>
> HTH -
> Mark
>
> Mark Scranton
> Principal Consultant/Teacher
> IBM Denver
>
> IBM Software Group - Data Management
> Office: 303-773-5067
> Cell: 303-929-0914
> email: mscranto@us.ibm.com
>
>
>
>
>
--
=== Michael Mueller ==================
Tel. + 49 8171 63600
Fax. + 49 8171 63615
Web: http://www.mm.kay-mueller.de
http://www.planets.kay-mueller.de
======================================
I don't
think this has changed in 7.3. Ifxmaillist@quanta.co.nz do you
have any indication for that?.
It's perfectly normal and I think it's even desirable. If less oninit
processes can handle the workload, the os and memory cache overhead may
be less.
Don't forget that vps are processes, not physical cpus. Even if you bind
vps to cpus, this does (hopefully, may depend on how it's done) not mean
that the cpu does not run anything else even if it's bound oninit goes idle.
The reason for this behavior is the scheduling algorithm used by online.
If a thread becomes runnable and some vps are idle, the scheduler tends
to wake up the vp with the lowest number.
What I think is critical in this context is a situation where all vps
are busy with non empty ready queues, but the overall usage per second
is much less then NUMCPUVPS seconds (if you have external poll vps etc.
with a high cpu usage you have to count these too). This should not
happen (but it has). If it does, you can add more cpu vps than you have
cpus. But you also should talk to support because its a performance bug.
Michael
Mark Scranton wrote:
> I have always felt that IDS doesn't attempt to load balance work
assigned
> to CPUVPS (or other VPS for that matter). The observation you are seeing
> (some CPUVPS "busier" than others) has been true since early v7. We
don't
> do scheduling, pre-emption, or time-slicing. Threads will sit in a ready
> queue until a yielding thread grabs it off, switches the context(s), and
> now the new thread runs.
>
> Anyone else?
>
> HTH -
> Mark
>
> Mark Scranton
> Principal Consultant/Teacher
> IBM Denver
>
> IBM Software Group - Data Management
> Office: 303-773-5067
> Cell: 303-929-0914
> email: mscranto@us.ibm.com
>
>
>
>
>
--
=== Michael Mueller ==================
Tel. + 49 8171 63600
Fax. + 49 8171 63615
Web: http://www.mm.kay-mueller.de
http://www.planets.kay-mueller.de
======================================
Our 9.30 on an under-used machine has 2 CPUVP's
(and 2 CPU's). The use is
relatively even. On the same server 7.31 (was upgraded) the use of each
oninit was very uneven.
MW
> -----Original Message-----
> From: Michael Mueller [mailto:michael.mueller@kay-mueller.de]
> Sent: Monday, 26 May 2003 6:12 p.m.
> To: ids@iiug.org
> Cc: Mark Scranton; ifxmaillist@quanta.co.nz
> Subject: Re: cpu time [1196]
>
>
> I don't think this has changed in 7.3. Ifxmaillist@quanta.co.nz do you
> have any indication for that?.
>
> It's perfectly normal and I think it's even desirable. If less oninit
> processes can handle the workload, the os and memory cache
> overhead may
> be less.
>
> Don't forget that vps are processes, not physical cpus. Even
> if you bind
> vps to cpus, this does (hopefully, may depend on how it's
> done) not mean
> that the cpu does not run anything else even if it's bound
> oninit goes idle.
>
> The reason for this behavior is the scheduling algorithm used
> by online.
> If a thread becomes runnable and some vps are idle, the
> scheduler tends
> to wake up the vp with the lowest number.
>
> What I think is critical in this context is a situation where all vps
> are busy with non empty ready queues, but the overall usage per second
> is much less then NUMCPUVPS seconds (if you have external
> poll vps etc.
> with a high cpu usage you have to count these too). This should not
> happen (but it has). If it does, you can add more cpu vps
> than you have
> cpus. But you also should talk to support because its a
> performance bug.
>
>
> Michael
>
>
>
>
>
> Mark Scranton wrote:
> > I have always felt that IDS doesn't attempt to load
> balance work assigned
> > to CPUVPS (or other VPS for that matter). The observation
> you are seeing
> > (some CPUVPS "busier" than others) has been true since
> early v7. We don't
> > do scheduling, pre-emption, or time-slicing. Threads will
> sit in a ready
> > queue until a yielding thread grabs it off, switches the
> context(s), and
> > now the new thread runs.
> >
> > Anyone else?
> >
> > HTH -
> > Mark
> >
> > Mark Scranton
> > Principal Consultant/Teacher
> > IBM Denver
> >
> > IBM Software Group - Data Management
> > Office: 303-773-5067
> > Cell: 303-929-0914
> > email: mscranto@us.ibm.com
> >
> >
> >
> >
> >
>
>
> --
>
> === Michael Mueller ==================
> Tel. + 49 8171 63600
> Fax. + 49 8171 63615
> Web: http://www.mm.kay-mueller.de
> http://www.planets.kay-mueller.de
> ======================================
>
>
I am
not sure how to explain that. It's just 2 cpus and what happens
depends on scheduling and timing details. Some minor change in your
application or in the online server might be responsible for this.
With 9.30.UC3 on an 8 cpu Solaris8 machine with 8 cpu vps and this
client started 3 times:
while :
do
dbaccess sysmaster <<eof >/dev/null 2>&1
select count(*) from syscolumns a, syscolumns b; eof
done
i got this:
Individual virtual processors:
vp pid class usercpu syscpu total
1 17027 cpu 6.08 0.00 6.08
2 17028 adm 0.00 0.00 0.00
3 17029 cpu 78.30 0.00 78.30
4 17030 cpu 72.06 0.00 72.06
5 17031 cpu 76.67 0.01 76.68
6 17032 cpu 4.49 0.00 4.49
7 17033 cpu 0.00 0.00 0.00
8 17034 cpu 0.00 0.00 0.00
9 17035 cpu 0.00 0.00 0.00
10 17036 lio 0.00 0.00 0.00
11 17037 pio 0.00 0.00 0.00
12 17038 aio 0.00 0.00 0.00
13 17039 msc 0.01 0.00 0.01
14 17040 tli 0.00 0.00 0.00
tot 237.61 0.01 237.62
The funny thing in this example is that my threads avoid running on cpu 1.
Quanta Infxlist wrote:
> Our 9.30 on an under-used machine has 2 CPUVP's (and 2 CPU's). The
use is
> relatively even. On the same server 7.31 (was upgraded) the use of each
> oninit was very uneven.
>
> MW
>
>
>>-----Original Message-----
>>From: Michael Mueller [mailto:michael.mueller@kay-mueller.de]
>>Sent: Monday, 26 May 2003 6:12 p.m.
>>To: ids@iiug.org
>>Cc: Mark Scranton; ifxmaillist@quanta.co.nz
>>Subject: Re: cpu time [1196]
>>
>>
>>I don't think this has changed in 7.3. Ifxmaillist@quanta.co.nz do you
>>have any indication for that?.
>>
>>It's perfectly normal and I think it's even desirable. If less oninit
>>processes can handle the workload, the os and memory cache
>>overhead may
>>be less.
>>
>>Don't forget that vps are processes, not physical cpus. Even
>>if you bind
>>vps to cpus, this does (hopefully, may depend on how it's
>>done) not mean
>>that the cpu does not run anything else even if it's bound
>>oninit goes idle.
>>
>>The reason for this behavior is the scheduling algorithm used
>>by online.
>>If a thread becomes runnable and some vps are idle, the
>>scheduler tends
>>to wake up the vp with the lowest number.
>>
>>What I think is critical in this context is a situation where all vps
>>are busy with non empty ready queues, but the overall usage per second
>>is much less then NUMCPUVPS seconds (if you have external
>>poll vps etc.
>>with a high cpu usage you have to count these too). This should not
>>happen (but it has). If it does, you can add more cpu vps
>>than you have
>>cpus. But you also should talk to support because its a
>>performance bug.
>>
>>
>>Michael
>>
>>
>>
>>
>>
>>Mark Scranton wrote:
>> > I have always felt that IDS doesn't attempt to load
>>balance work assigned
>> > to CPUVPS (or other VPS for that matter). The observation
>>you are seeing
>> > (some CPUVPS "busier" than others) has been true since
>>early v7. We don't
>> > do scheduling, pre-emption, or time-slicing. Threads will
>>sit in a ready
>> > queue until a yielding thread grabs it off, switches the
>>context(s), and
>> > now the new thread runs.
>> >
>> > Anyone else?
>> >
>> > HTH -
>> > Mark
>> >
>> > Mark Scranton
>> > Principal Consultant/Teacher
>> > IBM Denver
>> >
>> > IBM Software Group - Data Management
>> > Office: 303-773-5067
>> > Cell: 303-929-0914
>> > email: mscranto@us.ibm.com
>> >
>> >
>> >
>> >
>> >
>>
>>
>>--
>>
>>=== Michael Mueller ==================
>>Tel. + 49 8171 63600
>>Fax. + 49 8171 63615
>>Web: http://www.mm.kay-mueller.de
>> http://www.planets.kay-mueller.de
>>======================================
>>
>>
>
>
>
>
--
=== Michael Mueller ==================
Tel. + 49 8171 63600
Fax. + 49 8171 63615
Web: http://www.mm.kay-mueller.de
http://www.planets.kay-mueller.de
======================================
Related threads
- Posting from the Informix-list
- Migrating from IDS 9.40.UC6 to 11.50.UC3
- Ip for a network session
- questions onstat -g