Comment 11 for bug 1141781

Revision history for this message
Adam Rigg (adamrigg) wrote : Re: Using Netflix on on netflix-desktop results in a runaway process for Silverlight' s plugin-container

Since the lts-quantal kernel driver is not a complete fix, I started looking into ways of automatically capping the CPU usage to keep the system responsive and to attempt to prevent a runaway process. Turns out that somebody else has already done some really good work in this area:
http://cpulimit.sourceforge.net/

cpulimit is in the standard repositories, and it has some experimental support for child processes. You'd have to use the pid of plugin-container to get it to work in isolation, but going after wineserver works with the experimental support:
cpulimit -e wineserver -l 7

cpulimit will wait in the background for named processes to begin but not with the pid method. The nice thing about going after wineserver with cpulimit, is that you can still use STOP & CONT signals on the child process (i.e., plugin-container). The only real drawback is that the percentage values don't work the same for process groups, so you have to start with a very small %cpu value and work your way up until you get around 24fps (maybe around 10 for a 2.1GHz cpu). Setting the value too small will drag the bitrate down too though if you don't choose it manually from the hidden menu (ctrl+alt+shift+s for the bitrate menu and ctrl+alt+shift+c for the framerate).

It looks like you can distinguish between Linux FF and Wine by plugging `pidof plugin-containe` into the arguments for the pid version of the command. I'm not really sure why it shows up with the 'r' missing or why "killall plugin-container" works with the pidof mismatch.

cpulimit can work pretty well with misbehaving Flash content too.