Experimenting with Squid in "schizoid" mode...

From: Clifton Royston <cliftonr@dont-contact.us>
Date: Mon, 26 Jul 1999 15:02:14 -1000 (HST)

  Driven mostly by curiosity, I decided to see if I could bring up two
distinct instances of Squid on the same machine, in line with the
"thought-experiment" I mentioned earlier. This seems to work fine,
after an hour or two of fumbling and false starts, mostly to do with
getting a copy to start up using a second configuration file.

  (Hint for anyone else who wants to try it: use
  squid -f /path/alternate.conf
along with any other options like -z or -k. )

  One instance of Squid is now running on port 8080, with its config
and log files under /usr/local/squid2, and its cache in 384MB of memory
file system (RAM disk) mounted on /tmp2.

  The other is now running on port 3128 in pretty much the same
configuration I've been running until now, with its config files and
logs in the usual /usr/local/squid, and about 1.6GB of cache space on a
hard disk mounted on /var2. The first instance of Squid is configured
to always talk to this one as a parent proxy.

  Both are configured to communicate via ICP and cache digest, and both
have "no_cache" set for certain patterns like CGI, queries, and
hotmail; the first (memory-only) has:

  http_port 8080
  icp_port 8082

  # Peer with Squid on this same server on the other port/process.
  cache_peer web-cache1.lava.net parent 3128 3130

  maximum_object_size 100 KB

  acl LOSERS url_regex ^http://www\.hotmail\.com/$ ^http://hotmail\.com/$
  acl QUERY urlpath_regex \? cgi

  no_cache deny QUERY
  no_cache deny LOSERS
  prefer_direct off
  never_direct deny LOSERS
  never_direct deny QUERIES
  never_direct allow all

so that, if I understand correctly, it will always go via the disk
cache Squid when it fails to serve a hit from memory, *except* when the
URL is something the disk cache Squid is certain not to cache. (As
it's the same machine, if one service is up, the other almost certainly
is too.)

  Where's the problem? There isn't one. I thought the developers in
particular might be interested to hear about an unanticipated and
experimental configuration that works fine. So far I can't see any
performance gain - in fact, there seems to be a visible hit on the
first fetch of any new file - but that's probably because I
accidentally blew away the disk cache while trying to initialize the
memory file cache. If I can make time to do some actual performance
tests, I'll post the results, and see if this actually performs
reasonably well.

  -- Clifton

-- 
 Clifton Royston  --  LavaNet Systems Architect --  cliftonr@lava.net
        "An absolute monarch would be absolutely wise and good.
           But no man is strong enough to have no interest.  
             Therefore the best king would be Pure Chance.  
              It is Pure Chance that rules the Universe; 
          therefore, and only therefore, life is good." - AC
Received on Mon Jul 26 1999 - 18:40:48 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:47:33 MST