LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-02-2010, 03:42 AM   #1
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 690

Rep: Reputation: 34
Local webserver running slow


Hello,

for some reason when we browse our website on our local webserver (test environment) the pages load very slow.

There is no lack of memory, no lack of disk space, no lack of CPU power and as far as I know our network is very fast.

Don't know where to begin looking, any suggestions ?
 
Old 11-02-2010, 04:36 AM   #2
alli_yas
Member
 
Registered: Apr 2010
Location: Johannesburg
Distribution: Fedora 14, RHEL 5.5, CentOS 5.5, Ubuntu 10.04
Posts: 559

Rep: Reputation: 92
First thing is to check your network connection - try hitting your homepage directly on the machine (that is not via the network). Thereafter verify that system resources are not being exhausted on the server. Since its a test environment, it may be a good idea to bounce your web server as well and see what that does.
 
Old 11-02-2010, 04:44 AM   #3
quanta
Member
 
Registered: Aug 2007
Location: Vietnam
Distribution: RedHat based, Debian based, Slackware, Gentoo
Posts: 724

Rep: Reputation: 101Reputation: 101
- Which webserver are you running? Post your configuration file?
- Try to browse via IP address instead of domain name
- Try to sniff some packets from server and client with tcpdump
 
Old 11-02-2010, 05:53 AM   #4
rew
Member
 
Registered: May 2010
Posts: 36

Rep: Reputation: 3
With Linux these problems are easy to solve: you can trace every part of the process.

I suspect that your issue is DNS related. However, don't take my word for it.

You can run strace -p <pid-of-process-to-trace> If you can watch this live, you can see where it stops to wait for something.

You can trace your browser program (if that's graphical this will be difficult because it will be doing stuff with your screen all the time (e.g. animating rotating foxes)) or your webserver.

If there is a network involved you can also trace the packets on the network using tcpdump as suggested above.
 
Old 11-02-2010, 05:58 AM   #5
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: RHEL/Ubuntu/Debian/Fedora/Centos/K3OS
Posts: 1,159
Blog Entries: 4

Rep: Reputation: 149Reputation: 149
Hi,

Did you try changing the browser?

May be your browser has some problem.Try if other site opens properly on the same browser.

Also can you try hosting virtual site on the same webserver and see if it loads correctly.
 
Old 11-02-2010, 08:05 AM   #6
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 690

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by quanta View Post
- Which webserver are you running? Post your configuration file?
- Try to browse via IP address instead of domain name
Config :

<VirtualHost *:80>
ServerName webby.jocan.local
DocumentRoot /var/www/vhosts/webby/html
</VirtualHost>

How can I visit this VirtualHost on IP-address ?
 
Old 11-02-2010, 08:10 AM   #7
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 690

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by rew View Post
You can run strace -p <pid-of-process-to-trace> If you can watch this live, you can see where it stops to wait for something.
Which pid is it that I need to monitor ?

[root@webserver ~]# ps aux | grep httpd
apache 9636 0.0 2.7 31244 6908 ? S 11:30 0:00 /usr/sbin/httpd
root 9802 0.0 0.2 4212 696 pts/0 S+ 16:10 0:00 grep httpd
root 26328 0.0 5.1 31112 13184 ? Ss Oct27 1:14 /usr/sbin/httpd
apache 32500 0.0 3.2 31376 8172 ? S Oct31 0:02 /usr/sbin/httpd
apache 32502 0.0 3.0 31244 7796 ? S Oct31 0:00 /usr/sbin/httpd
apache 32505 0.0 3.0 31244 7788 ? S Oct31 0:00 /usr/sbin/httpd
apache 32507 0.0 3.0 31244 7800 ? S Oct31 0:00 /usr/sbin/httpd
apache 32510 0.0 3.0 31244 7796 ? S Oct31 0:00 /usr/sbin/httpd
apache 32512 0.0 3.0 31244 7800 ? S Oct31 0:00 /usr/sbin/httpd
apache 32514 0.0 3.2 31376 8172 ? S Oct31 0:00 /usr/sbin/httpd
apache 32516 0.0 3.0 31244 7808 ? S Oct31 0:00 /usr/sbin/httpd
 
Old 11-02-2010, 08:14 AM   #8
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
Avoid to keep access_log, error_log with huge size( about more than 2Gb).
 
Old 11-02-2010, 12:51 PM   #9
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 690

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by kirukan View Post
Avoid to keep access_log, error_log with huge size( about more than 2Gb).
The biggest logfile on the webserver is about 7,5MB...

I want to add that I also have problems when using ftp to upload changes to the webserver. I use NetBeans and it takes "abnormal long" to upload changes.
 
Old 11-02-2010, 03:22 PM   #10
0rwell
LQ Newbie
 
Registered: Sep 2009
Posts: 18

Rep: Reputation: 2
From your client machine (i.e. NOT the webserver) run ping -a FQDN (where FQDN is your fully qualified domain name, in your case webby.joneas.com or whatever)

It should give you an ip with the bounce back.

Go into your web browser and type http://ipaddress where obviously ipaddress is the actual ip address, not the word

Does it load faster? I bet it does. If so, you likely have apple talk on your network. Other than ripping that shit out, you're SOL. If it's still slow, there's something drastically wrong with your networking. Is your client machine windows or *nix? If it's windows, try going into the configuration for the network adapter and changing the duplexing from being auto-sense/auto-link to 100Mb/Full or 1000Mb/Full, whatever your network supports. You can also go into teh advanced properties and disable all checksum offloading.. that will help boost performance.

If after all of this, you are still slow as hell, download and install ethereal on your client machine and ettercap on your linux box. Start a network trace on both machines AT THE SAME TIME and then load the webpage. Stop the trace and examine... what you are looking for is a ton of retransmits, dropped packets, anything weird.

Good luck.

_O_
 
Old 11-03-2010, 02:55 AM   #11
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 690

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by 0rwell View Post
Go into your web browser and type http://ipaddress where obviously ipaddress is the actual ip address, not the word
_O_
Like I said, I have several virtual hosts on the machine (Apache on CentOS 5.5). Just replacing the FQDN with the IP-address of the webserver does not load anything.

That's my question: how to reach the virtual host on IP-address ??

Pinging the host on IP-address or FQDN has the same (fast) results. So don't think it's a DNS problem.

I run Firefox on Fedora 12.
I have this in my /etc/hosts :
Code:
192.168.1.151	webserver.jocan.local	webserver webby.jocan.local site2.jocan.local
 
Old 11-03-2010, 05:37 AM   #12
rew
Member
 
Registered: May 2010
Posts: 36

Rep: Reputation: 3
To reach a virutal host on an IP address try the following...
Code:
telnet <ipaddress> 80
GET / HTTP/1.0
Host: www.yourdomain.com
(hit return twice after the "host: " command.... )

Or does the IP address resolve to the virtual local server??

I'm preparing a new server for my webserver, so it is currently local, and the official names still resolve to the IP address on the internet....
 
Old 11-03-2010, 01:41 PM   #13
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 690

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by rew View Post
To reach a virutal host on an IP address try the following...
Code:
telnet <ipaddress> 80
GET / HTTP/1.0
Host: www.yourdomain.com
(hit return twice after the "host: " command.... )
[Jonas@jonas ~]$ telnet 192.168.1.151 80
Trying 192.168.1.151...
Connected to 192.168.1.151.
Escape character is '^]'.
GET / HTTP/1.0

and it stays that way...
 
Old 11-04-2010, 02:07 AM   #14
rew
Member
 
Registered: May 2010
Posts: 36

Rep: Reputation: 3
Did you hit return twice? (i.e. enter an empty line?)


[edit] Rereading... Did you think the "host:" line was the answer from the server? You can omit the host line at first, you should at least get SOME reply if you hit enter twice after the "GET" line....

You have to send a request header. A header can consist of many separate lines, and the server only starts processing it once it gets a complete header. The end of the header is signified with an empty line.

Once you have it working manually, you can do:
Code:
 (echo "GET / HTTP/1.0"; echo "Host: yourhost.com"; echo "" ;sleep 10) | telnet 192.168.1.151 80
(reduce the time of the "sleep" once you have this working. You said it was slow. )

Next you can put this in a script that might take the URL as an argument....

Another way to reach the virtual hosts on the local webserver is to mess with the networking setup. Note that this will deliberately create an invalid networking setup, so it's not for the faint-hearted.

Setup your test-server with the official IP address(es).
next, on your Linux workstation do: route add <officialIPaddress> eth0
Now your linux workstation can no longer reach the official webserver for your domain! it will look for that IP address on the local network and find it there!

Note that for example sending and receiving mail might end up going wrong in this setup. It's very likely that you'll mess up more than you're supposed to. So only try this if you really know what you're getting into.

Last edited by rew; 11-04-2010 at 02:09 AM.
 
Old 11-05-2010, 10:53 AM   #15
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 690

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by rew View Post
Did you hit return twice? (i.e. enter an empty line?)
This the output :

Code:
[Jonas@jonas ~]$ telnet 192.168.1.151 80
Trying 192.168.1.151...
Connected to 192.168.1.151.
Escape character is '^]'.
GET / HTTP/1.0

HTTP/1.1 403 Forbidden
Date: Fri, 05 Nov 2010 17:52:03 GMT
Server: Apache/2.2.14 (Fedora)
Accept-Ranges: bytes
Content-Length: 3918
Connection: close
Content-Type: text/html; charset=UTF-8

[...]

		</div>
	</body>
</html>
Connection closed by foreign host.
 
  


Reply

Tags
local, running, slow, webserver



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
[SOLVED] view local webserver from xp clients by not using ip?? tr1pl3x Linux - Networking 13 07-27-2010 09:16 PM
Taking a specific ip to my local webserver aspedisca Linux - General 3 10-25-2009 07:09 PM
router issue (accessing local webserver) FliesLikeABrick Linux - Networking 4 11-25-2005 11:43 AM
Local webserver -- How to deny all client install their local web server--Please help b:z Linux - Networking 13 04-16-2005 07:11 PM
IPTABLES and local Webserver mpgram Linux - Security 4 05-06-2004 12:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:16 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