Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

i have some webserver around and to manage the cluster i sometimes use script which open automatically the connections &/| sync files to them using python scripts, i've found a weird problem and i don't really know how to fix it..

to reproduce test case you should have a remote destination which doesn't do the connection immediatly (not in LAN & not localhost ) and the connection should run without asking for password ( using keyfiles)

i'm on fedora 16 pc, servers have centos 5 , s120 & s121 -- are 2 severs i own with ip assigned in /etc/hosts to s121 & s120

this is a sample command which open 9 connections to s120 + 9 connection to s121 in the same shell at the same time.. AND IT WORKS!

gnome-terminal --tab -e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s121;\"" --tab -e "bash -c \"ssh root@s121;\"" --tab -e "bash -c \"ssh root@s121;\"" --tab -e "bash -c \"ssh root@s121;\"" --tab -e "bash -c \"ssh root@s121;\"" --tab -e "bash -c \"ssh root@s121;\"" --tab -e "bash -c \"ssh root@s121;\"" --tab -e "bash -c \"ssh root@s121;\"" --tab -e "bash -c \"ssh root@s121;\""

this command TRY to open 15 connections on the same shell all 15 TO-> s120

gnome-terminal --tab -e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s120;\"" --tab -e "bash -c \"ssh root@s120;\""

and it will attemp to open 15, but almost immediatly 5 tabs close themself and only 10 connections are opened,

this problem also happen in terminal_xfce (which i prefer beucase i've found gnome-terminal a bit less stable)

seems that more than 10 concurrent opening connections are not allowed,

if i open 10 tabs, and wait to the connections started, then i can open another terminal with 10 tabs to same server,

(i want also to say that this tests results are the same with IPTABLES firewalls disabled on both client and servers )

i have also to say that this issue is annoying expecially on lsyncd and rsync execution while syncronizing multiple destination on filesystem into the same server it provided unexpected results because connections are terminated by the OS , the terminal test-case is just the simplier to reproduce even if the less problematic to handle ;)

please if someone have suggestion help me ! :)

Thank you, Francesco

share|improve this question

2 Answers 2

If all your connections are going to be using scripted commands... why use the gnome-terminal tabs? You're using lots of resources which you really don't need, and which may be contributing to the limiting factors you're experiencing.

You should be able to get almost (for your purposes) unlimited number of connections if you'll let the system handle the connections instead of forcing gnome-terminal to step in.

for a in $( seq 1 50 ); do
  ssh root@s120 my_cool_script &
  ssh root@s121 my_cool_script &
done
wait

This should create 100 connections (50 to s120, 50 to s121) within seconds, all running '*my_cool_script*'. As long as whatever you're doing is scripted, it'll proceed nicely.

The 'wait' command causes the script there to wait for all the backgrounded jobs to complete before it continues. You may not need/want that.

(plus it's a WHOLE lot less typing...)

share|improve this answer

Look for MaxStartups in /etc/ssh/sshd_config.

  • It limits the unauthorized concurrent logins to sshd.

  • The default is 10.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.