[Live-devel] RTSP Server: fluctuating CPU usage

Aeschbacher Fabrice Fabrice.Aeschbacher at siemens.com
Mon Oct 17 15:02:18 PDT 2005


Hi,

I have an RTSP Server written with LIVE555 Streaming Media. It is
streaming 6 video inputs (H263), reading directly from the device
(/dev/videoxxx).

The server is working pretty well. But what bothers me is the fact that
its CPU usage is not stable, and is rather fluctuating over the time.
See below a typical output of 'top' :

# top -d3 -p `pidof RTSPserver` | grep RTSPserver
 1194 root       9   0  3696 3692 2424 S  7.3  1.5  14:24.22 RTSPserver
 1194 root      10   0  3696 3692 2424 S  6.0  1.5  14:24.40 RTSPserver
 1194 root       9   0  3696 3692 2424 D  3.0  1.5  14:24.49 RTSPserver
 1194 root       9   0  3696 3692 2424 S  5.0  1.5  14:24.64 RTSPserver
 1194 root       9   0  3696 3692 2424 S  5.7  1.5  14:24.81 RTSPserver
 1194 root      12   0  3696 3692 2424 S  3.0  1.5  14:24.90 RTSPserver
 1194 root      18   0  3696 3692 2424 S  4.0  1.5  14:25.02 RTSPserver
 1194 root      16   0  3696 3692 2424 D  1.3  1.5  14:25.06 RTSPserver
 1194 root      17   0  3696 3692 2424 S  4.3  1.5  14:25.19 RTSPserver
 1194 root      17   0  3696 3692 2424 R  4.0  1.5  14:25.31 RTSPserver
 1194 root      17   0  3696 3692 2424 S  2.0  1.5  14:25.37 RTSPserver
 1194 root      15   0  3696 3692 2424 R 12.0  1.5  14:25.73 RTSPserver
 1194 root      18   0  3696 3692 2424 D 23.0  1.5  14:26.42 RTSPserver
 1194 root      18   0  3696 3692 2424 R 38.0  1.5  14:27.56 RTSPserver
 1194 root      17   0  3696 3692 2424 S 19.7  1.5  14:28.15 RTSPserver
 1194 root      15   0  3696 3692 2424 S 27.3  1.5  14:28.97 RTSPserver
 1194 root      18   0  3696 3692 2424 S 33.0  1.5  14:29.96 RTSPserver
 1194 root      16   0  3696 3692 2424 S 27.3  1.5  14:30.78 RTSPserver
 1194 root      14   0  3696 3692 2424 S  5.3  1.5  14:30.94 RTSPserver
 1194 root      15   0  3696 3692 2424 S  4.3  1.5  14:31.07 RTSPserver
 1194 root      16   0  3696 3692 2424 S  2.3  1.5  14:31.14 RTSPserver
 1194 root      14   0  3696 3692 2424 S  3.3  1.5  14:31.24 RTSPserver
 1194 root      18   0  3696 3692 2424 S  1.3  1.5  14:31.28 RTSPserver
 1194 root      15   0  3696 3692 2424 S  5.0  1.5  14:31.43 RTSPserver
 1194 root      16   0  3696 3692 2424 S  4.3  1.5  14:31.56 RTSPserver
 1194 root      19   0  3696 3692 2424 S  3.0  1.5  14:31.65 RTSPserver
 1194 root      16   0  3696 3692 2424 S  5.0  1.5  14:31.80 RTSPserver
 1194 root      15   0  3696 3692 2424 S  1.7  1.5  14:31.85 RTSPserver
 1194 root      14   0  3696 3692 2424 S 13.7  1.5  14:32.26 RTSPserver
 1194 root      17   0  3696 3692 2424 S 31.0  1.5  14:33.19 RTSPserver
 1194 root      18   0  3696 3692 2424 S 39.3  1.5  14:34.16 RTSPserver
 1194 root      18   0  3696 3692 2424 S 16.0  1.5  14:34.64 RTSPserver
 1194 root      17   0  3696 3692 2424 S 11.7  1.5  14:34.99 RTSPserver
 1194 root      20   0  3696 3692 2424 R 19.7  1.5  14:35.58 RTSPserver
 1194 root      18   0  3696 3692 2424 R 26.0  1.5  14:36.36 RTSPserver
 1194 root      19   0  3696 3692 2424 S 34.3  1.5  14:37.39 RTSPserver
 1194 root      14   0  3696 3692 2424 S 13.3  1.5  14:37.79 RTSPserver
 1194 root      15   0  3696 3692 2424 S  2.3  1.5  14:37.86 RTSPserver
 1194 root      19   0  3696 3692 2424 S  5.3  1.5  14:38.02 RTSPserver
 1194 root      14   0  3696 3692 2424 D  2.3  1.5  14:38.09 RTSPserver
 1194 root      15   0  3696 3692 2424 S  4.3  1.5  14:38.22 RTSPserver
 1194 root       9   0  3696 3692 2424 S  4.0  1.5  14:38.34 RTSPserver
 1194 root       9   0  3696 3692 2424 S  2.3  1.5  14:38.41 RTSPserver
 1194 root       9   0  3696 3692 2424 S  5.3  1.5  14:38.57 RTSPserver
 1194 root      10   0  3696 3692 2424 D  5.0  1.5  14:38.72 RTSPserver
 1194 root      11   0  3696 3692 2424 R 20.3  1.5  14:39.33 RTSPserver
 1194 root      15   0  3696 3692 2424 R 24.7  1.5  14:40.07 RTSPserver
 1194 root      17   0  3696 3692 2424 R 49.7  1.5  14:40.96 RTSPserver
 1194 root      11   0  3696 3692 2424 S 18.0  1.5  14:41.50 RTSPserver
 1194 root      14   0  3696 3692 2424 R 12.0  1.5  14:41.86 RTSPserver
 1194 root       9   0  3696 3692 2424 S  6.7  1.5  14:42.06 RTSPserver
 1194 root      10   0  3696 3692 2424 S  4.3  1.5  14:42.19 RTSPserver
 1194 root      12   0  3696 3692 2424 S 12.0  1.5  14:42.55 RTSPserver
 1194 root      12   0  3696 3692 2424 S 24.7  1.5  14:43.29 RTSPserver
 1194 root       9   0  3696 3692 2424 S 22.0  1.5  14:43.95 RTSPserver
 1194 root      10   0  3696 3692 2424 S  6.7  1.5  14:44.15 RTSPserver
 1194 root      14   0  3696 3692 2424 R  3.3  1.5  14:44.25 RTSPserver
 1194 root      16   0  3696 3692 2424 S  2.7  1.5  14:44.33 RTSPserver
 1194 root      18   0  3696 3692 2424 S  4.7  1.5  14:44.47 RTSPserver
 1194 root      14   0  3696 3692 2424 S  2.7  1.5  14:44.55 RTSPserver
 1194 root      19   0  3696 3692 2424 S  3.7  1.5  14:44.66 RTSPserver
 1194 root      15   0  3696 3692 2424 S  4.7  1.5  14:44.80 RTSPserver
 1194 root      19   0  3696 3692 2424 S 23.3  1.5  14:45.50 RTSPserver
 1194 root      18   0  3696 3692 2424 S 33.7  1.5  14:46.51 RTSPserver
 1194 root      16   0  3696 3692 2424 S 23.3  1.5  14:47.21 RTSPserver
 1194 root      18   0  3696 3692 2424 S 12.7  1.5  14:47.59 RTSPserver
 1194 root      14   0  3696 3692 2424 D  8.7  1.5  14:47.85 RTSPserver
 1194 root      19   0  3696 3692 2424 S  5.7  1.5  14:48.02 RTSPserver
 1194 root      14   0  3696 3692 2424 S  4.3  1.5  14:48.15 RTSPserver

As you can see (CPU% = 9th column), the CPU usage is absolutely not
constant.

Did someone already observe the same behaviour?
nb: I'm using the default BasicTaskScheduler, and a kernel 2.4.21

Best Regards,
Fabrice Aeschbacher



More information about the live-devel mailing list