Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
eferreyra wanted a free-memory percentage from sysmaster:sysseglst but got a wrong number. Art Kagel proposed multiplying seg_blkfree by 4096 and using 100*blkfree/(blkused+blkfree). eferreyra said his values were off and asked where 4096 comes from. Jason Harris said blocks are always 4k and gave seg_blkfree/(seg_blkused+seg_blkfree)*100, plus seg_size/(blkused+blkfree) for block size.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Hi, have found this query for get the IDS free memory, first 2 terms shows ok, but i tried to add the third, i want the PCT (%) of free memory, but shows bad number:
SELECT format_units(sum(seg_size)) as ifx_memory_allocated,
format_units(sum(seg_blkfree),4) as ifx_memory_free,
(sum(seg_blkfree) * 100) / sum(seg_size) as pct_free
FROM sysmaster:sysseglst
What is wrong ?
example:
ifx_memory_allocated ifx_memory_free pct_free
11.0 GB 4.37 GB 0.0097323743318829246144932703449505
↪ replying to eferreyra
Art Kagel — — source: Usenet: comp.databases.informix
Try this one:
SELECT format_units(sum(seg_size)) as ifx_memory_allocated,
format_units(sum(seg_blkfree * 4096),4) as ifx_memory_free,
(100 * sum(seg_blkfree)) / sum((seg_blkused + seg_blkfree)) as
pct_free
FROM sysmaster:sysseglst;
Art
Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
Blog: http://informix-myview.blogspot.com/
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 Mon, Oct 29, 2012 at 3:06 PM, eferreyra <eferreyra@gmail.com> wrote:
> Hi, have found this query for get the IDS free memory, first 2 terms shows
> ok, but i tried to add the third, i want the PCT (%) of free memory, but
> shows bad number:
>
> SELECT format_units(sum(seg_size)) as ifx_memory_allocated,
> format_units(sum(seg_blkfree),4) as ifx_memory_free,
> (sum(seg_blkfree) * 100) / sum(seg_size) as pct_free
> FROM sysmaster:sysseglst
>
> What is wrong ?
>
> example:
> ifx_memory_allocated ifx_memory_free pct_free
> 11.0 GB 4.37 GB
> 0.0097323743318829246144932703449505
>
> _______________________________________________
> Informix-list mailing list
> Informix-list@iiug.org
> http://www.iiug.org/mailman/listinfo/informix-list
>
Hi Art, it didnt returned the second correct value correct:
272 MB 254 GB 23.32802204900736402394384393437
Anyway 4096 its the number i was missing in my query, can i get it form sysmaster too ?
The only 4096 i can find is os_pagesize in sysmachines table.
This is my current full statement then, gives correct values for your system ?
SELECT format_units(sum(seg_size)) as ifx_memory_allocated,
format_units(sum(seg_blkused),4) as ifx_memory_used,
format_units(sum(seg_blkfree),4) as ifx_memory_free,
format_units(sum(os_mem_total)) as os_memory_total,
format_units(sum(os_mem_free)) as os_memory_free,
(((sum(seg_blkfree)/sum(seg_size)) * min(os_pagesize)) * 100) as ifx_free_pct,
((sum(os_mem_free)/sum(os_mem_total)) * 100) as os_free_pct
from sysmaster:sysseglst, sysmaster:sysmachineinfo;
↪ replying to eferreyra
Jason Harris — — source: Usenet: comp.databases.informix
Hi,
Your numbers look ok, only because you are on a 4k page size operating system, and one memory block is always 4k.
I use this to calculate free percent:
seg_blkfree/(seg_blkused+seg_blkfree)*100
I use this to determine the number of bytes in each block:
seg_size/(seg_blkused+seg_blkfree)
HTH,
Jason
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.