Negative pages read in chunk
Posted in 2016
User observed negative page-read counts in syschktab while onstat -D showed positive values. Root cause: the pagesread column is a signed 32-bit integer that overflowed after reaching 2,147,483,647, causing subsequent counts to display as negative numbers. Solution: use a conversion function to reinterpret the signed integer bit pattern as unsigned.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Storage & Space Management, Versions, Editions & End-of-Life
I have some system monitoring that captures pages read from each chunk. This
is simply "select fname, pagesread from syschktab"
For the most active chunk in the instance this statement returns a large
negative number (-1,181,472,262). However an onstat -D returns a larger
positive number (3,113,496,195).
Other chunks in the instance report the same numbers.
This is on version 11.50
Can anyone tell me what is going on here? Is there some magic to turn the
syschktab data to the same data returned by onstat -D?
Sounds like a rollover, after a certain amount of incrementing, your
positive number becomes negative.
j.
On 9/12/16 4:11 PM, RAY BURNS wrote:
> I have some system monitoring that captures pages read from each chunk. This
> is simply "select fname, pagesread from syschktab"
> For the most active chunk in the instance this statement returns a large
> negative number (-1,181,472,262). However an onstat -D returns a larger
> positive number (3,113,496,195).
>
> Other chunks in the instance report the same numbers.
>
> This is on version 11.50
>
> Can anyone tell me what is going on here? Is there some magic to turn the
> syschktab data to the same data returned by onstat -D?
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
Unless you're facing a bug which I never noticed, you're probably seeing
the nasty effect of some internal counters being too small for some
instance activity and uptime (I'm assuming your uptime is good...)
The fact that in one place you see a number and on the other you see
another may be "only" a display issue.
The larget number we can store in 32 bit unsigned is 4.294.967.295. But
this same number if interpreted as a signed number is -1. In fact, for a
signed number the maximum we can store in 32 bit is:2147483647. If we add 1
we get -2147483648. If we keep adding it will become less negative.
The difference between 2147483647 and 1,181,472,262 is roughly 966011386
which is roughly how much you need to add to 2147483648 to get to 3113496195
Confusing? It just means the engine keeps a 64 bit counter but in some
places it's showing as an integer (32 bit) which makes it negative.
I do recall some fields in sysmaster were changed from INT to INT8 because
of this.
All this discussion was already explained... my purpose is to try to show
you that from my perspective looking at the accumulated values (when then
get so big) becomes meaningless... I always recommend to customers to reset
the counters on a daily base and if possible store them and keep some
history. That allows you to get some pretty graphics, show up anomalous
days, or make some pattern change more evident. And this normally also
solves the wrap around of the counters.
Regards
On Mon, Sep 12, 2016 at 10:11 PM, RAY BURNS <ray.burns@velocityglobal.co.nz>
wrote:
> I have some system monitoring that captures pages read from each chunk.
> This
> is simply "select fname, pagesread from syschktab"
> For the most active chunk in the instance this statement returns a large
> negative number (-1,181,472,262). However an onstat -D returns a larger
> positive number (3,113,496,195).
>
> Other chunks in the instance report the same numbers.
>
> This is on version 11.50
>
> Can anyone tell me what is going on here? Is there some magic to turn the
> syschktab data to the same data returned by onstat -D?
>
>
> ************************************************************
> *******************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--
Fernando Nunes
Portugal
http://informix-technology.blogspot.com
My email works... but I don't check it frequently...
--001a113dd5267b4dbf053c55df0a
blockquote, div.yahoo_quoted { margin-left: 0 !important; border-left:1px
#715FFA solid !important; padding-left:1ex !important; background-color:white
!important; } It is the issue of using a signed int vrs an unsigned int. If
you place the bit pattern for 3,113,496,195 into a signed 32 bit integer you
would get -1,181,471,100, which is roughly what you got. The 'bug' is that
pages read is defined to be an integer as there is no unsigned integer SQL
data type.
Sent from Yahoo Mail for iPad
On Monday, September 12, 2016, 3:11 PM, RAY BURNS
<ray.burns@velocityglobal.co.nz> wrote:
I have some system monitoring that captures pages read from each chunk. This
is simply "select fname, pagesread from syschktab"
For the most active chunk in the instance this statement returns a large
negative number (-1,181,472,262). However an onstat -D returns a larger
positive number (3,113,496,195).
Other chunks in the instance report the same numbers.
This is on version 11.50
Can anyone tell me what is going on here? Is there some magic to turn the
syschktab data to the same data returned by onstat -D?
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.
If you want, you could use the following to convert the bit pattern of an
integer into an bigint as though the integer were an unsigned integer....
create function itol(val int) returning bigintdefine t bigint;
if (val is null) then
LET t = 2147483647;
LET t = t + 1;
elif val > -1 then
LET t = val;
else
LET t = BITAND(val, 2147483647) + 2147483647;
LET t = t + 1;
end if
return t;
end function;
Madison Pruet
Retired and Loving it
On Monday, September 12, 2016 5:03 PM, Madison Pruet <madison_pruet@yahoo.com>
wrote:
#yiv8964042333 blockquote, #yiv8964042333 div.yiv8964042333yahoo_quoted
{margin-left:0 !important;border-left:1px #715FFA solid
!important;padding-left:1ex !important;background-color:white;} It is the
issue of using a signed int vrs an unsigned int. If you place the bit pattern
for 3,113,496,195 into a signed 32 bit integer you would get -1,181,471,100,
which is roughly what you got. The 'bug' is that pages read is defined to be
an integer as there is no unsigned integer SQL data type.
Sent from Yahoo Mail for iPad
On Monday, September 12, 2016, 3:11 PM, RAY BURNS
<ray.burns@velocityglobal.co.nz> wrote:
I have some system monitoring that captures pages read from each chunk. This
is simply "select fname, pagesread from syschktab"
For the most active chunk in the instance this statement returns a large
negative number (-1,181,472,262). However an onstat -D returns a larger
positive number (3,113,496,195).
Other chunks in the instance report the same numbers.
This is on version 11.50
Can anyone tell me what is going on here? Is there some magic to turn the
syschktab data to the same data returned by onstat -D?
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.
Many thanks for your responses. That has done the trick.
Related threads
- IDS 10 table-level restore
- Informix Development Webinar December 11, 2007
- ontape -p/r with changed ROOTPATH
- Migrate from HP PA-RISC to HP ITANIUM by ontape