1

I'm controlling a lot of devices on which i need to batch run commands, it's working just fine sequentially but if i try to run all of them in parallel i'm getting plink network errors.

I'm pretty sure the actual network is doing just fine (it's a gigabit network dedicated to that, Nothing else running, there are 200 devices and the only thing getting send is "sudo reboot" so this hardly generates any traffic.

Is there any limit inherent to ssh or to putty i should know of? I'd like to go faster than doing it sequentially but i'm fine with running it in reasonably sized batches, i'd just rather set that batch size knowing where it's coming from instead of randomly through testing.

Currently i'm doing this:

for /F %i in (MYHOSTLIST.txt) do start plink -pw MYPASSWORD MYLOGIN@%i sudo reboot

This fails with plenty of errors after spawning the expected 200 ish command Windows, removing the start it works just fine but takes forever rebooting the devices in sequence.

24
  • An explanation for the downvote would help me enhance the question Aug 18, 2015 at 14:15
  • This would help to diagnose your issue: Windows version and architecture, Putty version, error details. Aug 19, 2015 at 22:00
  • @beatcracker I was assuming there was a known limit (and not specifically Something to diagnose). It's on Windows 8.1 X64, putty's latest version, i cannot launch the command again at the moment for the exact error detail however it clearly complained about connecting and as the hardware was far from being stressed i concluded to a software limit on concurrent connections. Aug 19, 2015 at 22:05
  • I don't think that there is a connection limit and anyway, 200 simultaneous connections is nothing that OS can't handle. My guess, that it has something to do with plink itself, or the way cmd launches it. You could try to replace plink with cygwin's ssh client and see what happens. Aug 19, 2015 at 22:18
  • @beatcracker Yes i know it's not an OS limitation, i'm wondering if it's an SSH limitation or a putty one but in either case i'm not looking at switching tools nor for a workaround, i'm looking for an actual exact number explaining where the limitation comes from (spec or implementation) to set. I really don't want to "try things", i'm looking for a formal explanation of the limit. Aug 19, 2015 at 22:20

1 Answer 1

1

Likely the same problem described here (including solution): https://stackoverflow.com/questions/17472389/how-to-increase-the-maximum-number-of-child-processes-that-can-be-spawned-by-a-w

I would, however, not recommend spawning that many processes, rather put the parallelism to the individual devices using

for /F %i in (MYHOSTLIST.txt) do plink -pw MYPASSWORD MYLOGIN@%i "nohup sudo reboot &>/dev/null &"

which will still connect serially to all devices, but only to start off the reboot command and then immediately disconnect and move on to the next device.

Other option would be to use a proper operating system to control these Linux devices ;-)

1
  • This doesn't sound like my problem at all, it's even specifically stated the issue only affects Windows services in the answer. Using linux for control is not an option in this case. And rebooting is only one example of script but i need to run arbitrary commands on all of those including sequential command batches where i want to see the output, besides even with nohup it still needs the time to connect to them one by one instead of doing it in parallel. Spawning that many processes in a non issue the computer and os handle it just fine Aug 26, 2015 at 10:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .