Linked files missing from pages - squid issue?

Hi all,


I'm stumped. I've recently restored a backup of our PROD system to our QA system and when loading either frontend sites or the _admin backend various page elements are sent as zero byte files. This includes the asset map and random(?) images and CCS files from the site.



We're using squid as an accelerator and this is the likely culprit as the site loads fine when accessed directly via Apache (ona different port). Our squid.conf is identical to our PROD system where Matrix is working fine.



Here's an example from the various logs:



/var/log/httpd/access_log

10.31.66.91 - - [22/Dec/2009:13:06:23 +0800] "GET /__data/assets/image/0016/88/header-ecu-logo.gif HTTP/1.0" 200 5886 "http://www.qasite.com/_designs/ecu-internet/css/global.css" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 (.NET CLR 3.5.30729)"



/var/log/squid/access.log

10.31.66.91 - - [22/Dec/2009:13:06:23 +0800] "GET http://www.qasite.com/__data/assets/image/0016/88/header-ecu-logo.gif HTTP/1.1" 200 475 TCP_MISS:DEFAULT_PARENT



/var/log/squid/store.log

1261458383.528 RELEASE -1 FFFFFFFF A9754E77194C6D4BF995B30872674EAF 200 1261458383 1251348375 -1 image/gif 5886/0 GET http://www.qasite.com/__data/assets/image/0016/88/header-ecu-logo.gif



Apache is sending a valid file with a Content-Length header that matches the size of the file but squid seems to think it's zero bytes and is sending zero byte sized files.



Any ideas?

[quote]
Any ideas?

[/quote]

No, not really, but…



Are you getting the 0 sized reply error from squid or your client (e.g. firefox)?



If it's from Squid you'll see something like:

    The following error was encountered:
    * Zero Sized Reply
    Squid did not receive any data for this request.


If it's from the client it's probably some network config being bad between you and the Squid server.

Just for some stuff to try...

Raise Apache's LogLevel setting to "debug" and look for any errors around the time the 0-sized-reply entries are appearing in Squid's access log. There are similar debug settings for Squid but I don't know them off the top of my head.

If the errors are common enough try pointing your browser straight at Apache and see what happens.

Make sure your route table looks sane on both boxes. Make sure the subnet mask is what it should be in UAT. If you have multipath ethernet interfaces confirm you've got that config in a healthy state.

Good luck.

Thanks for the reply David.


This turned out to be Apache. There are 'performance tuning' options that default to 'on' but should be disabled for NFS. Apparently RedHat's GFS is similar enough that these options need to be disabled for that too.





------------------------------------------------------------------

EnableMMAP: Control whether memory-mapping is used to deliver

files (assuming that the underlying OS supports it).

The default is on; turn this off if you serve from NFS-mounted

filesystems. On some systems, turning it off (regardless of

filesystem) can improve performance; for details, please see

http://httpd.apache.org/docs/2.2/mod/core.html#enablemmap

#

EnableMMAP off



#

EnableSendfile: Control whether the sendfile kernel support is

used to deliver files (assuming that the OS supports it).

The default is on; turn this off if you serve from NFS-mounted

filesystems. Please see

http://httpd.apache.org/docs/2.2/mod/core.html#enablesendfile

#

EnableSendfile off