LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-05-2002, 02:42 AM   #1
mdscudder
LQ Newbie
 
Registered: Mar 2002
Location: Johnson City, NY
Distribution: Slackware 8
Posts: 9

Rep: Reputation: 0
Local websites are slow


Hello. Just found these forums so please be nice :-).

I figure myself rather competent with Slackware 8, but this one's been bugging me for awhile. I host a few servers off of cable modems in this area (business class *and* the no-no home-class, so that probably doesn't matter). My usual setup is Apache/PHP/MySQL (latest, in fact I put in one today with all the latest) on Slackware 8, and the server also functions as the router with IP Masquerading. So my webserver has two ethernet cards, one connected to the cable modem, and one connected to the hub that connects the computers in the LAN. The Slack box runs dhcpd for IPs internally.

Here's the problem. If I'm sitting at home and I view sites on the server at the office, they come up instantly. If I view sites on the server at the office on the office's LAN, there are extreme delays (30-90 seconds) on page requests. Same thing goes for the other way around: If I'm at the office and I hit sites on a server at home, it's as fast as any site. If I'm at home and I browse sites locally, it lags like crazy. I would think that this would be the other way around.

My DNS entries are hosted in NYC (about four hours' drive from where I'm at), but if that was the problem it would be the problem all over. The servers are pretty much copies of one another (I always reference existing config files, sometimes copy them straight over if the config is similar enough). Both LANs access the outside internet (i.e. anything I'm not hosting locally) very quickly. I just had to move some sites home and I'm kind of frustrated because it seems I either get the luxury of working on sites locally (say, with HomeSite or UltraEdit over a Samba connection), or I get the luxury of not waiting 60 seconds to see a change I've made after I hit refresh, but never both.

Hardware is pretty standard, 10/100 cards and hubs all around, good wiring. All Intel or AMD machines. Workstation OS has been Windows 98, Windows 2000, and Windows XP (no flames please, they're good for what they're good for and their mere existence is not the problem, that I'm relatively sure of).

Please tell me the problem is simple to fix... it's been driving me crazy for longer than I care to admit :-)

-Mark
 
Old 03-05-2002, 04:57 AM   #2
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
Sounds like a weird problem, I don't think I have the answer but maybe a few things which might help you get closer to the solution.
You could check the /etc/nsswitch.conf file to make sure it's using the right place to resolve the domain name. Might be trying to get it from some nis server which is slow.
You could also try to rule out any dns problems by accessing everything by ip number. You might have to configure apache for that to since it usually uses the FQDN. And make sure apache is not trying to reverse dns ip numbers for it's log files.
I don't think it has anything to do with routing because then other traffic would also be slow. Unless you've got special routes for web traffic.
 
Old 03-05-2002, 06:51 PM   #3
mdscudder
LQ Newbie
 
Registered: Mar 2002
Location: Johnson City, NY
Distribution: Slackware 8
Posts: 9

Original Poster
Rep: Reputation: 0
Turns out I *was* using HostnameLookups in Apache. I turn it off, and everything flies. It's too bad though, I sort of like seeing where hits are coming from.

Now, is there a best-of-both-worlds scenario, where I can have it do hostname lookups just outside the LAN, and/or provide hostnames for the internal IPs?

Thanks!
-Mark
 
Old 03-06-2002, 03:12 AM   #4
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
I suppose you could add all the host names to /etc/hosts and then make sure you check files first when resolving hostnames. Might get tricky though since you are using dhcp for your clients unless you've set it up so that each machine always gets the same ip number.
I've never really worked with a dhcp server but I suppose it should be able to pass on the hostname and ip number it just leased to a client. Maybe it would work well in combination with a nis server or maybe a caching dns server. But I really wouldn't know how to get that set up.

I was just looking around on the net and I found something better. Apache comes with a small program called logresolve. It resolves ip numbers in log files. You can schedule it as a cron job to resolve the ip numbers in your log files every so often, without it ever affecting the speed of apache when it runs.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help! My local network is slow! Likosin Linux - Networking 4 10-03-2005 04:28 PM
Local net - slow down, good up lackluster Linux - Networking 8 09-10-2005 04:34 PM
(first) connection to websites is slow KENTOSI Linux - Networking 1 04-09-2005 09:54 PM
BIND 9: Slow response from root servers. Local is ok. Apollo77 Linux - Networking 3 01-14-2005 10:22 AM
SLow Speeds ETH1 > ETH0 > Local network - Help!!! Tekel Linux - Networking 2 09-29-2004 05:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration