2

I am running apache2 2.2.14 on Ubuntu 10.04. I have two virtual servers running, both using virtually the same conf script in sites-available. One of the pages (robertsmetrology.krazycraig.com) renders super fast (1 second F5 on index.html), no problems at all. The second (robertsmetrology2.krazycraig.com) takes forever to render (18 second F5 on index.html). Contrary to the code, the fast loading site, being developed in Frontpage has lots of scripts to run. The second, none, only HTML5 and CSS3. I'm using zoneedit as my DNS server for both sites and the the Zone records are exactly the same. I've looked at the access and error logs as well as messages, going as far as changing the apache2 LogLevel variable for the virtual servers to debug. I've done a W3C validation and the only problems with the slow loading site are invalid meta tags and an & (instead of & amp;) in the href property of an anchor tag (e.g. href="http://whatever.com?a=1&b=2"). And after fixing those the page render speed didn't change. Both pages use the same images and text, the only real difference being the slow rendering page is HTML5, using tags such article, header and footer, and the other uses div and table formatting everywhere.

I am stumped as to why one page renders so slow and it's contemporary so fast. Can anyone point me in the right direction to debug this problem?

Thanks for your help.

EDIT: So I thought maybe there was something in the file that was causing the slow render. To check this, I replaced my index.html with an index.html that looks like this...

<!DOCTYPE html>
<html>
  <head>
  </head>
  <body>
    test
  </body>
</html>

Still it takes over 3 seconds to render.

2 Answers 2

1

In Chromium or Chrome you can go to Developer Tools and select Network option to see how long it takes to load each resource. Typically when a page loads slowly it is because the browser is trying to access something that is either not found on the server or it is accessing content on a different server.

1

I've seen an issue where apache2 will start queuing requests after it hits a maximum number of simultaneous connections. The issue happened only for one virtual host which had a lot of simultaneous connections.

To find out if you've reached this limit, first find out which MPM you are using by running this command:

apachectl -V

Check out what settings are available for your MPM and what they have been set to on your server. This may be in httpd.conf or a similar file depending on your setup. If nothing is set up for your MPM then you will be using the default values.

Next, check the Apache documentation for the MPM you are using. For example, if you are running the worker MPM on apache 2.2, visit https://httpd.apache.org/docs/2.2/mod/worker.html . Read through the settings and see what the maximum number of simultaneous connections would be.

If mod_status is not enabled, try to enable it but make sure it is not accessible to the public. Replace your_ip_address with a whitelisted ip address or host name as desired. It will require a restart of apache.

<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from your_ip_address_or_host_name
</Location> 

Then when you visit http://your.server/server-status (may need https if you are using TLS) you will see how many requests are being processed simultaneously. If this is maxed out, then consider tuning your MPM settings to meet the demand on your server.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .