views:

316

answers:

4

I have created a simple JSF image browsing app, and I'm having a problem with firefox.

The app itself is running inside Tomcat. The pictures are stored in a directory that is served by Apache. I've got 9 pictures that get shown on a page. The servers are on a machine separate from the client. When I try to load the page in firefox, usually 6 of the pictures will load almost instantly (< 500ms). The other three will take between 15 and 20 seconds to load. Looking at the apache logs, it seems like firefox isn't requesting those three pictures until the 15-20 seconds have passed - that is, I see 6 requests at the same time, then 15 seconds later the other three. I have tried the site in internet explorer, and IE doesn't have this problem; it loads all 9 pictures right away. I've tried a few different machines, and have the same results. The html is rendered very quickly, < 200ms, so I don't think this is a JSF issue (especially since the pictures are served from apache).

The numbers aren't always the same either - sometimes it will load 8 images, sometimes 7, sometimes the second batch of requests will all come at once, and sometimes it will load 2 more, than one more, etc. I'm not sure if this is a firefox setting, or a bug, or if there's anything server side I can do about it, but I thought that I'd throw it out there and see if anyone has any ideas I can try.

If it helps, here's an apache log line from firefox

192.168.1.30 - - [04/Mar/2009:14:25:40 -0500] "GET /work/DSCF0185_thumbnail.jpg HTTP/1.1" 200 7902 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6 (.NET CLR 3.5.30729)"

and one from IE

192.168.1.30 - - [04/Mar/2009:14:34:14 -0500] "GET /work/DSCF0179_thumbnail.jpg HTTP/1.1" 304 - "http://192.168.1.83:8080/app/browse.jsf" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 1.1.4322; MS-RTC LM 8; Windows-Media-Player/10.00.00.3990; FDM; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"

Edit I got the timings from Firebug - it's showing that the entire request is (for example) 18 seconds, with 17.9 seconds "recieving data", and the rest taken up in queuing. I'm not seeing the actual request in the Apache log until the end of that 17.9 seconds though, which leads me to believe it's a firefox thing, especially since IE doesn't show the problem. If it were in the server, I would expect to see the problem in both browsers.

Pipelining in firefox is turned off.

As was pointed out, my IE log shows it's hitting the cache - my mistake, grabbed the wrong part of the log file. Here's a clean log line - even after a cleared cache, IE doesn't show the same problems as firefox.

192.168.1.30 - - [04/Mar/2009:15:52:18 -0500] "GET /vantagework/DSCF0189_thumbnail.jpg HTTP/1.1" 200 5805 "http://192.168.1.83:8080/vantage/browse.jsf" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 1.1.4322; MS-RTC LM 8; Windows-Media-Player/10.00.00.3990; FDM; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"
+3  A: 

Use Firebug's "Net" console to check whether it is firefox, or the webserver, as your webserver might be taking it's time to accept the connections.

Firebug's "Net" console will show you when it starts requesting things, and give you a detailed breakdown of the different parts of requesting the image (queuing, etc etc)-

Mez
A: 

According to your log snippets, IE is retrieving the image from cache, Firefox is getting it from the server. So if there is something wrong with the server configuration that is delivering the image slowly, you will only see similar behaviour in IE if you clear the cache first, so I'd try that to verify that non-cached images do indeed take different amounts of time to download between Firefox and IE.

The other thing I would check is to see whether you have pipelining enabled in Firefox. If you do, I'd suggest you disable it, it maybe be causing a problem for your server.

Grant Wagner
A: 

It turns out that this was caused by my apache configuration. Some tuning adjustments had been made, and reverting to the out of the box apache configuration fixed the problem.

Matt McMinn
A: 

What in your 'apache configuration' caused the issue?

I am experiencing this same issue, and would love to know where to look to fix ...

Gemini420
I had played around with the amount of servers running, min/max, threads/requests per child etc - resetting these to the defaults is what fixed the problem.
Matt McMinn