Search code examples
parallel-processingsftpgnujmeter-pluginsgnu-parallel

GNU Parallel as alternative to JMeter SSH sampler for SFTP testing for several users in separates threads


Has anyone created a script for connection testing sftp for multi users in separate threads?

I have an issue with JMeter and I'm trying to make an alternative to SSH sampler. I'm going to create a simple script to connect the SFTP and execute a "ls" command. Currently I try to use GNU parallel(Thanks @Barmar). This command works fine:

parallel < list.txt

I created a list.txt with a list of commands:

sftp -i /rsa_key user@sftp_url.com <<< ls
sftp -i /rsa_key2 user2@sftp_url.com <<< ls
...
sftp -i /rsa_keyX userX@sftp_url.com <<< ls

But still I'm limited by the number of my physical cores. Is it possible to make 100+ requests at the same time by different threads?


Solution

  • Any reason you cannot do:

    parallel -j100 < list.txt
    

    or:

    parallel --colsep ' ' -j100 'sftp -i {1} {2}@sftp_url.com <<< ls' < list.txt
    

    with list.txt containing:

    /rsa_key user
    /rsa_keyX userX