Ask Your Question

ssh an openstack instance is too slow

asked 2019-01-16 05:13:44 -0500

najeh gravatar image

when i tried to access an openstack instance using " ssh -i mykey.pem ubuntu@192.168.x.x" is too slow takes hours to realize the demand.

Where is the problem and how can i solve it ?

edit retag flag offensive close merge delete



Possible cause: A failing DNS lookup. There is an option in sshd_config that disables the DNS lookup, or you can configure DNS.

In my experience, Fedora is slow, Ubuntu is much better. I have not explored why.

Bernd Bausch gravatar imageBernd Bausch ( 2019-01-16 05:52:31 -0500 )edit

i'm already working with ubuntu and in my sshd_config the DNS lookup is disabled GSSAPIAuthentication=no and also UseDNS no

but i still have the problem.

najeh gravatar imagenajeh ( 2019-01-16 07:16:10 -0500 )edit

Have you debugged (ssh -v user@target) at which point the ssh connection stops? You can use '-v' multiple times to increase verbosity: ssh -vvv user@target

eblock gravatar imageeblock ( 2019-01-16 08:52:54 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2019-11-14 07:43:45 -0500

Stephen C gravatar image

There are a few possible explanations for slow SSH connection establishment. The two most likely ones for an Openstack instance are these:

  • It is possible that it is caused by a misconfigured DNS. Apparently sshd by default will attempt to do a reverse DNS lookup on the IP address. If DNS is not working for the instance, the DNS lookup needs to timeout before sshd will continue.

  • It is possible that the instance is short of entropy. sshd typically uses /dev/random relatively heavily when starting up and each time a connection is being established. On a typical system, /dev/random consumes entropy from a pool that is maintained by the OS. This pool is "topped up" from sources of randomness available from the hardware. If the pool is depleted, attempts to read /dev/random will block.

    On a bare metal system, a lot of entropy can be harvested from the hardware. On a virtual machine, the physical hardware sources tend to be hidden from the guest OS. So the rate of replenishing entropy pool can be a lot slower. In extreme cases, this can lead to slow SSH connection establishment.

See also:

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2019-01-16 05:13:44 -0500

Seen: 218 times

Last updated: Jan 16 '19