Re: [squid-users] mod_gzip for squid ?

From: Brian <hiryuu@dont-contact.us>
Date: Wed, 06 Mar 2002 17:25:00 -0500

On Wednesday 06 March 2002 04:46 pm, Christian Bjerre wrote:
> B> We have 4 squid servers running the front line with a parent
> B> cache for static files in tier 1. We have a pair of apache servers
> B> as tier 2, and separate file and SQL servers in tier 3.
> B> Of the 20Mbit typically going out the front, about 2.5
> B> actually comes off tier 2. Pretty much all html and php.
>
> Weheey, that's exactly the kind setup, I want to implement here!
>
> Do you have a squid configfile and can have a look at - really
> interested in how you defined which objects must not be cached and large
> incomming posts (running a loaded photo site)

Thankfully apache allows you to send full URLs as requests (part of http
1.1), so it can pretend to be a parent proxy. Also, since PHPs don't send
last-modified or expires headers by default, squid will not cache them.
You can use the php header() function to cache certain pages if you wish.

# 50 is the zipcache, 12 and 11 are the main and failover.
# Squid also supports round-robin, which you may find useful.
cache_peer xx.xx.xx.50 parent 80 7 no-query
connect-timeout=10
cache_peer xx.xx.xx.12 parent 80 7 no-query
connect-timeout=10
cache_peer xx.xx.xx.11 parent 80 7 no-query

# in_memory is the average object size on here.
# These will take some trial and error.
cache_mem 160 MB
maximum_object_size 4096 KB
maximum_object_size_in_memory 40 kB
cache_dir aufs /var/squid 3500 16 32

acl all src 0.0.0.0/0.0.0.0
acl zips urlpath_regex -i
\.(zip|mp3|exe|r..|bz2|sit|mpga|hqx|mpg|tgz|ip|mpeg|mid|gz|dxtheme|pdf|mov|wav|avi|lzh|bin|wba|asf|ra|adz|tar|rm)$
acl images urlpath_regex -i \.(gif|jpg|png|swf|txt|jar|xml)$

# Don't forward zips if the zipcache is down
cache_peer_access xx.xx.xx.50 allow images
cache_peer_access xx.xx.xx.50 allow zips
cache_peer_access xx.xx.xx.12 deny zips
cache_peer_access xx.xx.xx.12 allow all
cache_peer_access xx.xx.xx.11 deny zips
cache_peer_access xx.xx.xx.11 allow all

# Don't go direct, but httpd_accel is needed to accept requests
never_direct allow all
prefer_direct off
httpd_accel_host xx.xx.xx.12
httpd_accel_port 80
httpd_accel_single_host on
httpd_accel_uses_host_header on

# Cap uploads at 3MB and turn the client_db off.
request_body_max_size 3 MB
forwarded_for on
store_avg_object_size 32 KB
client_db off

> How do You gather logging information ?
> Shared filesystem with both apoache and squid logs in one ?
> * that's my only problem left, since the big jerk I am constructed a
> custom apache log and made a c program to parse, which means tons of
> work, to change it back to standard apache log :( *

Actually, we have a nightly process on each box merge the log information
into an SQL database.

        -- Brian
Received on Wed Mar 06 2002 - 15:32:53 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:06:45 MST