A hang at that stage of the connection indicates that the host is not responding, and dropping packets to port 22.
If I am correct in interpreting your post as that for some period both the web server port 80 and the sshd server port 22 are inaccessible, how you proceed depends on whether you are local the machine, and what sort of logfiles you have access to.
Start with a ping to see if the box is up, also check whether the network is up, ie check the backend systems (if you are remote) because the link might be going down.
tail the /var/log/messages and watch "netstat -antp" for the count of connections to the box.
you can use tcpdump or wireshark to see if anything at all is coming back from your connection attempts.
Really, you are probably going to need to provide more details of your setup to get a thorough answer...
some possible ideas are;
Virtual Servers
Some ISP provide "artificial" limits on vserver threads and processes, above that of the OS ulimit settings, this might be limiting connections.
Denyhosts, fail2ban, tcpwrappers
these can be configured to block connections if you have failed authentication