How to calculate page size + chksize into bytes, m
Posted in 2010
Christine asked what syschunks' "page size (in units of system default page size)" means and how to convert chksize into MB/GB, saying her arithmetic worked for 2K pages but not 16K ones. Art Kagel explained chksize is a page count and pagesize is in bytes, so bytes = chksize * pagesize, and asked for platform/version and chunk type (raw vs. cooked file, filesystem type), noting filesystem overhead can make file sizes look wrong. John Miller recommended the format_units(chksize,'P') function and showed a test where it correctly reported a 16K-page dbspace matching the file size. No confirmation from the original poster is recorded, so her specific discrepancy is left unresolved.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Storage & Space Management
chknum smallint Chunk number dbsnum smallint Dbspace number nxchknum smallint Number of the next chunk in this dbspace chksize integer Number of pages in this chunk offset integer Page offset of the chunk in its device or path pagesize integer Page size (in units of system default page size) nfree integer Number of free pages in the chunk (in units of system default page size) is_offline integer 1 If the chunk is offline, 0 if not is_recovering integer 1 If the chunk is being recovered, 0 if not is_blobchunk integer 1 If the chunk is in a blobspace, 0 if not is_sbchunk integer 1 If the chunk is a sbspace, 0 if not is_inconsistent integer 1 If the chunk is undergoing logical restore, 0 if not Does anyone know what page size (in units of system default page size) means. I would like to calculate the chunks size in meg and gig. Not have any luck with the 16K page size. Thanks, Christine
Chksize is in pages and pagesize is in bytes, so the size of a 2048byte pagesize chunk with 1000000 pages is 2048000000 bytes or 2000000KB Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) IIUG Board of Directors (art@iiug.org) See you at the 2010 IIUG Informix Conference April 25-28, 2010 Overland Park (Kansas City), KS www.iiug.org/conf Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Wed, Mar 3, 2010 at 5:07 PM, Christine Bizukiewicz < christineb@shubertticketing.com> wrote: > chknum > > smallint > > Chunk number > > dbsnum > > smallint > > Dbspace number > > nxchknum > > smallint > > Number of the next chunk in this dbspace > > chksize > > integer > > Number of pages in this chunk > > offset > > integer > > Page offset of the chunk in its device or path > > pagesize > > integer > > Page size (in units of system default page size) > > nfree > > integer > > Number of free pages in the chunk (in units of system default page size) > > is_offline > > integer > > 1 If the chunk is offline, 0 if not > > is_recovering > > integer > > 1 If the chunk is being recovered, 0 if not > > is_blobchunk > > integer > > 1 If the chunk is in a blobspace, 0 if not > > is_sbchunk > > integer > > 1 If the chunk is a sbspace, 0 if not > > is_inconsistent > > integer > > 1 If the chunk is undergoing logical restore, 0 if not > > Does anyone know what page size (in units of system default page size) > means. > > I would like to calculate the chunks size in meg and gig. Not have any luck > with the 16K page size. > > Thanks, > Christine > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --000e0ce0480ce89d710480ed21ba
This works for size 2048. Does not work for 16K or 16384 bytes times the chksize. -----Original Message----- From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of Art Kagel Sent: Wednesday, March 03, 2010 5:38 PM To: ids@iiug.org Subject: Re: How to calculate page size + chksize into .... [19200] Chksize is in pages and pagesize is in bytes, so the size of a 2048byte pagesize chunk with 1000000 pages is 2048000000 bytes or 2000000KB Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) IIUG Board of Directors (art@iiug.org) See you at the 2010 IIUG Informix Conference April 25-28, 2010 Overland Park (Kansas City), KS www.iiug.org/conf Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Wed, Mar 3, 2010 at 5:07 PM, Christine Bizukiewicz < christineb@shubertticketing.com> wrote: > chknum > > smallint > > Chunk number > > dbsnum > > smallint > > Dbspace number > > nxchknum > > smallint > > Number of the next chunk in this dbspace > > chksize > > integer > > Number of pages in this chunk > > offset > > integer > > Page offset of the chunk in its device or path > > pagesize > > integer > > Page size (in units of system default page size) > > nfree > > integer > > Number of free pages in the chunk (in units of system default page size) > > is_offline > > integer > > 1 If the chunk is offline, 0 if not > > is_recovering > > integer > > 1 If the chunk is being recovered, 0 if not > > is_blobchunk > > integer > > 1 If the chunk is in a blobspace, 0 if not > > is_sbchunk > > integer > > 1 If the chunk is a sbspace, 0 if not > > is_inconsistent > > integer > > 1 If the chunk is undergoing logical restore, 0 if not > > Does anyone know what page size (in units of system default page size) > means. > > I would like to calculate the chunks size in meg and gig. Not have any luck > with the 16K page size. > > Thanks, > Christine > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --000e0ce0480ce89d710480ed21ba ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.
How about you use the new function format_units().
select chknum ,
format_units(chksize,'P') AS size,
format_units(nfree,'P') AS free
from syschunks
OUTPUT
=======
chknum 1
size 542 MB
free 411 MB
John F. Miller III
STSM, Support Architect
miller3@us.ibm.com
503-578-5645
IBM Informix Dynamic Server (IDS)
ids-bounces@iiug.org wrote on 03/03/2010 02:07:42 PM:
> [image removed]
>
> How to calculate page size + chksize into byte.... [19199]
>
> Christine Bizukiewicz
>
> to:
>
> ids
>
> 03/03/2010 02:11 PM
>
> Sent by:
>
> ids-bounces@iiug.org
>
> Please respond to ids
>
> chknum
>
> smallint
>
> Chunk number
>
> dbsnum
>
> smallint
>
> Dbspace number
>
> nxchknum
>
> smallint
>
> Number of the next chunk in this dbspace
>
> chksize
>
> integer
>
> Number of pages in this chunk
>
> offset
>
> integer
>
> Page offset of the chunk in its device or path
>
> pagesize
>
> integer
>
> Page size (in units of system default page size)
>
> nfree
>
> integer
>
> Number of free pages in the chunk (in units of system default page size)
>
> is_offline
>
> integer
>
> 1 If the chunk is offline, 0 if not
>
> is_recovering
>
> integer
>
> 1 If the chunk is being recovered, 0 if not
>
> is_blobchunk
>
> integer
>
> 1 If the chunk is in a blobspace, 0 if not
>
> is_sbchunk
>
> integer
>
> 1 If the chunk is a sbspace, 0 if not
>
> is_inconsistent
>
> integer
>
> 1 If the chunk is undergoing logical restore, 0 if not
>
> Does anyone know what page size (in units of system default page size)
means.
>
> I would like to calculate the chunks size in meg and gig. Not have any
luck
> with the 16K page size.
>
> Thanks,
> Christine
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
It should... What are you seeing? What is the platform? IDS version? Is the chunk a RAW or COOKED device/partition or a filesystem file? If the latter, what kind of filesystem (ie if on Linux is it EXT2, EXT3, EXT4, ZFS, AFS, etc.)? I have a play server on my Linux machine with one of the chunks on an EXT3 filesystem (a bad idea for serious servers BTW - EXT3 is a bad match for database files) and it shows a filesize which is completely out of alignment with the actual size of the chunk that it contains which is a 2K pagesize chunk. IB that this is the EXT3 meta data, logging information, and versioning data which is expanding the file even though IDS never writes beyond the logical 2GB I allocated for that chunk (1000000 pages - just under 2GB actually). The filesize should be something like 2048000000 but it is rather 3745389730. Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) IIUG Board of Directors (art@iiug.org) See you at the 2010 IIUG Informix Conference April 25-28, 2010 Overland Park (Kansas City), KS www.iiug.org/conf Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Wed, Mar 3, 2010 at 6:02 PM, Christine Bizukiewicz < christineb@shubertticketing.com> wrote: > This works for size 2048. Does not work for 16K or 16384 bytes times the > chksize. > > -----Original Message----- > From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of Art > Kagel > Sent: Wednesday, March 03, 2010 5:38 PM > To: ids@iiug.org > Subject: Re: How to calculate page size + chksize into .... [19200] > > Chksize is in pages and pagesize is in bytes, so the size of a 2048byte > > pagesize chunk with 1000000 pages is 2048000000 bytes or 2000000KB > > Art > > Art S. Kagel > > Advanced DataTools (www.advancedatatools.com) > > IIUG Board of Directors (art@iiug.org) > > See you at the 2010 IIUG Informix Conference > > April 25-28, 2010 > > Overland Park (Kansas City), KS > > www.iiug.org/conf > > Disclaimer: Please keep in mind that my own opinions are my own opinions > and > > do not reflect on my employer, Advanced DataTools, the IIUG, nor any other > > organization with which I am associated either explicitly, implicitly, or > by > > inference. Neither do those opinions reflect those of other individuals > > affiliated with any entity with which I am affiliated nor those of the > > entities themselves. > > On Wed, Mar 3, 2010 at 5:07 PM, Christine Bizukiewicz < > > christineb@shubertticketing.com> wrote: > > > chknum > > > > > > smallint > > > > > > Chunk number > > > > > > dbsnum > > > > > > smallint > > > > > > Dbspace number > > > > > > nxchknum > > > > > > smallint > > > > > > Number of the next chunk in this dbspace > > > > > > chksize > > > > > > integer > > > > > > Number of pages in this chunk > > > > > > offset > > > > > > integer > > > > > > Page offset of the chunk in its device or path > > > > > > pagesize > > > > > > integer > > > > > > Page size (in units of system default page size) > > > > > > nfree > > > > > > integer > > > > > > Number of free pages in the chunk (in units of system default page size) > > > > > > is_offline > > > > > > integer > > > > > > 1 If the chunk is offline, 0 if not > > > > > > is_recovering > > > > > > integer > > > > > > 1 If the chunk is being recovered, 0 if not > > > > > > is_blobchunk > > > > > > integer > > > > > > 1 If the chunk is in a blobspace, 0 if not > > > > > > is_sbchunk > > > > > > integer > > > > > > 1 If the chunk is a sbspace, 0 if not > > > > > > is_inconsistent > > > > > > integer > > > > > > 1 If the chunk is undergoing logical restore, 0 if not > > > > > > Does anyone know what page size (in units of system default page size) > > > means. > > > > > > I would like to calculate the chunks size in meg and gig. Not have any > luck > > > with the 16K page size. > > > > > > Thanks, > > > Christine > > > > > > > > > > > > > > > > ******************************************************************************* > > > Forum Note: Use "Reply" to post a response in the discussion forum. > > > > > > > > --000e0ce0480ce89d710480ed21ba > > > > ******************************************************************************* > > Forum Note: Use "Reply" to post a response in the discussion forum. > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --0015174790c67f2bf50480edf189
I just ran a small test case and it appear to work for my 16KB page
dbspace.
execute function sysadmin:task("create dbspace", "dbs2","$INFORMIXDIR/dbs2","25 MB",0,"16K");
select chknum ,
format_units(chksize,'P') AS size,
format_units(nfree,'P') AS free
from sysmaster:syschunks;
OUTPUT
=======
(expression) Space 'dbs2' added.
chknum 1
size 542 MB
free 411 MB
chknum 3
size 25.0 MB
free 24.6 MB
OUTPUT OF ls
============
ls -l $INFORMIXDIR/dbs2
-rw-rw---- 1 informix informix 26214400 Mar 3 16:18 dbs2
John F. Miller III
STSM, Support Architect
miller3@us.ibm.com
503-578-5645
IBM Informix Dynamic Server (IDS)
ids-bounces@iiug.org wrote on 03/03/2010 03:36:00 PM:
> [image removed]
>
> Re: How to calculate page size + chksize into .... [19204]
>
> Art Kagel
>
> to:
>
> ids
>
> 03/03/2010 03:37 PM
>
> Sent by:
>
> ids-bounces@iiug.org
>
> Please respond to ids
>
> It should... What are you seeing? What is the platform? IDS version? Is
> the chunk a RAW or COOKED device/partition or a filesystem file? If the
> latter, what kind of filesystem (ie if on Linux is it EXT2, EXT3, EXT4,
ZFS,
> AFS, etc.)? I have a play server on my Linux machine with one of the
chunks
> on an EXT3 filesystem (a bad idea for serious servers BTW - EXT3 is a bad
> match for database files) and it shows a filesize which is completely out
of
> alignment with the actual size of the chunk that it contains which is a
2K
> pagesize chunk. IB that this is the EXT3 meta data, logging information,
> and versioning data which is expanding the file even though IDS never
writes
> beyond the logical 2GB I allocated for that chunk (1000000 pages - just
> under 2GB actually). The filesize should be something like 2048000000 but
> it is rather 3745389730.
>
> Art
>
> Art S. Kagel
> Advanced DataTools (www.advancedatatools.com)
> IIUG Board of Directors (art@iiug.org)
>
> See you at the 2010 IIUG Informix Conference
> April 25-28, 2010
> Overland Park (Kansas City), KS
> www.iiug.org/conf
>
> Disclaimer: Please keep in mind that my own opinions are my own opinions
and
> do not reflect on my employer, Advanced DataTools, the IIUG, nor any
other
> organization with which I am associated either explicitly, implicitly, or
by
> inference. Neither do those opinions reflect those of other individuals
> affiliated with any entity with which I am affiliated nor those of the
> entities themselves.
>
> On Wed, Mar 3, 2010 at 6:02 PM, Christine Bizukiewicz <
> christineb@shubertticketing.com> wrote:
>
> > This works for size 2048. Does not work for 16K or 16384 bytes times
the
> > chksize.
> >
> > -----Original Message-----
> > From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of
Art
> > Kagel
> > Sent: Wednesday, March 03, 2010 5:38 PM
> > To: ids@iiug.org
> > Subject: Re: How to calculate page size + chksize into .... [19200]
> >
> > Chksize is in pages and pagesize is in bytes, so the size of a 2048byte
> >
> > pagesize chunk with 1000000 pages is 2048000000 bytes or 2000000KB
> >
> > Art
> >
> > Art S. Kagel
> >
> > Advanced DataTools (www.advancedatatools.com)
> >
> > IIUG Board of Directors (art@iiug.org)
> >
> > See you at the 2010 IIUG Informix Conference
> >
> > April 25-28, 2010
> >
> > Overland Park (Kansas City), KS
> >
> > www.iiug.org/conf
> >
> > Disclaimer: Please keep in mind that my own opinions are my own
opinions
> > and
> >
> > do not reflect on my employer, Advanced DataTools, the IIUG, nor any
other
> >
> > organization with which I am associated either explicitly, implicitly,
or
> > by
> >
> > inference. Neither do those opinions reflect those of other individuals
> >
> > affiliated with any entity with which I am affiliated nor those of the
> >
> > entities themselves.
> >
> > On Wed, Mar 3, 2010 at 5:07 PM, Christine Bizukiewicz <
> >
> > christineb@shubertticketing.com> wrote:
> >
> > > chknum
> >
> > >
> >
> > > smallint
> >
> > >
> >
> > > Chunk number
> >
> > >
> >
> > > dbsnum
> >
> > >
> >
> > > smallint
> >
> > >
> >
> > > Dbspace number
> >
> > >
> >
> > > nxchknum
> >
> > >
> >
> > > smallint
> >
> > >
> >
> > > Number of the next chunk in this dbspace
> >
> > >
> >
> > > chksize
> >
> > >
> >
> > > integer
> >
> > >
> >
> > > Number of pages in this chunk
> >
> > >
> >
> > > offset
> >
> > >
> >
> > > integer
> >
> > >
> >
> > > Page offset of the chunk in its device or path
> >
> > >
> >
> > > pagesize
> >
> > >
> >
> > > integer
> >
> > >
> >
> > > Page size (in units of system default page size)
> >
> > >
> >
> > > nfree
> >
> > >
> >
> > > integer
> >
> > >
> >
> > > Number of free pages in the chunk (in units of system default page
size)
> >
> > >
> >
> > > is_offline
> >
> > >
> >
> > > integer
> >
> > >
> >
> > > 1 If the chunk is offline, 0 if not
> >
> > >
> >
> > > is_recovering
> >
> > >
> >
> > > integer
> >
> > >
> >
> > > 1 If the chunk is being recovered, 0 if not
> >
> > >
> >
> > > is_blobchunk
> >
> > >
> >
> > > integer
> >
> > >
> >
> > > 1 If the chunk is in a blobspace, 0 if not
> >
> > >
> >
> > > is_sbchunk
> >
> > >
> >
> > > integer
> >
> > >
> >
> > > 1 If the chunk is a sbspace, 0 if not
> >
> > >
> >
> > > is_inconsistent
> >
> > >
> >
> > > integer
> >
> > >
> >
> > > 1 If the chunk is undergoing logical restore, 0 if not
> >
> > >
> >
> > > Does anyone know what page size (in units of system default page
size)
> >
> > > means.
> >
> > >
> >
> > > I would like to calculate the chunks size in meg and gig. Not have
any
> > luck
> >
> > > with the 16K page size.
> >
> > >
> >
> > > Thanks,
> >
> > > Christine
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> >
> >
> >
>
*******************************************************************************
> >
> > > Forum Note: Use "Reply" to post a response in the discussion forum.
> >
> > >
> >
> > >
> >
> > --000e0ce0480ce89d710480ed21ba
> >
> >
> >
> >
>
*******************************************************************************
> >
> > Forum Note: Use "Reply" to post a response in the discussion forum.
> >
> >
> >
> >
>
*****************************************