Adding niceness to container processes

163 views
Skip to first unread message

Jörg Sommer

unread,
Sep 22, 2023, 9:05:03 AM9/22/23
to kas-...@googlegroups.com
Hello,

having one or two `kas-container build` running might slow down your system. The Linux kernel has some knobs to tell that processes should run on lower priority. Unfortunately, Docker has no options to change these settings, which makes support from container-entrypoint necessary. Would a patch like this and the necessary adaptions in kas-container get accepted?

@@ -63,6 +63,14 @@
      cd /builder || exit 1
 fi
 
+if [ -n "$KAS_NICE" ]; then
+     unset KAS_NICE
+     ionice -c 3 -p $$ >/dev/null
+     chrt --batch -p $$ >/dev/null
+     choom -n 1000 -p $$ >/dev/null
+     renice -n 10 -p $$ >/dev/null
+fi
+
 if [ -n "$1" ]; then
      case "$1" in
      build|checkout|dump|for-all-repos|menu|shell|-*)

Kind regards

Jörg Sommer

Software Developer / Programmierer

-- 

Navimatix GmbH

Tatzendpromenade 2

07745 Jena  

T: 03641 - 327 99 0

F: 03641 - 526 306

M: joerg.sommer@navimatix.de

www.navimatix.de


Geschäftsführer: Steffen Späthe, Jan Rommeley

Registergericht: Amtsgericht Jena, HRB 501480



- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


Diese E-Mail könnte vertrauliche und/oder rechtlich geschützte Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet.


This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.


Jan Kiszka

unread,
Sep 22, 2023, 11:24:42 AM9/22/23
to Jörg Sommer, kas-...@googlegroups.com
On 22.09.23 15:04, 'Jörg Sommer' via kas-devel wrote:
> Hello,
>
> having one or two `kas-container build` running might slow down your
> system. The Linux kernel has some knobs to tell that processes should
> run on lower priority. Unfortunately, Docker has no options to change
> these settings, which makes support from container-entrypoint necessary.

Already tried

docker update --cpu-shared X <my-container>?

I'm using this for freeing some cores from time to time:

docker update --cpus N <my-container>

Jan

--
Siemens AG, Technology
Linux Expert Center

Jörg Sommer

unread,
Oct 5, 2023, 10:41:22 AM10/5/23
to Jan Kiszka, kas-...@googlegroups.com
On 22 September 2023 17:24, Jan Kiszka wrote:
> On 22.09.23 15:04, 'Jörg Sommer' via kas-devel wrote:
> > Hello,
> >
> > having one or two `kas-container build` running might slow down your
> > system. The Linux kernel has some knobs to tell that processes should
> > run on lower priority. Unfortunately, Docker has no options to change
> > these settings, which makes support from container-entrypoint necessary.
>
> Already tried
>
> docker update --cpu-shared X <my-container>?

Today I ran a test with three `kas-container --runtime-args '--cpu-shares=512' build`. After half an hour of working, I reniced the container processes and the system got more responsive, especially the mouse pointer doesn't jump no longer and switching windows was smoother.

Jörg Sommer

--
Navimatix GmbH

Reply all
Reply to author
Forward
0 new messages