Thanks guys. And yes Andres - I need to start gathering (again) what's in swap when it's being consumed. This doesn't happen in prod much but more frequently in test/dev ... and you know how we typically handle those boxes ... "when we get around to it." But this has been a prod issue years ago, and mostly just bugs me and I'm curious for future use perhaps.
Original Message:
Sent: Mon January 22, 2024 11:11 AM
From: Andreas Legner
Subject: Check if buffers are in swap?
Hi Mark,
as you might guess from https://www.ibm.com/support/pages/apar/IC76872, this can result, on AIX, from Informix resident segments competing with OS KAIO for 'pinnable' memory, i.e. memory that can be fixed in RAM (I think it mainly needs to match certain alignment criteria).
Since Informix has no way to anticipate those pinnable memory resources (there might be other Informix instances, other shared memory users, other activities using pinned memory, etc....), it warns the user that ... bad things have already happened due to running out of this resource (AIX apparently doing a sub-optimal job at making sure it reserves was it needs itself).
If, on the other hand, you're confident your AIX lpar always has sufficient memory reserves, you should be safe using Informix RESIDENT setting. Also, remember this isn't a boolean (ON or OFF), but you always can say "this many shmem segments resident, please".
Then, I also remember having been told that AIX is good enough at memory management and won't even need setting shared memory segments resident - but the experience you're citing seems to indicate to the contrary?
Lastly, maybe going for large/huge memory pages would avoid this whole discussion (as such memory would be exempt from swapping anyway.)
And very lastly: you haven't even indicated that the swapping incurred by those systems affects Informix (performance wise) or even occurs to Informix shared memory? What else could be consuming memory? What exactly is incurring "out of swap"?
BR,
Andreas
------------------------------
Andreas Legner
Original Message:
Sent: Mon January 22, 2024 10:22 AM
From: Mark Scranton
Subject: Check if buffers are in swap?
Art -
I have a client whose boxes end up with "out of swap" condition(s) often. Haven't tracked down (yet) what's in swap, but realized they have RESIDENT = 0 on all engines. Changing that and bouncing the engine:
WARNING: Shared-memory residency is enabled while direct I/O and KAIO (kernel
asynchronous I/O) are active.
This configuration could lead to runtime KAIO errors, which might shut down the
instance or set chunks offline.
Set the RESIDENT configuration parameter to 0 to turn off shared-memory
residency, and then restart the database server. Refer to the machine notes
and APAR IC76872 for more information.
Platform is AIX 7.2, IDS 12.10.FC12W1.
Thanks!
Mark
------------------------------
Thanks!
Mark Scranton
The Mark Scranton Group
mark@markscranton.com
Original Message:
Sent: Wed January 10, 2024 08:10 AM
From: Art Kagel
Subject: Check if buffers are in swap?
Marc:
You should be setting RESIDENT to -1. Setting it to '1' only sets the initial resident segment and the first virtual segment to be non-swappable while the message and buffer cache segments will still be swappable. Setting RESIDENT to '-1' will set all shared memory segments to non-swabbable including buffer cache segments and any added virtual segments (message segments, unfortunately, are not marked as non-swappable which can slow local shared memory connections).
Art
------------------------------
Art S. Kagel, President and Principal Consultant
ASK Database Management Corp.
www.askdbmgt.com
Original Message:
Sent: Wed January 10, 2024 07:59 AM
From: Marc Demhartner
Subject: Check if buffers are in swap?
Yes, RESIDENT 1 is set.
I also think buffers were in swap. I deactiaved swap totally and its even faster as before now. Not much, but a bit.
Problem is solved, but strange situation.
------------------------------
Marc Demhartner
Original Message:
Sent: Tue January 09, 2024 10:07 AM
From: Andreas Legner
Subject: Check if buffers are in swap?
It's typically not oninit process memory that's getting swapped, but rather allocated shared memory, and this you can protect from swapping by setting it resident - this is the purpose of the RESIDENT onconfig parameter.
HTH,
Andreas
------------------------------
Andreas Legner
Original Message:
Sent: Tue January 02, 2024 07:59 AM
From: Marc Demhartner
Subject: Check if buffers are in swap?
Thanks.
Looks like its the case.. i have many entries there with oninit 4784 KB
How to prevent oninit to get swapped?
------------------------------
Marc Demhartner
Original Message:
Sent: Mon January 01, 2024 01:16 PM
From: Hrvoje Zokovic
Subject: Check if buffers are in swap?
Hello,
you can find swap usage by process with (as root ofc):
for x in /proc/*/status; do grep -q VmSwap $x && awk '/VmSwap|Name/{printf $2 " " $3}END{ print ""}' $x ; done | sort -k 2 -n -r | less
Informix processes are oninit so all of those should have 0 usage.
HTH
Hrvoje
------------------------------
Hrvoje Zokovic
Original Message:
Sent: Sun December 31, 2023 07:50 AM
From: Marc Demhartner
Subject: Check if buffers are in swap?
Hello,
maybe last question of 2023 :-)
I noticed slow downs during last week in our single instance on RHEL8 - i suspect storage (SAN) speed slowdowns, but not totally sure.
Also maybe swap oocured with oninit processes ? How can i check to verify this ?
Thanks and good start for 2024!
------------------------------
Marc Demhartner
------------------------------