Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maximum of 10 concurrent sessions #226

Open
bavobbr opened this issue Mar 8, 2017 · 0 comments
Open

Maximum of 10 concurrent sessions #226

bavobbr opened this issue Mar 8, 2017 · 0 comments

Comments

@bavobbr
Copy link

bavobbr commented Mar 8, 2017

Due to executeBackground being removed I implemented every execute command in its own session. This however only executes up to 10 sessions at once, and starts the others when others finish. This looks like some fixed threadpool at work.

I can not find a way to increase the pool size, as I need 7 x 2 x 2 (28) commands to be running (used for specific traffic generation over a periods of hours)

Request: allow to customize the number of concurrent sessions, or advise on how to do parallel commands differently

Environment info

jsch:0.1.53
groovy-ssh:2.8.0
groovy-all:2.4.9

Steps to reproduce

Create more than 10 session in a single run command, expect them to be executed in parallel.

def ssh = ssh.createService()
ssh.remotes {
    cs {
        delegate.host = csMgmt
    }
    cpe {
        delegate.host = modemMgmt
    }
}

def dscps = [0, 46, 47, 48, 50, 51, 52]
println "Starting ssh sessions to send receive dscps $dscps betweem $modem and $csIp"
ssh.run {
    dscps.eachWithIndex { int entry, int index ->
        session(ssh.remotes.cs) {
            def cmd = "/usr/bin/ITGRecv -Sp ${29090 + index} -Si ens3 -l /home/xxx/output_${entry}.bbr"
            println "-> Receiving at CS for $entry: $cmd"
            execute(cmd) { def result -> println result }
        }
    }
    dscps.eachWithIndex { int entry, int index ->
        session(ssh.remotes.cpe) {
            sleep 5000
            def cmd = "/usr/bin/ITGSend -Sda ${csMgmt} -a ${csIp} -C ${packetRate + index} -c ${packetSize / 8 + entry} -T UDP -b ${entry * 4} -t ${time} -Sdp ${29090 + index} -rp ${29090 + index}"
            println "-> Sending for CPE dscp $entry: $cmd"
            execute(cmd) { def result -> println result }
            sleep 10000
            execute("killall ITGRecv") { def result -> println result }
        }
    }
    dscps.eachWithIndex { int entry, int index ->
        session(ssh.remotes.cpe) {
            def cmd = "/usr/bin/ITGRecv -Sp ${29190 + index} -Si eth1 -l /home/xxx/output_${entry}.bbr"
            println "-> Receiving at CPE for $entry: $cmd"
            execute(cmd) { def result -> println result }
        }
    }
    dscps.eachWithIndex { int entry, int index ->
        session(ssh.remotes.cs) {
            sleep 5000
            def addr = modem.sharedSubnetNetworkConfigurations[0].ipv4.configurations.toList().first().address
            def cmd = "/usr/bin/ITGSend -Sda ${addr} -a ${addr} -C ${packetRate + index} -c ${packetSize / 8 + entry} -T UDP -b ${entry * 4} -t ${time} -Sdp ${29190 + index} -rp ${29190 + index}"
            println "-> Sending for CS dscp $entry: $cmd"
            execute(cmd) { def result -> println result }
            sleep 10000
            execute("killall ITGRecv") { def result -> println result }
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant