Click to See Complete Forum and Search --> : Apache 2? Slow? .css and .js cached? PICS ATTACHED


cluettr
02-15-2007, 12:32 PM
OK, I've been pounding my head against the wall.

Scenario:

Moving my website from a 700 mhz 256 MB machine to a 1.8 Ghz 512 MB machine because the existing server was running out of HD space (these are actually desktops). I assumed I would see some sort of improvement in the site. I went from Apache 1.3.3 to Apache 2.2.3 w/ mod_deflate and mod_expires to speed up the rendering of pages. Additionally I installed Xcache and Zend Optimizer which I have now disabled to troubleshoot.

Generally what is wrong:

Since moving the site it has come to a crawl. On the old box the main page would render in under 18 seconds. Yes, that is generally slow but there was no compression or caching involved and the main page is at about 400k. So this would be expected behavior. On the new box I am looking at over a full minute (60 seconds).

Some Details:

Using Firebug under Mozilla I compared the loading of the site on the old box and on the new one. It seems that .js files and .css files in the new site take 1.5 seconds to load a piece compared to sub 100 ms on the old. Caching seems a bit screwy here to since I thought that .js and .css are generally cached anyway. When I do an [F5] in Firefox to open the page bypassing the cache it takes the full 60 seconds. I figured with mod_deflate and mod_expires I'd gain at least something but it seems like I am going backwards here. How can Apache 1.3.3 on a low low low end machine outperform this new box. Something is seriously wrong here but I've looked everywhere I know how. Has anyone run into this? Or does someone have an idea of what could be the culprit?

Here are the Firebug Net Charts:

OLD SITE :: Bypassing the Cache (http://www.cluett.net/old_bypasscache.bmp)
NEW SITE :: Bypassing the Cache (http://www.cluett.net/new_bypasscache.bmp)
NEW SITE :: From Cache (http://www.cluett.net/new_fromcache.bmp)

Stephen Philbin
02-15-2007, 01:28 PM
Not sure what to make of those images. They quote different file sizes for the same file names and don't have all the same items listed.

You say you have more than one machine. Presumably then you have a router? Have you ever made sure your router and software firewalls on your boxes are correctly configured?

cluettr
02-17-2007, 01:26 PM
Yes, I did tweak the new server a bit (which is why the images differ) but if you notice just the .js and .css files it takes 18+ seconds to download files that range from 2KB to 13 KB ... there aren't enough to cause 18+ seconds of download time. The other oddity is that no matter the files size they all take about 1.5 seconds a piece, I'm stumped. There has to be something different with the config on this new server ... anyone?

cluettr
02-17-2007, 04:11 PM
I'm a routing/switching guy so after sniffer traces, fuddling with switch ports and vlan changes I finally found the issue... After I images my linux box to another computer it set the duplex on the NIC to half. The switch port was running at full ... made the change and it sped things up considerably...

Still have a weird issue... before Firebug even reports anything it takes about 8 seconds as if the server is negotiating something... very strange. If I could cut out that time I could get my page loading in 4 seconds. Anyone run into the delay before... where it says... Waiting for blah.blah.com before anything starts getting downloaded to the broweser?

ray326
02-17-2007, 11:56 PM
The other oddity is that no matter the files size they all take about 1.5 seconds a piece, I'm stumped. For small files the actual data transfer is swamped by the protocols.