LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   server slow response to one computer but not the other (http://www.linuxquestions.org/questions/slackware-14/server-slow-response-to-one-computer-but-not-the-other-4175424446/)

BCarey 08-28-2012 02:06 PM

server slow response to one computer but not the other
 
I am having a strange problem with a significant lag time between 1 specific computer and a server. I have a server (Slack 13.37 64bit) running apache and sshd. The http server hosts php and perl web applications and other apps are run over ssh. At a different site I have two computers running on a LAN together.

One of the clients (laptop running -current) experiences no lag time when accessing the http/ssh server. The other (Slack 13.37 64bit) experiences significant lag time (up to a minute) before getting a response if there has been no contact for a number of minutes. Once that initial response comes, there is no more lag until I stop accessing the server for a while.

I have tried both firefox and google, and both exhibit the same behavior, as does ssh.

I didnt' find anything that jumped out at me in the server logs.

Can anyone suggest where to look for the problem?

Thanks in advance.
Brian

tronayne 08-28-2012 03:22 PM

Sounds like DNS -- are you using the DNS built in to a router (or switch)? Be a good idea to use external addresses; e.g., Google DNS servers (free to use), you only need two:
Code:

cat /etc/resolv.conf
search com
nameserver 8.8.8.8
nameserver 8.8.4.4

Look at your /etc/resolv.conf and see what's there (a local BIND service that... uh, isn't?)

How about the gateway address -- is it correct (or maybe some change took place)?

Also, if your systems are fixed IP, put their address and name (including the address and name of your local system) in /etc/hosts (but don't put any DHCP names and addresses in there; DHCP addresses change). For example,
Code:

cat /etc/hosts#
# hosts                This file describes a number of hostname-to-address
#                mappings for the TCP/IP subsystem.  It is mostly
#                used at boot time, when no name servers are running.
#                On small systems, this file can be used instead of a
#                "named" name server.  Just add the names, addresses
#                and any aliases to this file...
#
# By the way, Arnt Gulbrandsen <agulbra@nvg.unit.no> says that 127.0.0.1
# should NEVER be named with the name of the machine.  It causes problems
# for some (stupid) programs, irc and reputedly talk. :^)
#

# For loopbacking.
127.0.0.1                localhost
192.168.1.10                fubar.com fubar
192.168.1.15                InkJet
192.168.1.20                snafu.com snafu
192.168.1.30                pita.com pita

# End of hosts.

That way, ssh, a browser, ping, whatever can find 'em quick (by the way, that InkJet entry is a H-P network printer).

Hope this helps some.

BCarey 08-28-2012 03:48 PM

Thanks for the ideas.

I'm using the 4.2.2.x nameservers. I don't think it's dns because it only happens when trying to access the one server. The access is across the WAN and the server has a changeable ip so /etc/hosts would not help.

Brian

tronayne 08-29-2012 08:06 AM

Have you tried ping or traceroute (or tcpdump or netstat)? One or the other ought to show you how you're getting to that sever and may give a hint. I would think that if you ping by name and it takes forever that it's a DNS problem. As you say, the server has a changeable IP address -- find out what it is "right now" and ping by that address and see what you get.

Really long delay times do sound like DNS -- if the first DNS server in your /etc/resovlv.conf list is having problems it can take quite a while before the second DNS server listed is tried. If you ping the first listed DNS server address and get horridly long time values, try the second listed server and see what happens and, if it's good, just swap them (or try a different DNS server altogether).

Something else to look at would be the same information on the laptop that doesn't display the problem; ping, traceroute, compare /etc/resolv.conf and /etc/rc.d/rc.inet1.conf. Do you get the same behavior if you're connecting to the outside world instead of that server?

What the heck, try a different cable or different router/switch port.

Hope this helps some.

yenn 08-29-2012 11:21 AM

Maybe you could try iperf, to check network capabilities. If you see noticeable low throughput, check cables, switches, routers, etc. on the way.

BCarey 08-30-2012 09:24 AM

Thanks for the ideas. I hope to be able to test them in the next couple of days. With regard to the DNS, I did change the servers in /etc/resolv.conf and there is no difference.

Brian

Celyr 08-30-2012 06:39 PM

Code:

dmesg
?

BCarey 08-31-2012 11:24 AM

I was able to test a few things...

It is not DNS. I have tried various DNS servers in /etc/resolv.conf and there is no change in the behavior.

traceroute gave the same results on both clients. I'm not sure what to look for with the netstat command.

The problematic client is a desktop so I can't easily test it on another network. I can't easily try a different router, either, because the one I am using is a Qwest DSL Modem/Router. I could add another router to the configuration but I can't eliminate that one.

Brian

BCarey 12-05-2012 12:07 PM

It's back again.

I never resolved this problem, but it went away by itself, so I dropped it. And the problem is still gone, for that computer. But for the past week or so another computer on the same network is having exactly the same problem.

To summarize:
Server is connected to a router connected to a cable modem. Client is on a different LAN, connected to the internet by a DSL modem/router.

After a period of dormancy, when the client connects to the server via http or ssh there is a significant lag before getting a response, sometimes a minute or more. After it does connect, response time for subsequent connections is normal until there is no activity for a period of time, say 5 minutes or so. Then the problem recurs. Other computers on the client LAN are not affected, and the affected client has no problems with other internet addresses.

One more thing, since the newly affected computer is a laptop I brought it to the server's LAN and there is no lag, even if I use the server's WAN address.

If anyone has any other ideas for me, I'd appreciate it.

Thanks,
Brian

Celyr 12-06-2012 06:34 AM

have a look with tcpdump

tronayne 12-06-2012 10:03 AM

Your problem looks, sounds and smells like DNS -- the machines don't know where to find one another. Too, because you say that that after a period of dormancy, it sounds like a DHCP lease has expired.

Something you may want to try is configuring things a little differently. Take a look at the post here http://www.linuxquestions.org/questi...9/#post4826521. The various servers' network information is in the configuration file (thus no need for a DNS look up -- that long delay just screams DNS).

Read though the post and see if it makes sense to you.

Hope this helps some.

BCarey 12-08-2012 02:35 PM

Quote:

Originally Posted by tronayne (Post 4843804)
Your problem looks, sounds and smells like DNS -- the machines don't know where to find one another. Too, because you say that that after a period of dormancy, it sounds like a DHCP lease has expired.

Something you may want to try is configuring things a little differently. Take a look at the post here http://www.linuxquestions.org/questi...9/#post4826521. The various servers' network information is in the configuration file (thus no need for a DNS look up -- that long delay just screams DNS).

Read though the post and see if it makes sense to you.

Hope this helps some.

I'm not sure how this applies to my situation. The server's WAN address is not fixed and I don't want to pay the extra money to do so. So I don't see how I could use /etc/hosts. With regard to dhcp, are you suggesting that there is a problem between the client and the client's router?

I've been trying to wrap my head around this one for a while.

Brian

tronayne 12-08-2012 03:45 PM

Something you might want to look into, just for grins if nothing else, is DynDNS (http://dyn.com/dns/) or a similar service.

You register one or more domains at DynDNS and install their software on you system that takes care of any IP changes that your providers make and the domains you've registered immediately are switched to the new IP address at the DLS or cable modem. I've used it for years with a DSL modem with less than zero problems. You don't have to fiddle with your routers, you don't have to fiddle with the modem, it all happens automagically on the individual servers when the IP address changes for whatever reason.

Now, they used to have a free service (I don't know if they still do) but at a minimum of $15 a year, you essentially get a fixed IP address that the outside world can get to (which would be the servers you're having the problems with). It'll do a nice job with machines at separate locations or, for that matter, any machine connected to a public network somewhere or other that you can SSH into, get to a web page and all the other stuff you'd like to do. Look around on their site for the free version (if it's still there, that is).

It's about the cheapest way I know of to deal with the shifting IP addresses problem with your ISPs.

Might be worth a look-see.

Hope this helps some.

BCarey 12-11-2012 07:18 PM

I'm actually using freedns.afraid.org for the management of the dynamic WAN address at the server network.

Brian

BCarey 12-11-2012 07:22 PM

Quote:

Originally Posted by Celyr (Post 4843699)
have a look with tcpdump

Could you elaborate? I'm not familiar with the tool and I'm not sure what I would be looking for.

Brian


All times are GMT -5. The time now is 11:10 PM.