[Pkg-xen-devel] Bug#961511: Bug#961511: xen-utils-common: Protect xenstored/xenconsoled against OOM

Hans van Kranenburg hans at knorrie.org
Sun Sep 6 22:06:58 BST 2020


Hi,

On 5/25/20 3:18 PM, Samuel Thibault wrote:
> Samuel Thibault, le lun. 25 mai 2020 15:11:44 +0200, a ecrit:
>> I'm currently using a hack such as
>>
>>         for i in $(pgrep xenconsoled) ; do
>>                 echo -1000 > /proc/$i/oom_score_adj
>>         done
>>
>> in /etc/init.d/xen, but there are cleaner ways to do this :)
> 
> For instance, using choom:
> 
> 	start-stop-daemon --start --quiet --pidfile "$XENCONSOLED_PIDFILE" --exec /usr/bin/choom -- \
> 		-n -1000 "$XENCONSOLED" $XENCONSOLED_ARGS --pid-file "$XENCONSOLED_PIDFILE" \

That's a nice idea! Especially for xenstored, because it only keeps
state in memory.

xenconsoled can be started again if it's ever oom killed. so, I'd like
to limit this to xenstored only.

E.g. in my situation at work, it's mostly openvswitch that gets killed
first, if there's really a situation in which something has to go. If I
can choose between that (which disrupts vm traffic) or xenconsoled
(which does not impact customer stuff directly), then I'd rather see the
last one go temporarily.

I had to insert another -- before $XENCONSOLED_ARGS to actually make it
work.

After reboot:

-# grep . /proc/$(pidof /usr/lib/xen-4.14/bin/oxenstored)/oom_*
/proc/7478/oom_adj:-17
/proc/7478/oom_score:0
/proc/7478/oom_score_adj:-1000

Hans



More information about the Pkg-xen-devel mailing list