<br><tt><font size=2>Freenx-knx-bounces@kde.org wrote on 18/10/2011 11:07:52:<br>
<br>
> Hi all,<br>
> <br>
> I did some workaround to achieve a "quick and dirty" fix
to this problem.<br>
> It assumes that a zombie session is composed of a single kded4 process
<br>
> that stays alone, and that this situation will never appear in another
<br>
> situation (I'm not sure of that, but it seems to be true).<br>
</font></tt>
<br><tt><font size=2>Well . . .</font></tt>
<br>
<br><tt><font size=2>If a user logs out then logs in again, they will leave
an</font></tt>
<br><tt><font size=2>orphaned kded4 (they are not really zombies) which
may be</font></tt>
<br><tt><font size=2>taking a whole CPU core to 100%.</font></tt>
<br><tt><font size=2>A few users logging in and out can stop the whole
machine</font></tt>
<br><tt><font size=2>this way</font></tt>
<br><tt><font size=2>and</font></tt>
<br><tt><font size=2>can certainly stop you logging in remotely to deal
with it.</font></tt>
<br>
<br>
<br><tt><font size=2>The way you designed your script, counting processes
by</font></tt>
<br><tt><font size=2>username only every hour, you will miss almost all
of these</font></tt>
<br><tt><font size=2>because</font></tt>
<br><tt><font size=2>your script needs to run after log out and before
re-login</font></tt>
<br>
<br>
<br><tt><font size=2>So</font></tt>
<br><tt><font size=2>I recommend you use the startkde /usr/shutdown/kded4
pkill</font></tt>
<br><tt><font size=2>script anyway, which will deal with all orphaned kded4
at</font></tt>
<br><tt><font size=2>user logout (except where startkde doesn't complete).</font></tt>
<br>
<br><tt><font size=2>(if a user is logged in more than once running kde,</font></tt>
<br><tt><font size=2>their other sessions will loose their kded4 too,</font></tt>
<br><tt><font size=2>but we don't allow that sort of thing here)</font></tt>
<br>
<br>
<br>
<br>
<br>
<br><tt><font size=2>If you want to run another cron script besides,</font></tt>
<br><tt><font size=2>then my advice is to look for any kded4 using</font></tt>
<br><tt><font size=2>at 90%+ CPU . .  ..</font></tt>
<br>
<br><tt><font size=2>** this being I think the main issue here **</font></tt>
<br>
<br><tt><font size=2> . . . and kill it (it won't matter if the user</font></tt>
<br><tt><font size=2>is still logged in)</font></tt>
<br>
<br>
<br><tt><font size=2>Though I haven't had kded4 using a lot of cpu</font></tt>
<br><tt><font size=2>I have had serious issues with other runaways,</font></tt>
<br><tt><font size=2>even during an active user session</font></tt>
<br><tt><font size=2>(the hp python printer applet being a prime offender</font></tt>
<br><tt><font size=2>but also from firefox with multimedia, acroread,</font></tt>
<br><tt><font size=2>even dolphin)</font></tt>
<br>
<br>
<br><tt><font size=2>So all my multi user app-sever machines now run a</font></tt>
<br><tt><font size=2>renice script every 3 mins which renices 20/ionices
-n7</font></tt>
<br><tt><font size=2>everything which is running at 95%+ and has used way</font></tt>
<br><tt><font size=2>more total CPU than I expect from the program during</font></tt>
<br><tt><font size=2>a user session.</font></tt>
<br>
<br><tt><font size=2>90% CPU use soon clocks up an a huge number.</font></tt>
<br>
<br><tt><font size=2>This allows me to keep control of remote machines</font></tt>
<br><tt><font size=2>'cos I can always still ssh into them, and</font></tt>
<br><tt><font size=2>the users never see the servers permanently</font></tt>
<br><tt><font size=2>locking up anymore either.</font></tt>
<br>
<br>