Skip to content
This repository has been archived by the owner on Feb 20, 2021. It is now read-only.

Commit

Permalink
add scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
adwpc committed Jan 23, 2021
1 parent fcb948c commit 911389e
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
main
ion-load-tool
*.ivf
*.webm
Expand Down
10 changes: 6 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,19 @@ 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
}
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
Expand Down
14 changes: 14 additions & 0 deletions scripts/conference/conference.sh
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions scripts/live/live_pub.sh
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions scripts/live/live_sub.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 911389e

Please sign in to comment.