Skip to content

v1_EN_RaspberryPi

winlin edited this page Jan 6, 2022 · 22 revisions

HOME > EN > RaspberryPi

Performance benchmark for SRS on RaspberryPi

SRS can running on armv6(RaspberryPi) or armv7(Android). The bellow data show the performance benchmark.

Install SRS

Download the binary for armv6 from Github or SRS Server

RaspberryPi

The hardware of raspberrypi:

  • RaspberryPi:Type B
  • SoC BroadcomBCM2835(CPU,GPU,DSP,SDRAM,USB)
  • CPU ARM1176JZF-S(ARM11) 700MHz
  • GPU Broadcom VideoCore IV, OpenGL ES 2.0, 1080p 30 h.264/MPEG-4 AVC decoder
  • RAM 512MByte
  • USB 2 x USB2.0
  • VideoOutput Composite RCA(PAL&NTSC), HDMI(rev 1.3&1.4), raw LCD Panels via DSI 14 HDMI resolution from 40x350 to 1920x1200 plus various PAL and NTSC standards
  • AudioOutput 3.5mm, HDMI
  • Storage SD/MMC/SDIO socket
  • Network 10/100 ethernet
  • Device 8xGPIO, UART, I2C, SPI bus, +3.3V, +5V, ground(nagetive)
  • Power 700mA(3.5W) 5V
  • Size 85.60 x 53.98 mm(3.370 x 2.125 in)
  • OS Debian GNU/linux, Fedora, Arch Linux ARM, RISC OS, XBMC

Software:

  • RaspberryPi img:2014-01-07-wheezy-raspbian.img
  • uname: Linux raspberrypi 3.10.25+ #622 PREEMPT Fri Jan 3 18:41:00 GMT 2014 armv6l GNU/Linux
  • cpu: arm61
  • Server: srs 0.9.38
  • ServerType: raspberry pi
  • Clientsrs-bench
  • ClientType: Virtual Machine Centos6
  • Play: PC win7, flash
  • Network: 100Mbps

Stream information:

  • Video Bitrate: 200kbps
  • Resolution: 768x320
  • Audio Bitrate: 30kbps

For arm SRS: arm

OS settings

Login as root, set the fd limits:

  • Set limit: ulimit -HSn 10240
  • View the limit:
[root@dev6 ~]# ulimit -n
10240
  • Restart SRS:sudo /etc/init.d/srs restart

Publish and Play

Use centos to publish to SRS:

  • Start FFMPEG:
for((;;)); do \
    ./objs/ffmpeg/bin/ffmpeg \
        -re -i doc/source.200kbps.768x320.flv \
        -acodec copy -vcodec copy \
        -f flv -y rtmp://192.168.1.105:1935/live/livestream; \
    sleep 1; 
done

* Play RTMP: `rtmp://192.168.1.105:1935/live/livestream`
* Online Play: [Online Player](http://ossrs.net/srs.release/trunk/research/players/srs_player.html?server=192.168.1.105&port=1935&app=live&stream=livestream&vhost=192.168.1.105&autostart=true)

## Client

The RTMP load test tool, read [srs-bench](https://github.com/ossrs/srs-bench)

The sb_rtmp_load used to test RTMP load, support 800-3k concurrency for each process.

* Build: `./configure && make`
* Start: `./objs/sb_rtmp_load -c 800 -r <rtmp_url>`

## Record Data

Record data before test:

* The cpu for SRS:

```bash
pid=`ps aux|grep srs|grep objs|awk '{print $2}'` && top -p $pid
  • The cpu for srs-bench:
pid=`ps aux|grep load|grep rtmp|awk '{print $2}'` && top -p $pid
  • The connections:
for((;;)); do \
    srs_connections=`sudo netstat -anp|grep 1935|grep ESTABLISHED|wc -l`;  \
    echo "srs_connections: $srs_connections";  \
    sleep 5;  \
done
  • The bandwidth in NBps:
[winlin@dev6 ~]$ dstat 30
----total-cpu-usage---- -dsk/total- -net/lo- ---paging-- ---system--
usr sys idl wai hiq siq| read  writ| recv  send|  in   out | int   csw 
  0   0  96   0   0   3|   0     0 |1860B   58k|   0     0 |2996   465 
  0   1  96   0   0   3|   0     0 |1800B   56k|   0     0 |2989   463 
  0   0  97   0   0   2|   0     0 |1500B   46k|   0     0 |2979   461 
  • The table
Server CPU Mem Conn ENbps ANbps sb Lat
SRS 1.0% 3MB 3 - - - 0.8s

Memory(Mem): The memory usage for server.

Clients(Conn): The cocurrency connections to server.

ExpectNbps(ENbps): The expect network bandwidth in Xbps.

ActualNbps(ANbps): The actual network bandwidth in Xbps.

Benchmark SRS 0.9.38

Let's start performance benchmark.

  • The data for 10 clients:
./objs/sb_rtmp_load -c 10 -r rtmp://192.168.1.105:1935/live/livestream >/dev/null &
Server CPU Mem Conn ENbps ANbps sb Lat
SRS 17% 1.4MB 11 2.53Mbps 2.6Mbps 1.3% 1.7s
  • The data for 20 clients:
Server CPU Mem Conn ENbps ANbps sb Lat
SRS 23% 2MB 21 4.83Mbps 5.5Mbps 2.3% 1.5s
  • The data for 30 clients:
Server CPU Mem Conn ENbps ANbps sb Lat
SRS 50% 4MB 31 7.1Mbps 8Mbps 4% 2s

The summary for RaspberryPi Type B, 230kbps performance:

Server CPU Mem Conn ENbps ANbps sb Lat
SRS 17% 1.4MB 11 2.53Mbps 2.6Mbps 1.3% 1.7s
SRS 23% 2MB 21 4.83Mbps 5.5Mbps 2.3% 1.5s
SRS 50% 4MB 31 7.1Mbps 8Mbps 4% 2s

Benchmark SRS 0.9.72

The benchmark for RTMP SRS 0.9.72.

Server CPU Mem Conn ENbps ANbps sb Lat
SRS 5% 2MB 2 1Mbps 1.2Mbps 0% 1.5s
SRS 20% 2MB 12 6.9Mbps 6.6Mbps 2.8% 2s
SRS 36% 2.4MB 22 12.7Mbps 12.9Mbps 2.3% 2.5s
SRS 47% 3.1MB 32 18.5Mbps 18.5Mbps 5% 2.0s
SRS 62% 3.4MB 42 24.3Mbps 25.7Mbps 9.3% 3.4s
SRS 85% 3.7MB 52 30.2Mbps 30.7Mbps 13.6% 3.5s

cubieboard benchmark

No data.

Winlin 2014.11

Welcome to SRS wiki!

SRS 5.0 wiki

Please select your language:

SRS 4.0 wiki

Please select your language:

SRS 3.0 wiki

Please select your language:

SRS 2.0 wiki

Please select your language:

SRS 1.0 wiki

Please select your language:

Clone this wiki locally