You havn't really showed what you are doing, but 1 simple enhancement would be to zip(tar) all the files going to a certain server, so you are only sending a single file to it (instead of 50+). Then log in again, and unpack the file. That would reduce each server transaction to 1 file receive, and a ssh2 logon to unpack it. It may be possible to do it all with a single SSH2 session with shell usage, but it may be easier to do it in a 2 step design.