mysql and ssh connection delays
I have a ubuntu dapper server, serving http, ssh and mysql. It is mainly used as a web server. I am a web developer so I have my own apache on my ubuntu feisty workstation to serve my projects locally while I develop. Projects (web apps) are only passed to the server for deployment when they're ready to use. But I do not have another mysql server locally. I use hte server's mysql instance as the database backend for the local applications in my workstation.
Then I have this web app that I am working on right now. The app works fine when served completely from the web server (that is, both the web pages and the database are in the web server.) But when I serve the pages from my local apache, but connecting internally through the network to the mysql backed on the server, the database response time is awfull. I know is the database because I am using ajax and the pages load fast, but ajax responses that connect to the db are awfully slow (20+ seconds the first time, and never less than 5 seconds).
Also, I've noticed that when I type 'ssh username@webserver' to login through ssh into it, it takes between 10 to 20 seconds for it to show me the line "username@webserver's password" asking me for the password. This also happens when I type firstname.lastname@example.org instead of the server's name. So it shouldn't be a DNS problem.
I do not know if the two delayed connections are related, but the most important for me to solve is the mysql connection. I can wait for ssh to ask me the password, as I hardly ever go into the server through ssh, but I have to work on my apps daily and every ajax request takes soooooo long.