diff --git a/.gitignore b/.gitignore index 5ccf008..34d1996 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +main ion-load-tool *.ivf *.webm diff --git a/main.go b/main.go index a6dc136..f6ad2ca 100644 --- a/main.go +++ b/main.go @@ -18,8 +18,9 @@ func run(e *sdk.Engine, addr, session, file, role string, total, duration, cycle for i := 0; i < total; i++ { switch role { case "pubsub": - log.Infof("pubsub session= %v", session) - c := e.AddClient(addr, session, fmt.Sprintf("%s_%d", session, i)) + cid := fmt.Sprintf("%s_pubsub_%d", session, i) + log.Infof("AddClient session=%v clientid=%v", session, cid) + c := e.AddClient(addr, session, cid) if c == nil { log.Errorf("c==nil") break @@ -27,8 +28,9 @@ func run(e *sdk.Engine, addr, session, file, role string, total, duration, cycle c.Join(session) c.PublishWebm(file) case "sub": - log.Infof("sub session= %v", session) - c := e.AddClient(addr, session, fmt.Sprintf("%s_%d", session, i)) + cid := fmt.Sprintf("%s_sub_%d", session, i) + log.Infof("AddClient session=%v clientid=%v", session, cid) + c := e.AddClient(addr, session, cid) if c == nil { log.Errorf("c==nil") break diff --git a/scripts/conference/conference.sh b/scripts/conference/conference.sh new file mode 100755 index 0000000..957455f --- /dev/null +++ b/scripts/conference/conference.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# please run this script with sudo! +ulimit -c unlimited +ulimit -SHn 1000000 +sysctl -w net.ipv4.tcp_keepalive_time=60 +sysctl -w net.ipv4.tcp_timestamps=0 +sysctl -w net.ipv4.tcp_tw_reuse=1 +#sysctl -w net.ipv4.tcp_tw_recycle=0 +sysctl -w net.core.somaxconn=65535 +sysctl -w net.ipv4.tcp_max_syn_backlog=65535 +sysctl -w net.ipv4.tcp_syncookies=1 + +# please run this script with sudo! +./ion-load-tool -file ./djrm480p.webm -clients 10 -role pubsub -addr "127.0.0.1:8000" -session 'conference' -log debug -cycle 1000 diff --git a/scripts/live/live_pub.sh b/scripts/live/live_pub.sh new file mode 100755 index 0000000..63a89f6 --- /dev/null +++ b/scripts/live/live_pub.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# please run this script with sudo! +ulimit -c unlimited +ulimit -SHn 1000000 +sysctl -w net.ipv4.tcp_keepalive_time=60 +sysctl -w net.ipv4.tcp_timestamps=0 +sysctl -w net.ipv4.tcp_tw_reuse=1 +#sysctl -w net.ipv4.tcp_tw_recycle=0 +sysctl -w net.core.somaxconn=65535 +sysctl -w net.ipv4.tcp_max_syn_backlog=65535 +sysctl -w net.ipv4.tcp_syncookies=1 + +# please run this script with sudo! +./ion-load-tool -file ./djrm480p.webm -clients 1 -role pubsub -addr "127.0.0.1:8000" -session 'live' -log debug -cycle 1000 diff --git a/scripts/live/live_sub.sh b/scripts/live/live_sub.sh new file mode 100755 index 0000000..18bddbe --- /dev/null +++ b/scripts/live/live_sub.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# please run this script with sudo! +ulimit -c unlimited +ulimit -SHn 1000000 +sysctl -w net.ipv4.tcp_keepalive_time=60 +sysctl -w net.ipv4.tcp_timestamps=0 +sysctl -w net.ipv4.tcp_tw_reuse=1 +#sysctl -w net.ipv4.tcp_tw_recycle=0 +sysctl -w net.core.somaxconn=65535 +sysctl -w net.ipv4.tcp_max_syn_backlog=65535 +sysctl -w net.ipv4.tcp_syncookies=1 + +# please run this script with sudo! +./ion-load-tool -file ./djrm480p.webm -clients 100 -role sub -addr "127.0.0.1:8000" -session 'live' -log debug -cycle 1000