Home Linux server is slow (but fast to the outside world)

1

I have a Linux server connected via Ethernet to my router. If I connect to the server from a laptop via wireless (192.168.2.2), all requests - whether terminal or HTTP - are slow. It takes a long time to respond to my login and web page requests.

The server is just for testing and has no load, so what could be causing the slow speed? Connections to the outside world are fast.

My router does not see my Linux box and the IP address it assigned,but I can connect to it from another . I have a DHCP client running.

Not really sure how adding my laptop to the servers hosts file will help. I'm used to having a hosts file on my client to redirect a domain name to a different IP (for testing websites). What would I put in the servers host file? I'm just connecting with an IP. (ssh mike628@192.168.2.2)or in the browser putting the IP address.

My hosts file looks like this:

127.0.0.1   localhost
127.0.1.1   NASBD122F.Belkin    NASBD122F

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

ALSO once I am connected via ssh , the commands run pretty fast

mike628

Posted 2011-07-21T00:39:28.240

Reputation: 113

Is the server itself under load and unresponsive? If you go to the console of the server, is it snappy there? – Nathan Powell – 2011-07-21T01:00:10.023

Hmm... have you ping'd it to get a more exact metric than "slow"? – new123456 – 2011-07-21T01:43:28.000

Is it still slow if you connect with a cable? – Joe Internet – 2011-07-21T01:46:00.377

Answers

5

Mostly likely it's trying to do a reverse DNS lookup of your IP address and failing. Is DNS configured on it? Try adding your laptop to its /etc/hosts file.

Keith

Posted 2011-07-21T00:39:28.240

Reputation: 7 263

0

Are you connecting directly using the IP address of your server or are you using it's host name?

Unless you are using a fully qualified domain name for your host, you're probably relying on some resolution service like SMB or mDNS (Bonjour) to convert the host name into IP. The service could be slow or misconfigured, or it may have returned IPv6 addresses that your host cannot handle properly. Try pinging the address and see what happens. (Try both ping and ping6 under *nix.)

Also, sometimes it might take several hundred millisecond to run an ARP lookup (i.e. to convert IP to MAC address) over WiF, so if the result is not cached properly, you will get a significant delay as well. Use arp -a to see if your server is in your ARP cache.

You mentioned terminal and web requests and they all work over TCP, so the slowness can also be caused by problems during TCP handshake. Maybe you have a faulty wire or improper MTU. Does it feel slow once TCP connection is established, e.g. after you have successfully connected via terminal?

billc.cn

Posted 2011-07-21T00:39:28.240

Reputation: 6 821